Comments (4)
I think your first sentence kind of answers why we do not provide support of AF_LOCAL sockets yet. I think you would probably need to spawn a thread that handles epoll_wait() for normal AF_LOCAL sockets. By the way, even if we do eventually extend mTCP to support AF_LOCAL sockets, an mTCP-based AF_LOCAL socket won't be able to communicate with a Linux/BSD AF_LOCAL socket as its underlying implementation is architecturally different (mTCP sockets don't use Linux process file descriptors).
from mtcp.
Thanks for your reply !
I thought of 2 solutions to my problem.
- One is to instantiate new thread for mtcp sockets and keep the existing thread to process local sockets
- Second one is to use mtcp sockets for all kind of domains in order to avoid 2 different threads (as I have to check for mutex locks for the variable access)
I am interested to try both the solutions
In case of solution-2:
I know that mtcp is not using Linux socket descriptors and uses its own file descriptors. Also communication to Linux descriptor is not possible via mtcp stack.
But can I create all the sockets in mtcp context and poll for events using mtcp_epoll_wait() ?
ultimately I have to find out a trigger point for the events to trigger for mtcp supported AF_LOCAL sockets. AF_INET socket in mtcp triggers events in the SYN_RECVD (TCP_ST_SYN_RECVD) state from the TCP stack. similarly I have to find out a way to trigger the events in event queue for mtcp_AF_LOCAL sockets.
In this case I can have only one thread which will wait for events in mtcp queue for both AF_LOCAL and AF_INET sockets.
Is this work? Any suggestions/comments from your side ?
from mtcp.
I think solution 1 will be faster to implement. I am not sure how difficult it will be to integrate support for solution 2 in mTCP stack. I suggest that you first try solution 1 and see if you get satisfactory performance with it.
from mtcp.
Reviving this old issue. I'm in the same situation. Plus, I have a table with file descriptors for AF_LOCAL and AF_INET sockets which all have to be unique. Did you find a good solution to this?
Edit: I'm thinking maybe go with suggestion 1 and have the background mtcp thread trigger an eventfd in the main thread's epoll event loop. As for the fd, I'm thinking dup'ing a dummy fd for each mtcp connection to use as connection identifier for the application.
from mtcp.
Related Issues (20)
- Socket reader and writer in different threads
- Please remove dpdk-iface-kmod HOT 1
- Simple ping-pong mTCP app - slow ping (0.016 sec on a direct 10G connection) - mTCP not production-ready
- CentOS Linux release 7.8.2003 (Core) error: unknown field βndo_change_mtuβ specified in initializer
- Dell R220 Centos 7.8 mTCP DPDK 18.05 ERROR: This system does not support "AES".
- [ MPCreate: 173] Can't allocate memory for mempool! HOT 5
- Is mtcp over DPDK compatible with Linux Kernel 5.9? I got some errors at dpdk-iface.h HOT 1
- error running "epwget" example app, got error "No Ethernet port!"
- Run both the client and server on the same ubuntu system, is it possible?
- mTCP for Mellanox Bluefield SmartNIC HOT 3
- How to send requests to epserver
- DHCP lease time bug
- mtcp make issue HOT 2
- Macronix MX98715 packet driver returns always MAC address 00:00:00:00:00:00 ?
- A bug by static variables in RunMainLoop()
- mTCP make issue HOT 1
- Make issue with mtcp
- Lots of disconnect fail / errors HOT 1
- No route to x.x.x.x when running `perf` example HOT 1
- Strange DHCP issue with PowerLine Adapters?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mtcp.