Re: poll problem with PF_PACKET when using PACKET_RX_RING

2006-10-16 Thread Joan Raventos
Is this a bug in PF_PACKET? Should the socket queue be emptied by packet_set_ring (called via setsockopt when PACKET_RX_RING is used) so the above cannot happen? Should the user-space app drain the socket queue with recvfrom prior to (4) -quite unlikely in practice-? >> >> >>>I

Re: poll problem with PF_PACKET when using PACKET_RX_RING

2006-10-15 Thread Patrick McHardy
Joan Raventos wrote: >>>Is this a bug in PF_PACKET? Should the socket queue be >>>emptied by packet_set_ring (called via setsockopt when >>>PACKET_RX_RING is used) so the above cannot happen? >>>Should the user-space app drain the socket queue with >>>recvfrom prior to (4) -quite unlikely in practi

Re: poll problem with PF_PACKET when using PACKET_RX_RING

2006-10-15 Thread Joan Raventos
Hi Patrick, Thx for your prompt reply! Plz see some comments inline. >> >> Is this a bug in PF_PACKET? Should the socket queue be >> emptied by packet_set_ring (called via setsockopt when >> PACKET_RX_RING is used) so the above cannot happen? >> Should the user-space app drain the socket queue w

Re: poll problem with PF_PACKET when using PACKET_RX_RING

2006-10-15 Thread Patrick McHardy
Joan Raventos wrote: > Hello, > > In order to use PF_PACKET/SOCK_RAW with PACKET_RX_RING > one would possibly do (as described in > Documentation/networking/packet_mmap.txt): > 1. setup PF_PACKET socket via socket call. > 2. use setsockopt to change the PF_PACKET socket into > PACKET_RX_RING mode