Skip to content

net: group together hot data

Eric Dumazet netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest18 patches 0 repliesApplied 18/18
  2. v118 patches 4 repliesSuperseded

Patches in v2 All 18 applied

#Subject and filesSizeRepliesApplied
1/18net: introduce struct net_hotdatainclude/linux/netdevice.h include/net/gro.h include/net/hotdata.h +5 more+37 -160 repliesApplied
2/18net: move netdev_budget and netdev_budget to net_hotdatainclude/net/hotdata.h net/core/dev.c net/core/dev.h +2 more+12 -90 repliesApplied
3/18net: move netdev_tstamp_prequeue into net_hotdatainclude/net/hotdata.h net/core/dev.c net/core/dev.h +2 more+9 -70 repliesApplied
4/18net: move ptype_all into net_hotdatainclude/linux/netdevice.h include/net/hotdata.h net/core/dev.c +2 more+13 -130 repliesApplied
5/18net: move netdev_max_backlog to net_hotdatainclude/linux/netdevice.h include/net/hotdata.h net/core/dev.c +5 more+14 -100 repliesApplied
6/18net: move ip_packet_offload and ipv6_packet_offload to net_hotdatainclude/net/hotdata.h net/ipv4/af_inet.c net/ipv6/ip6_offload.c+23 -180 repliesApplied
7/18net: move tcpv4_offload and tcpv6_offload to net_hotdatainclude/net/hotdata.h net/ipv4/tcp_offload.c net/ipv6/tcpv6_offload.c+19 -170 repliesApplied
8/18net: move dev_tx_weight to net_hotdatainclude/linux/netdevice.h include/net/hotdata.h net/core/dev.c +3 more+5 -40 repliesApplied
9/18net: move dev_rx_weight to net_hotdatainclude/linux/netdevice.h include/net/hotdata.h net/core/dev.c +2 more+4 -50 repliesApplied
10/18net: move skbuff_cache(s) to net_hotdatainclude/linux/skbuff.h include/net/hotdata.h kernel/bpf/cpumap.c +3 more+32 -290 repliesApplied
11/18udp: move udpv4_offload and udpv6_offload to net_hotdatainclude/net/hotdata.h net/ipv4/udp_offload.c net/ipv6/udp_offload.c+20 -200 repliesApplied
12/18ipv6: move tcpv6_protocol and udpv6_protocol to net_hotdatainclude/net/hotdata.h net/ipv6/tcp_ipv6.c net/ipv6/udp.c+21 -160 repliesApplied
13/18inet: move tcp_protocol and udp_protocol to net_hotdatainclude/net/hotdata.h net/ipv4/af_inet.c+17 -150 repliesApplied
14/18inet: move inet_ehash_secret and udp_ehash_secret into net_hotdatainclude/net/hotdata.h include/net/protocol.h net/ipv4/inet_hashtables.c +1 more+5 -40 repliesApplied
15/18ipv6: move inet6_ehash_secret and udp6_ehash_secret into net_hotdatainclude/net/hotdata.h include/net/protocol.h net/ipv6/inet6_hashtables.c +1 more+4 -20 repliesApplied
16/18ipv6: move tcp_ipv6_hash_secret and udp_ipv6_hash_secret to net_hotdatainclude/net/hotdata.h include/net/protocol.h net/ipv6/inet6_hashtables.c +1 more+5 -60 repliesApplied
17/18net: introduce include/net/rps.hdrivers/net/ethernet/intel/ice/ice_arfs.c drivers/net/ethernet/mellanox/mlx4/en_netdev.c drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +13 more+140 -1170 repliesApplied
18/18net: move rps_sock_flow_table to net_hotdatainclude/net/hotdata.h include/net/rps.h net/core/dev.c +1 more+16 -170 repliesApplied

Reviews trailers per patch

All 18 patches have a Reviewed-by or Acked-by.

PatchSoheil Hassas YeganehDavid Ahern
1/18A-b R-b
2/18A-b R-b
3/18A-b R-b
4/18A-b R-b
5/18A-b R-b
6/18A-b R-b
7/18A-b R-b
8/18A-b R-b
9/18A-b R-b
10/18A-b R-b
11/18A-b R-b
12/18A-b R-b
13/18A-b R-b
14/18A-b R-b
15/18A-b R-b
16/18A-b R-b
17/18A-b R-b
18/18A-b R-b

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

Read the v2 thread

Cover letter [PATCH v2 net-next 00/18] net: group together hot data

While our recent structure reorganizations were focused on increasing max throughput, there is still an area where improvements are much needed.

In many cases, a cpu handles one packet at a time, instead of a nice batch.

Hardware interrupt.
-> Software interrupt.
-> Network/Protocol stacks.

If the cpu was idle or busy in other layers, it has to pull many cache lines.

This series adds a new net_hotdata structure, where some critical (and read-mostly) data used in
rx and tx path is packed in a small number of cache lines.

Synthetic benchmarks will not see much difference, but latency of single packet should improve.

net_hodata current size on 64bit is 416 bytes, but might grow in the future.

Also move RPS definitions to a new include file.

v2: - Added tags from Soheil and David (Thanks!)
- took care of CONFIG_IPV6=n (kernel test robot <[email protected]>)

Eric Dumazet (18):
net: introduce struct net_hotdata
net: move netdev_budget and netdev_budget to net_hotdata
net: move netdev_tstamp_prequeue into net_hotdata
net: move ptype_all into net_hotdata
net: move netdev_max_backlog to net_hotdata
net: move ip_packet_offload and ipv6_packet_offload to net_hotdata
net: move tcpv4_offload and tcpv6_offload to net_hotdata
net: move dev_tx_weight to net_hotdata
net: move dev_rx_weight to net_hotdata
net: move skbuff_cache(s) to net_hotdata
udp: move udpv4_offload and udpv6_offload to net_hotdata
ipv6: move tcpv6_protocol and udpv6_protocol to net_hotdata
inet: move tcp_protocol and udp_protocol to net_hotdata
inet: move inet_ehash_secret and udp_ehash_secret into net_hotdata
ipv6: move inet6_ehash_secret and udp6_ehash_secret into net_hotdata
ipv6: move tcp_ipv6_hash_secret and udp_ipv6_hash_secret to
net_hotdata
net: introduce include/net/rps.h
net: move rps_sock_flow_table to net_hotdata

 drivers/net/ethernet/intel/ice/ice_arfs.c     |   1 +
 .../net/ethernet/mellanox/mlx4/en_netdev.c    |   1 +
 .../net/ethernet/mellanox/mlx5/core/en_arfs.c |   1 +
 drivers/net/ethernet/sfc/rx_common.c          |   1 +
 drivers/net/ethernet/sfc/siena/rx_common.c    |   1 +
 drivers/net/tun.c                             |   1 +
 include/linux/netdevice.h                     |  88 ------------
 include/linux/skbuff.h                        |   1 -
 include/net/gro.h                             |   5 +-
 include/net/hotdata.h                         |  52 ++++++++
 include/net/protocol.h                        |   3 +
 include/net/rps.h                             | 125 ++++++++++++++++++
 include/net/sock.h                            |  35 -----
 kernel/bpf/cpumap.c                           |   4 +-
 net/bpf/test_run.c                            |   4 +-
 net/core/Makefile                             |   1 +
 net/core/dev.c                                |  58 +++-----
 net/core/dev.h                                |   3 -
 net/core/gro.c                                |  15 +--
 net/core/gro_cells.c                          |   3 +-
 net/core/gso.c                                |   4 +-
 net/core/hotdata.c                            |  22 +++
 net/core/net-procfs.c                         |   7 +-
 net/core/net-sysfs.c                          |   1 +
 net/core/skbuff.c                             |  44 +++---
 net/core/sysctl_net_core.c                    |  25 ++--
 net/core/xdp.c                                |   5 +-
 net/ipv4/af_inet.c                            |  49 +++----
 net/ipv4/inet_hashtables.c                    |   3 +-
 net/ipv4/tcp.c                                |   1 +
 net/ipv4/tcp_offload.c                        |  17 ++-
 net/ipv4/udp.c                                |   2 -
 net/ipv4/udp_offload.c                        |  17 ++-
 net/ipv6/af_inet6.c                           |   1 +
 net/ipv6/inet6_hashtables.c                   |   8 +-
 net/ipv6/ip6_offload.c                        |  18 +--
 net/ipv6/tcp_ipv6.c                           |  17 +--
 net/ipv6/tcpv6_offload.c                      |  16 +--
 net/ipv6/udp.c                                |  19 ++-
 net/ipv6/udp_offload.c                        |  21 ++-
 net/sched/sch_generic.c                       |   3 +-
 net/sctp/socket.c                             |   1 +
 net/xfrm/espintcp.c                           |   4 +-
 net/xfrm/xfrm_input.c                         |   3 +-
 44 files changed, 391 insertions(+), 320 deletions(-)
 create mode 100644 include/net/hotdata.h
 create mode 100644 include/net/rps.h
 create mode 100644 net/core/hotdata.c
Signature · 1 line
2.44.0.278.ge034bb2e1d-goog