On Fri, May 23, 2014 at 01:15:58AM +0200, Thomas Graf wrote: > Signed-off-by: Thomas Graf <tg...@suug.ch>
nl_sock_recv__() compares its 'events' member against EPOLLERR with ==, but EPOLL* are bitmasks so should it use & to test for a single bit? Actually I'm not sure what the 'events' argument means. The comments don't appear to fully explain it, the code only interprets EPOLLERR, and the only effect of EPOLLERR is to fall back to linear receive. nl_sock_recv() and nl_sock_recv_events() must be thread-safe (given independent buffers) but it appears to me that nl_sock_recv_mmap() does not do anything to ensure that a single frame is consumed only once; I don't see any synchronization around the rx_ring pointer. nl_sock_recv_mmap() delegates to nl_sock_recv_linear() in the NL_MMAP_STATUS_COPY case, but it treats the nl_sock_recv_linear() return value as if a negative value indicated error, which it doesn't (it never returns negative). Also upon error from nl_sock_recv_linear() in that case one wonders whether that frame should be skipped (could we otherwise end up looping forever on this frame?). Thanks, Ben. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev