linux/net
Neil Horman 3b885787ea net: Generalize socket rx gap / receive queue overflow cmsg
Create a new socket level option to report number of queue overflows

Recently I augmented the AF_PACKET protocol to report the number of frames lost
on the socket receive queue between any two enqueued frames.  This value was
exported via a SOL_PACKET level cmsg.  AFter I completed that work it was
requested that this feature be generalized so that any datagram oriented socket
could make use of this option.  As such I've created this patch, It creates a
new SOL_SOCKET level option called SO_RXQ_OVFL, which when enabled exports a
SOL_SOCKET level cmsg that reports the nubmer of times the sk_receive_queue
overflowed between any two given frames.  It also augments the AF_PACKET
protocol to take advantage of this new feature (as it previously did not touch
sk->sk_drops, which this patch uses to record the overflow count).  Tested
successfully by me.

Notes:

1) Unlike my previous patch, this patch simply records the sk_drops value, which
is not a number of drops between packets, but rather a total number of drops.
Deltas must be computed in user space.

2) While this patch currently works with datagram oriented protocols, it will
also be accepted by non-datagram oriented protocols. I'm not sure if thats
agreeable to everyone, but my argument in favor of doing so is that, for those
protocols which aren't applicable to this option, sk_drops will always be zero,
and reporting no drops on a receive queue that isn't used for those
non-participating protocols seems reasonable to me.  This also saves us having
to code in a per-protocol opt in mechanism.

3) This applies cleanly to net-next assuming that commit
977750076d (my af packet cmsg patch) is reverted

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-12 13:26:31 -07:00
..
9p virtio: add virtio IDs file 2009-09-23 22:26:32 +09:30
802 net: remove COMPAT_NET_DEV_OPS 2009-05-25 01:53:53 -07:00
8021q net: fix vlan_get_size to include vlan_flags size 2009-09-26 20:16:07 -07:00
appletalk net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
atm net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
ax25 net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
bluetooth net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
bridge bridge: Allow enable/disable UFO on bridge device via ethtool 2009-10-07 22:00:24 -07:00
can net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
core net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
dcb net: fix double skb free in dcbnl 2009-09-26 20:16:15 -07:00
dccp IPv6: use ipv6_addr_set_v4mapped() 2009-10-07 13:58:25 -07:00
decnet net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
dsa netdev: convert pseudo-devices to netdev_tx_t 2009-09-01 01:13:07 -07:00
econet econet: Fix redeclaration of symbol len 2009-10-07 14:43:04 -07:00
ethernet net: remove COMPAT_NET_DEV_OPS 2009-05-25 01:53:53 -07:00
ieee802154 net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
ipv4 net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
ipv6 net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
ipx net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
irda net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
iucv net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
key net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
lapb net: remove NET_RX_BAD and NET_RX_CN* defines 2009-07-05 19:15:35 -07:00
llc net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
mac80211 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-10-11 23:15:47 -07:00
netfilter net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
netlabel Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-07-30 19:22:43 -07:00
netlink net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
netrom net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
packet net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
phonet net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
rds net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
rfkill headers: remove sched.h from poll.h 2009-10-04 15:05:10 -07:00
rose net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
rxrpc net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
sched Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-10-11 23:15:47 -07:00
sctp net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
sunrpc IPv6: use ipv6_addr_set_v4mapped() 2009-10-07 13:58:25 -07:00
tipc net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
unix net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
wanrouter headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
wimax wimax: fix warning caused by not checking retval of rfkill_set_hw_state() 2009-06-11 11:12:48 -07:00
wireless Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-10-11 23:15:47 -07:00
x25 net: mark net_proto_ops as const 2009-10-07 01:10:46 -07:00
xfrm net: file_operations should be const 2009-09-02 01:03:53 -07:00
Kconfig net/compat/wext: send different messages to compat tasks 2009-07-15 08:53:39 -07:00
Makefile net: remove redundant sched/ in net/Makefile 2009-07-12 20:11:14 -07:00
TUNABLE
compat.c net: Make setsockopt() optlen be unsigned. 2009-09-30 16:12:20 -07:00
nonet.c
socket.c net: Generalize socket rx gap / receive queue overflow cmsg 2009-10-12 13:26:31 -07:00
sysctl_net.c net: sysctl_net - use net_eq to compare nets 2009-03-16 16:23:30 +01:00