netfilter: nf_conncount: rework conncount API to
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | netfilter: nf_conncount: only track connection if it is not confirmedinclude/ net/ net/ +2 more | +81 | 3 replies | |
| 2/3 | netfilter: nf_conncount: make nf_conncount_gc_list() to disable BHnet/ net/ | +18 | 0 replies | |
| 3/3 | netfilter: nft_connlimit: update connection list if add was skippednet/ | +8 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3 nf-next] netfilter: nf_conncount: rework conncount API to
This series is fixing two different problems. The first issue is related to duplicated entries when used for non-confirmed connections in nft_connlimit and xt_connlimit. Now, nf_conncount_add() checks whether the connection is confirmed or not. If the connection is confirmed, skip the add.
In order to do that, the nf_conncount API is now receiving struct nf_conn as argument instead of tuple and zone. In addition, nf_conncount_count() also needs to receive the net because it calls nf_conncount_gc_list() inside it if ct is NULL.
The second issue this series is fixing is related to nft_connlimit/xt_connlimit not updating the list of connection for confirmed connections breaking softlimiting use-cases like limiting the bandwidth when too many connections are open.
This has been tested on datapath using connlimit in nftables and iptables. I have stressed the system up to 2000 connections.
CC'ing openvswitch maintainers as this change on the API required me to touch their code. I am not very familiar with the internals of openvswitch but I believe this should be fine for them. If you could provide some testing from openvswitch side it would be really helpful.
Fernando Fernandez Mancera (3):
netfilter: nf_conncount: only track connection if it is not confirmed
netfilter: nf_conncount: make nf_conncount_gc_list() to disable BH
netfilter: nft_connlimit: update connection list if add was skipped
include/net/netfilter/nf_conntrack_count.h | 10 +-- net/netfilter/nf_conncount.c | 94 +++++++++++++--------- net/netfilter/nft_connlimit.c | 49 ++++++----- net/netfilter/xt_connlimit.c | 28 ++++--- net/openvswitch/conntrack.c | 14 ++-- 5 files changed, 106 insertions(+), 89 deletions(-)
Signature · 1 line
2.51.0