alistair23-linux/net/packet
Vincent Whitchurch fa788d986a packet: add sockopt to ignore outgoing packets
Currently, the only way to ignore outgoing packets on a packet socket is
via the BPF filter.  With MSG_ZEROCOPY, packets that are looped into
AF_PACKET are copied in dev_queue_xmit_nit(), and this copy happens even
if the filter run from packet_rcv() would reject them.  So the presence
of a packet socket on the interface takes away the benefits of
MSG_ZEROCOPY, even if the packet socket is not interested in outgoing
packets.  (Even when MSG_ZEROCOPY is not used, the skb is unnecessarily
cloned, but the cost for that is much lower.)

Add a socket option to allow AF_PACKET sockets to ignore outgoing
packets to solve this.  Note that the *BSDs already have something
similar: BIOCSSEESENT/BIOCSDIRECTION and BIOCSDIRFILT.

The first intended user is lldpd.

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-09-05 22:09:37 -07:00
..
af_packet.c packet: add sockopt to ignore outgoing packets 2018-09-05 22:09:37 -07:00
diag.c packet: pdiag_put_ring() should return TX_RING info for TPACKET_V3 2017-01-10 21:02:42 -05:00
internal.h Revert "packet: switch kvzalloc to allocate memory" 2018-08-31 23:00:28 -07: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