kernel-ark/net/packet
Daniel Borkmann 87a2fd286a packet: don't unconditionally schedule() in case of MSG_DONTWAIT
In tpacket_snd(), when we've discovered a first frame that is
not in status TP_STATUS_SEND_REQUEST, and return a NULL buffer,
we exit the send routine in case of MSG_DONTWAIT, since we've
finished traversing the mmaped send ring buffer and don't care
about pending frames.

While doing so, we still unconditionally call an expensive
schedule() in the packet_current_frame() "error" path, which
is unnecessary in this case since it's enough to just quit
the function.

Also, in case MSG_DONTWAIT is not set, we should rather test
for need_resched() first and do schedule() only if necessary
since meanwhile pending frames could already have finished
processing and called skb destructor.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-16 16:17:11 -08:00
..
af_packet.c packet: don't unconditionally schedule() in case of MSG_DONTWAIT 2014-01-16 16:17:11 -08:00
diag.c sock_diag: allow to dump bpf filters 2013-04-29 13:21:30 -04:00
internal.h packet: introduce PACKET_QDISC_BYPASS socket option 2013-12-09 20:23:33 -05:00
Kconfig packet: Diag core and basic socket info dumping 2012-08-14 16:56:33 -07:00
Makefile packet: Diag core and basic socket info dumping 2012-08-14 16:56:33 -07:00