net: optimize ICMP-reply code path
Get series with b4
b4 am 20170109150246.30215.63371.stgit@firesoulVersions newest first
- v1 Latest3 patches 29 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | Revert "icmp: avoid allocating large struct on stack"net/ | +17 | 20 replies | |
| 2/3 | net: reduce cycles spend on ICMP replies that gets rate limitednet/ net/ | +82 | 5 replies | |
| 3/3 | net: for rate-limited ICMP replies save one atomic operationnet/ net/ | +37 | 1 reply |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Eric Dumazet |
|---|---|
| 1/3 | A-b |
| 2/3 | A-b |
| 3/3 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [net-next PATCH 0/3] net: optimize ICMP-reply code path
This patchset is optimizing the ICMP-reply code path, for ICMP packets that gets rate limited. A remote party can easily trigger this code path by sending packets to port number with no listening service.
Generally the patchset moves the sysctl_icmp_msgs_per_sec ratelimit checking to earlier in the code path and removes an allocation.
Use-case: The specific case I experienced this being a bottleneck is, sending UDP packets to a port with no listener, which obviously result in kernel replying with ICMP Destination Unreachable (type:3), Port Unreachable (code:3), which cause the bottleneck.
After Eric and Paolo optimized the UDP socket code, the kernels PPS
processing capabilities is lower for no-listen ports, than normal UDP sockets. This is bad for capacity planning when restarting a service.
UDP no-listen benchmark 8xCPUs using pktgen_sample04_many_flows.sh:
Baseline: 6.6 Mpps
Patch: 14.7 Mpps
Driver mlx5 at 50Gbit/s.
---
Jesper Dangaard Brouer (3):
Revert "icmp: avoid allocating large struct on stack"
net: reduce cycles spend on ICMP replies that gets rate limited
net: for rate-limited ICMP replies save one atomic operation
net/ipv4/icmp.c | 125 +++++++++++++++++++++++++++++++++---------------------- net/ipv6/icmp.c | 68 +++++++++++++++++++++--------- 2 files changed, 123 insertions(+), 70 deletions(-)