Skip to content

IPVS changes, part 2 of 4 - optimizations

Julian Anastasov lvs-devel netfilter-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6ipvs: make ip_vs_svc_table and ip_vs_svc_fwm_table per netnsinclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_ctl.c net/netfilter/ipvs/ip_vs_est.c+94 -1040 replies
2/6ipvs: some service readers can use RCUnet/netfilter/ipvs/ip_vs_ctl.c+23 -240 replies
3/6ipvs: use single svc tableinclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_ctl.c+22 -1320 replies
4/6ipvs: do not keep dest_dst after dest is removednet/netfilter/ipvs/ip_vs_ctl.c net/netfilter/ipvs/ip_vs_xmit.c+16 -160 replies
5/6ipvs: use more counters to avoid service lookupsinclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_core.c net/netfilter/ipvs/ip_vs_ctl.c+69 -430 replies
6/6ipvs: no_cport and dropentry counters can be per-netinclude/net/ip_vs.h net/netfilter/ipvs/ip_vs_conn.c+41 -250 replies

Reviews trailers per patch

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

PatchDust Li
1/6
2/6R-b
3/6
4/6
5/6
6/6

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

Read the v1 thread

Cover letter [PATCH nf-next 0/6] IPVS changes, part 2 of 4 - optimizations

Hello,

This patchset is part 2 of changes that accumulated in
recent time. It is for nf-next and should be applied when the patches from part 1 are already applied. It contains optimizations and per-net changes.

All patches here come from the work
"ipvs: per-net tables and optimizations" last posted on 19 Oct 2025 as v6, with the following changes:

Patch 1 comes from v6/patch 2 without changes

Patch 2 comes from v6/patch 3 with cosmetic change:
- we can not use lockdep_is_held() condition because hlist_bl does not support such debugging yet, readers can be only under RCU lock. That is the reason for the rcu_read_lock() in the updating code in ip_vs_genl_set_cmd().

Patch 3 comes from v6/patch 4 without changes

Patch 4 comes from v6/patch 5 but some of its content was moved
also to part1/patch 2

Patch 5 comes from v6/patch 6 without changes

Patch 6 comes from v6/patch 11 with small changes because
it was moved forward before other patches from part 3 and 4

As result, the following patches will:

* Convert the global __ip_vs_mutex to per-net service_mutex and switch the service tables to be per-net, cowork by Jiejian Wu and Dust Li

* Convert some code that walks the service lists to use RCU instead of the service_mutex

* We used two tables for services (non-fwmark and fwmark), merge them into single svc_table

* The list for unavailable destinations (dest_trash) holds dsts and thus dev references causing extra work for the ip_vs_dst_event() dev notifier handler. Change this by dropping the reference when dest is removed and saved into dest_trash. The dest_trash will need more changes to make it light for lookups. TODO.

* On new connection we can do multiple lookups for services by trying different fallback options. Add more counters for service types, so that we can avoid unneeded lookups for services.

* The no_cport and dropentry counters can be per-net and also we can avoid extra conn lookups

Jiejian Wu (1):
ipvs: make ip_vs_svc_table and ip_vs_svc_fwm_table per netns

Julian Anastasov (5):
ipvs: some service readers can use RCU
ipvs: use single svc table
ipvs: do not keep dest_dst after dest is removed
ipvs: use more counters to avoid service lookups
ipvs: no_cport and dropentry counters can be per-net

 include/net/ip_vs.h             |  39 +++-
 net/netfilter/ipvs/ip_vs_conn.c |  64 +++---
 net/netfilter/ipvs/ip_vs_core.c |   2 +-
 net/netfilter/ipvs/ip_vs_ctl.c  | 368 +++++++++++---------------------
 net/netfilter/ipvs/ip_vs_est.c  |  18 +-
 net/netfilter/ipvs/ip_vs_xmit.c |  12 +-
 6 files changed, 212 insertions(+), 291 deletions(-)
Signature · 1 line
2.53.0