]> git.ipfire.org Git - thirdparty/linux.git/commit
rxrpc: Use the UDP encap_rcv hook
authorDavid Howells <dhowells@redhat.com>
Thu, 4 Oct 2018 10:10:51 +0000 (11:10 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 8 Oct 2018 14:45:18 +0000 (15:45 +0100)
commit5271953cad31b97dea80f848c16e96ad66401199
treed7ebc9c86a13557a6802fab23b7b1a25a708d6b5
parent2cfa2271604bb26e75b828d38f357ed084464795
rxrpc: Use the UDP encap_rcv hook

Use the UDP encap_rcv hook to cut the bit out of the rxrpc packet reception
in which a packet is placed onto the UDP receive queue and then immediately
removed again by rxrpc.  Going via the queue in this manner seems like it
should be unnecessary.

This does, however, require the invention of a value to place in encap_type
as that's one of the conditions to switch packets out to the encap_rcv
hook.  Possibly the value doesn't actually matter for anything other than
sockopts on the UDP socket, which aren't accessible outside of rxrpc
anyway.

This seems to cut a bit of time out of the time elapsed between each
sk_buff being timestamped and turning up in rxrpc (the final number in the
following trace excerpts).  I measured this by making the rxrpc_rx_packet
trace point print the time elapsed between the skb being timestamped and
the current time (in ns), e.g.:

... 424.278721: rxrpc_rx_packet: ...  ACK 25026

So doing a 512MiB DIO read from my test server, with an unmodified kernel:

N       min     max     sum mean    stddev
27605   2626    7581    7.83992e+07     2840.04 181.029

and with the patch applied:

N       min     max     sum mean    stddev
27547   1895    12165   6.77461e+07     2459.29 255.02

Signed-off-by: David Howells <dhowells@redhat.com>
include/uapi/linux/udp.h
net/rxrpc/ar-internal.h
net/rxrpc/input.c
net/rxrpc/local_object.c