Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dpif-netlink: Add support for packet receive on Windows.
In this patch, we add support in dpif-netlink.c to receive packets on Windows. Windows does not natively support epoll(). Even though there are mechanisms/interfaces that provide functionality similar to epoll(), we take a simple approach of using a pool of sockets. Here are some details of the implementaion to aid review: 1. There's pool of sockets per upcall handler. 2. The pool of sockets is initialized while setting up the handler in dpif_netlink_refresh_channels() primarily. 3. When sockets are to be allocated for a vport, we walk through the pool of sockets for all handlers and pick one of the sockets in each of the pool. Within a handler's pool, sockets are picked in a round-robin fashion. 4. We currently support only 1 handler, since there are some kernel changes needed for support more than 1 handler per vport. 5. The pool size is also set to 1 currently. The restructions imposed by #4 and #5 can be removed in the future without much code churn. Validation: 1. With a hacked up kernel which figures out the netlink socket that is designated to receive packets, we are cable to perform pings between 2 VMs on the same Hyper-V host. 2. Compiled the code in Linux as well. 3. Tested with pool size == 2 as well, though in this patch we set the pool size = 1. Signed-off-by: Nithin Raju <[email protected]> Acked-by: Alin Gabriel Serdean <[email protected]> Signed-off-by: Ben Pfaff <[email protected]>
- Loading branch information