Skip to content

inet: frags: bring rhashtables to IP defrag

Eric Dumazet netdev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest19 patches 13 repliesIn review
  2. v312 patches 2 repliesSuperseded
  3. v212 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches5 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19ipv6: frag: remove unused fieldinclude/net/ipv6.h+0 -10 replies
2/19inet: frags: change inet_frags_init_net() return valueinclude/net/inet_frag.h net/ieee802154/6lowpan/reassembly.c net/ipv4/ip_fragment.c +2 more+37 -120 replies
3/19inet: frags: add a pointer to struct netns_fragsinclude/net/inet_frag.h include/net/ipv6.h net/ieee802154/6lowpan/reassembly.c +4 more+48 -410 replies
4/19inet: frags: refactor ipv6_frag_init()net/ipv6/reassembly.c+15 -120 replies
5/19inet: frags: refactor lowpan_net_frag_init()net/ieee802154/6lowpan/reassembly.c+11 -90 replies
6/19inet: frags: refactor ipfrag_init()net/ipv4/ip_fragment.c+2 -20 replies
7/19rhashtable: add schedule pointslib/rhashtable.c+2 -00 replies
8/19inet: frags: use rhashtables for reassembly unitsDocumentation/networking/ip-sysctl.txt include/net/inet_frag.h include/net/ipv6.h +6 more+271 -5791 reply
9/19inet: frags: remove some helpersinclude/net/inet_frag.h include/net/ip.h include/net/ipv6.h +3 more+6 -230 replies
10/19inet: frags: get rif of inet_frag_evicting()include/net/inet_frag.h net/ipv4/ip_fragment.c net/ipv6/reassembly.c+30 -400 replies
11/19inet: frags: remove inet_frag_maybe_warn_overflow()include/net/inet_frag.h net/ieee802154/6lowpan/reassembly.c net/ipv4/inet_fragment.c +3 more+8 -250 replies
12/19inet: frags: break the 2GB limit for frags storageDocumentation/networking/ip-sysctl.txt include/net/inet_frag.h net/ieee802154/6lowpan/reassembly.c +5 more+32 -320 replies
13/19inet: frags: do not clone skb in ip_expire()net/ipv4/ip_fragment.c+6 -100 replies
14/19ipv6: frags: rewrite ip6_expire_frag_queue()net/ipv6/reassembly.c+16 -80 replies
15/19rhashtable: reorganize struct rhashtable layoutinclude/linux/rhashtable.h+4 -40 replies
16/19inet: frags: reorganize struct netns_fragsinclude/net/inet_frag.h+5 -40 replies
17/19inet: frags: get rid of ipfrag_skb_cb/FRAG_CBinclude/linux/skbuff.h net/ipv4/ip_fragment.c+15 -210 replies
18/19ipv6: frags: get rid of ip6frag_skb_cb/FRAG6_CBnet/ipv6/reassembly.c+12 -180 replies
19/19inet: frags: get rid of nf_ct_frag6_skb_cb/NFCT_FRAG6_CBnet/ipv6/netfilter/nf_conntrack_reasm.c+11 -180 replies

Reviews trailers per patch

1 of 19 patches has a Reviewed-by or Acked-by.

PatchHerbert Xu
1/19
2/19
3/19
4/19
5/19
6/19
7/19A-b
8/19
9/19
10/19
11/19
12/19
13/19
14/19
15/19
16/19
17/19
18/19
19/19

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

Read the v4 thread

Cover letter [PATCH v4 net-next 00/19] inet: frags: bring rhashtables to IP defrag

IP defrag processing is one of the remaining problematic layer in linux.

It uses static hash tables of 1024 buckets, and up to 128 items per bucket.

A work queue is supposed to garbage collect items when host is under memory pressure, and doing a hash rebuild, changing seed used in hash computations.

This work queue blocks softirqs for up to 25 ms when doing a hash rebuild, occurring every 5 seconds if host is under fire.

Then there is the problem of sharing this hash table for all netns.

It is time to switch to rhashtables, and allocate one of them per netns to speedup netns dismantle, since this is a critical metric these days.

Lookup is now using RCU, and 64bit hosts can now provision whatever amount of memory needed to handle the expected workloads.

v2: Addressed Herbert and Kirill feedbacks
(Use rhashtable_free_and_destroy(), and split the big patch into small units)

v3: Removed the extra add_frag_mem_limit(...) from inet_frag_create()
Removed the refcount_inc_not_zero() call from inet_frags_free_cb(), as we can exploit del_timer() return value.

v4: kbuild robot feedback about one missing static (squashed)
Additional patches :
inet: frags: do not clone skb in ip_expire()
ipv6: frags: rewrite ip6_expire_frag_queue()
rhashtable: reorganize struct rhashtable layout
inet: frags: reorganize struct netns_frags
inet: frags: get rid of ipfrag_skb_cb/FRAG_CB
ipv6: frags: get rid of ip6frag_skb_cb/FRAG6_CB
inet: frags: get rid of nf_ct_frag6_skb_cb/NFCT_FRAG6_CB

Eric Dumazet (19):
ipv6: frag: remove unused field
inet: frags: change inet_frags_init_net() return value
inet: frags: add a pointer to struct netns_frags
inet: frags: refactor ipv6_frag_init()
inet: frags: refactor lowpan_net_frag_init()
inet: frags: refactor ipfrag_init()
rhashtable: add schedule points
inet: frags: use rhashtables for reassembly units
inet: frags: remove some helpers
inet: frags: get rif of inet_frag_evicting()
inet: frags: remove inet_frag_maybe_warn_overflow()
inet: frags: break the 2GB limit for frags storage
inet: frags: do not clone skb in ip_expire()
ipv6: frags: rewrite ip6_expire_frag_queue()
rhashtable: reorganize struct rhashtable layout
inet: frags: reorganize struct netns_frags
inet: frags: get rid of ipfrag_skb_cb/FRAG_CB
ipv6: frags: get rid of ip6frag_skb_cb/FRAG6_CB
inet: frags: get rid of nf_ct_frag6_skb_cb/NFCT_FRAG6_CB

 Documentation/networking/ip-sysctl.txt  |  11 +-
 include/linux/rhashtable.h              |   8 +-
 include/linux/skbuff.h                  |   1 +
 include/net/inet_frag.h                 | 126 ++++-----
 include/net/ip.h                        |   1 -
 include/net/ipv6.h                      |  27 +-
 lib/rhashtable.c                        |   2 +
 net/ieee802154/6lowpan/6lowpan_i.h      |  26 +-
 net/ieee802154/6lowpan/reassembly.c     | 150 +++++-----
 net/ipv4/inet_fragment.c                | 362 +++++-------------------
 net/ipv4/ip_fragment.c                  | 247 ++++++++--------
 net/ipv4/proc.c                         |   6 +-
 net/ipv6/netfilter/nf_conntrack_reasm.c | 119 +++-----
 net/ipv6/proc.c                         |   5 +-
 net/ipv6/reassembly.c                   | 235 ++++++++-------
 15 files changed, 499 insertions(+), 827 deletions(-)
Signature · 1 line
2.17.0.rc1.321.gba9d0f2565-goog