Skip to content

Improve UDP multicast receive latency

Shawn Bohrer netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyIn review
  2. v23 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- Use secondary hash for UDP unicast early demux lookup
- Double check socket match after increasing refcount in both unicast and multicast early demux lookups

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3udp: Only allow busy read/poll on connected socketsnet/ipv4/udp.c net/ipv6/udp.c+6 -40 replies
2/3udp: ipv4: Add udp early demuxinclude/net/sock.h include/net/udp.h net/ipv4/af_inet.c +1 more+187 -190 replies
3/3net: ipv4 only populate IP_PKTINFO when neededinclude/net/ip.h net/ipv4/ip_sockglue.c net/ipv4/raw.c +1 more+6 -50 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchEric Dumazet
1/3A-b
2/3
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net-next v3 0/3] Improve UDP multicast receive latency

From: Shawn Bohrer <[email protected]>

The removal of the routing cache in 3.6 had impacted the latency of our UDP multicast workload. This patch series brings down the latency to what we were seeing with 3.4.

Patch 1 "udp: Only allow busy read/poll on connected sockets" is mostly done for correctness and because it allows unifying the unicast and multicast paths when a socket is found in early demux. It can also improve latency for a connected multicast socket if busy read/poll is used.

Patches 2&3 remove the fib lookups and restore latency for our workload to the pre 3.6 levels.

Benchmark results from a netperf UDP_RR test:
v3.12-rc3-447-g40dc9ab kernel 87961.22 transactions/s
v3.12-rc3-447-g40dc9ab + series 90587.62 transactions/s

Benchmark results from a fio 1 byte UDP multicast pingpong test (Multicast one way unicast response):
v3.12-rc3-447-g40dc9ab kernel 12.97us RTT
v3.12-rc3-447-g40dc9ab + series 12.48us RTT

v2 Changes:
- Unicast UDP early demux now requires an exact socket match and only tests first socket in UDP hash chain.
- ipv4_pktinfo_prepare() now takes a const struct sock*

v3 Changes:
- Use secondary hash for UDP unicast early demux lookup
- Double check socket match after increasing refcount in both unicast and multicast early demux lookups

Shawn Bohrer (3):
udp: Only allow busy read/poll on connected sockets
udp: ipv4: Add udp early demux
net: ipv4 only populate IP_PKTINFO when needed

 include/net/ip.h       |    2 +-
 include/net/sock.h     |    2 +-
 include/net/udp.h      |    1 +
 net/ipv4/af_inet.c     |    1 +
 net/ipv4/ip_sockglue.c |    5 +-
 net/ipv4/raw.c         |    2 +-
 net/ipv4/udp.c         |  209 +++++++++++++++++++++++++++++++++++++++++++-----
 net/ipv6/udp.c         |    5 +-
 8 files changed, 199 insertions(+), 28 deletions(-)
Signature · 1 line
1.7.7.6