get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2196531/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2196531,
    "url": "http://patchwork.ozlabs.org/api/patches/2196531/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260214151230.18970-6-ja@ssi.bg/",
    "project": {
        "id": 26,
        "url": "http://patchwork.ozlabs.org/api/projects/26/?format=api",
        "name": "Netfilter Development",
        "link_name": "netfilter-devel",
        "list_id": "netfilter-devel.vger.kernel.org",
        "list_email": "netfilter-devel@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260214151230.18970-6-ja@ssi.bg>",
    "list_archive_url": null,
    "date": "2026-02-14T15:12:29",
    "name": "[nf-next,5/6] ipvs: use more counters to avoid service lookups",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "ee01f1e5824bcc884da2c6b4050d46ecb283190e",
    "submitter": {
        "id": 2825,
        "url": "http://patchwork.ozlabs.org/api/people/2825/?format=api",
        "name": "Julian Anastasov",
        "email": "ja@ssi.bg"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260214151230.18970-6-ja@ssi.bg/mbox/",
    "series": [
        {
            "id": 492179,
            "url": "http://patchwork.ozlabs.org/api/series/492179/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=492179",
            "date": "2026-02-14T15:12:24",
            "name": "IPVS changes, part 2 of 4 - optimizations",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/492179/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2196531/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2196531/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <netfilter-devel+bounces-10779-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "netfilter-devel@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (4096-bit key;\n unprotected) header.d=ssi.bg header.i=@ssi.bg header.a=rsa-sha256\n header.s=ssi header.b=h3UeweFm;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-10779-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (4096-bit key) header.d=ssi.bg header.i=@ssi.bg header.b=\"h3UeweFm\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=193.238.174.39",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=ssi.bg",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=ssi.bg"
        ],
        "Received": [
            "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fCt2v2yBKz1xr1\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 15 Feb 2026 02:18:15 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 8706A3011C43\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 14 Feb 2026 15:18:13 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 4BD442609EE;\n\tSat, 14 Feb 2026 15:18:13 +0000 (UTC)",
            "from mx.ssi.bg (mx.ssi.bg [193.238.174.39])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C0B523BCED;\n\tSat, 14 Feb 2026 15:18:09 +0000 (UTC)",
            "from mx.ssi.bg (localhost [127.0.0.1])\n\tby mx.ssi.bg (Potsfix) with ESMTP id 9403021D6E;\n\tSat, 14 Feb 2026 17:17:49 +0200 (EET)",
            "from box.ssi.bg (box.ssi.bg [193.238.174.46])\n\tby mx.ssi.bg (Potsfix) with ESMTPS;\n\tSat, 14 Feb 2026 17:17:47 +0200 (EET)",
            "from ja.ssi.bg (unknown [213.16.62.126])\n\tby box.ssi.bg (Potsfix) with ESMTPSA id DC1DC628B0;\n\tSat, 14 Feb 2026 17:17:46 +0200 (EET)",
            "from ja.home.ssi.bg (localhost.localdomain [127.0.0.1])\n\tby ja.ssi.bg (8.18.1/8.18.1) with ESMTP id 61EFCwtB019362;\n\tSat, 14 Feb 2026 17:12:58 +0200",
            "(from root@localhost)\n\tby ja.home.ssi.bg (8.18.1/8.18.1/Submit) id 61EFCw92019361;\n\tSat, 14 Feb 2026 17:12:58 +0200"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1771082292; cv=none;\n b=Cp9nrHYgCXrH9q067JF4qjLIKNt0cACXTbl3d8PHHIKZ6pCcqkvPB8FVSra1iiqdRWKEFUvRwWBY2JiwhPbk/4QxwqXkURkhV7fvuhiKxt1uNyzTeq70FeaC7vo1x/hIxYoCVMg9alOotN+miWvWQzdRx/DJQj5pKOMzOo3EAis=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1771082292; c=relaxed/simple;\n\tbh=7h5y+n//RGns6Mfg2U9q8re9Fg1aspkazNwQD6vQbd8=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=Cn2ivSRJyhcbtAULQY7Zl4PX0pS48uH2BS/nOVrJmxw2HyXWJpsOuiosgc8xsRA3H1efN9uWfU7aBwe7VribGSrtakcBDC2FdPJhiF1g3QWj69vr8pcRhYmQ1bBzF2OFaDXmytbsaVhgxFYayhiEyAcIaSl0NRKkeXoMal/eZLY=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=ssi.bg;\n spf=pass smtp.mailfrom=ssi.bg;\n dkim=pass (4096-bit key) header.d=ssi.bg header.i=@ssi.bg header.b=h3UeweFm;\n arc=none smtp.client-ip=193.238.174.39",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ssi.bg; h=cc:cc\n\t:content-transfer-encoding:date:from:from:in-reply-to:message-id\n\t:mime-version:references:reply-to:subject:subject:to:to; s=ssi;\n\t bh=QOBjhLuvvhkZaUD/CZ9ouvM8FHLZbqKREwj7OiocCt8=; b=h3UeweFmIgW+\n\tuyuIpjpxEuNqu0fx1F/7yxYE+epxcXz8o2SlwPQh+t+0TalHMgE0Dvh1NtQLCERX\n\t+mw2eT0DWrRTtfT2rNRxo/IQZb3wa4o2iEW/42eDBjWJG75y3RO3gLgjqm+4YeNv\n\tT0jo8JuAt6+TZ1+sMVVduBvgKKE/K+dr+AC4z4njfhIapX/LKYqkkMxDFaTD/uA9\n\t2770K2KBATtX567TMOTtdO9gbUw3lmFiZa24uwBl2xJ3SX7KD9Ru8w+G9v1UKSX/\n\tqLnCg7RcQpH0hsiNwq0q60P0EH8AahZiTOWxWimceE9Fjo8HV8JCysLD1L1SMWF8\n\tBAynfIf5qmMADutCCe3RYIqzJNTpWgeQNG/WFIFdWXzR47XHZbPImlG0PkwO2xEH\n\tvYFwnDBQWNjMkSuSU02bMZmpvvAA4NQwyR1z4oP0FWUTgKP9JCLhnjsNJV0iXB6M\n\tq9VWug1/LMrauCyPPuvaD7l7WAnOB+xnnltizWQrolWK9/GNrWq6ragh78PUwZYg\n\tnRE3JkC7GTpaMBYAM9T53vVKi0Ub7KQSu9WUo9krekIMvwJyNhy98AlKc+bn/EEC\n\tTg7SucWMovHV5aOr0hotHXAvtxNxcQVYmwfgvqZrl18A4KbeNC5PT+0vtv2BkPIu\n\tQKIAE4HtuoIz2FJsaPZi14vvIapOcc4=",
        "From": "Julian Anastasov <ja@ssi.bg>",
        "To": "Simon Horman <horms@verge.net.au>",
        "Cc": "Pablo Neira Ayuso <pablo@netfilter.org>, lvs-devel@vger.kernel.org,\n        netfilter-devel@vger.kernel.org, Dust Li <dust.li@linux.alibaba.com>,\n        Jiejian Wu <jiejian@linux.alibaba.com>",
        "Subject": "[PATCH nf-next 5/6] ipvs: use more counters to avoid service lookups",
        "Date": "Sat, 14 Feb 2026 17:12:29 +0200",
        "Message-ID": "<20260214151230.18970-6-ja@ssi.bg>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260214151230.18970-1-ja@ssi.bg>",
        "References": "<20260214151230.18970-1-ja@ssi.bg>",
        "Precedence": "bulk",
        "X-Mailing-List": "netfilter-devel@vger.kernel.org",
        "List-Id": "<netfilter-devel.vger.kernel.org>",
        "List-Subscribe": "<mailto:netfilter-devel+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:netfilter-devel+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "When new connection is created we can lookup for services multiple\ntimes to support fallback options. We already have some counters\nto skip specific lookups because it costs CPU cycles for hash\ncalculation, etc.\n\nAdd more counters for fwmark/non-fwmark services (fwm_services and\nnonfwm_services) and make all counters per address family.\n\nSigned-off-by: Julian Anastasov <ja@ssi.bg>\n---\n include/net/ip_vs.h             | 24 ++++++---\n net/netfilter/ipvs/ip_vs_core.c |  2 +-\n net/netfilter/ipvs/ip_vs_ctl.c  | 86 +++++++++++++++++++--------------\n 3 files changed, 69 insertions(+), 43 deletions(-)",
    "diff": "diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h\nindex b5a5a5efe3cc..f2291be36409 100644\n--- a/include/net/ip_vs.h\n+++ b/include/net/ip_vs.h\n@@ -271,6 +271,18 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,\n \t\t\tpr_err(msg, ##__VA_ARGS__);\t\t\t\\\n \t} while (0)\n \n+/* For arrays per family */\n+enum {\n+\tIP_VS_AF_INET,\n+\tIP_VS_AF_INET6,\n+\tIP_VS_AF_MAX\n+};\n+\n+static inline int ip_vs_af_index(int af)\n+{\n+\treturn af == AF_INET6 ? IP_VS_AF_INET6 : IP_VS_AF_INET;\n+}\n+\n /* The port number of FTP service (in network order). */\n #define FTPPORT  cpu_to_be16(21)\n #define FTPDATA  cpu_to_be16(20)\n@@ -940,17 +952,17 @@ struct netns_ipvs {\n \t/* ip_vs_ctl */\n \tstruct ip_vs_stats_rcu\t*tot_stats;      /* Statistics & est. */\n \n-\tint\t\t\tnum_services;    /* no of virtual services */\n-\tint\t\t\tnum_services6;   /* IPv6 virtual services */\n-\n \t/* Trash for destinations */\n \tstruct list_head\tdest_trash;\n \tspinlock_t\t\tdest_trash_lock;\n \tstruct timer_list\tdest_trash_timer; /* expiration timer */\n \t/* Service counters */\n-\tatomic_t\t\tftpsvc_counter;\n-\tatomic_t\t\tnullsvc_counter;\n-\tatomic_t\t\tconn_out_counter;\n+\tatomic_t\t\tnum_services[IP_VS_AF_MAX];   /* Services */\n+\tatomic_t\t\tfwm_services[IP_VS_AF_MAX];   /* Services */\n+\tatomic_t\t\tnonfwm_services[IP_VS_AF_MAX];/* Services */\n+\tatomic_t\t\tftpsvc_counter[IP_VS_AF_MAX]; /* FTPPORT */\n+\tatomic_t\t\tnullsvc_counter[IP_VS_AF_MAX];/* Zero port */\n+\tatomic_t\t\tconn_out_counter[IP_VS_AF_MAX];/* out conn */\n \n #ifdef CONFIG_SYSCTL\n \t/* delayed work for expiring no dest connections */\ndiff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c\nindex 90d56f92c0f6..869f18e0e835 100644\n--- a/net/netfilter/ipvs/ip_vs_core.c\n+++ b/net/netfilter/ipvs/ip_vs_core.c\n@@ -1400,7 +1400,7 @@ ip_vs_out_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *stat\n \t\treturn handle_response(af, skb, pd, cp, &iph, hooknum);\n \n \t/* Check for real-server-started requests */\n-\tif (atomic_read(&ipvs->conn_out_counter)) {\n+\tif (atomic_read(&ipvs->conn_out_counter[ip_vs_af_index(af)])) {\n \t\t/* Currently only for UDP:\n \t\t * connection oriented protocols typically use\n \t\t * ephemeral ports for outgoing connections, so\ndiff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c\nindex 7c0e2d9b5b98..564e09f0f90a 100644\n--- a/net/netfilter/ipvs/ip_vs_ctl.c\n+++ b/net/netfilter/ipvs/ip_vs_ctl.c\n@@ -436,35 +436,42 @@ struct ip_vs_service *\n ip_vs_service_find(struct netns_ipvs *ipvs, int af, __u32 fwmark, __u16 protocol,\n \t\t   const union nf_inet_addr *vaddr, __be16 vport)\n {\n-\tstruct ip_vs_service *svc;\n+\tstruct ip_vs_service *svc = NULL;\n+\tint af_id = ip_vs_af_index(af);\n \n \t/*\n \t *\tCheck the table hashed by fwmark first\n \t */\n-\tif (fwmark) {\n+\tif (fwmark && atomic_read(&ipvs->fwm_services[af_id])) {\n \t\tsvc = __ip_vs_svc_fwm_find(ipvs, af, fwmark);\n \t\tif (svc)\n \t\t\tgoto out;\n \t}\n \n+\tif (!atomic_read(&ipvs->nonfwm_services[af_id]))\n+\t\tgoto out;\n+\n \t/*\n \t *\tCheck the table hashed by <protocol,addr,port>\n \t *\tfor \"full\" addressed entries\n \t */\n \tsvc = __ip_vs_service_find(ipvs, af, protocol, vaddr, vport);\n+\tif (svc)\n+\t\tgoto out;\n \n-\tif (!svc && protocol == IPPROTO_TCP &&\n-\t    atomic_read(&ipvs->ftpsvc_counter) &&\n+\tif (protocol == IPPROTO_TCP &&\n+\t    atomic_read(&ipvs->ftpsvc_counter[af_id]) &&\n \t    (vport == FTPDATA || !inet_port_requires_bind_service(ipvs->net, ntohs(vport)))) {\n \t\t/*\n \t\t * Check if ftp service entry exists, the packet\n \t\t * might belong to FTP data connections.\n \t\t */\n \t\tsvc = __ip_vs_service_find(ipvs, af, protocol, vaddr, FTPPORT);\n+\t\tif (svc)\n+\t\t\tgoto out;\n \t}\n \n-\tif (svc == NULL\n-\t    && atomic_read(&ipvs->nullsvc_counter)) {\n+\tif (atomic_read(&ipvs->nullsvc_counter[af_id])) {\n \t\t/*\n \t\t * Check if the catch-all port (port zero) exists\n \t\t */\n@@ -1352,6 +1359,7 @@ ip_vs_add_service(struct netns_ipvs *ipvs, struct ip_vs_service_user_kern *u,\n {\n \tint ret = 0;\n \tstruct ip_vs_scheduler *sched = NULL;\n+\tint af_id = ip_vs_af_index(u->af);\n \tstruct ip_vs_pe *pe = NULL;\n \tstruct ip_vs_service *svc = NULL;\n \tint ret_hooks = -1;\n@@ -1396,8 +1404,7 @@ ip_vs_add_service(struct netns_ipvs *ipvs, struct ip_vs_service_user_kern *u,\n \t}\n #endif\n \n-\tif ((u->af == AF_INET && !ipvs->num_services) ||\n-\t    (u->af == AF_INET6 && !ipvs->num_services6)) {\n+\tif (!atomic_read(&ipvs->num_services[af_id])) {\n \t\tret = ip_vs_register_hooks(ipvs, u->af);\n \t\tif (ret < 0)\n \t\t\tgoto out_err;\n@@ -1444,21 +1451,21 @@ ip_vs_add_service(struct netns_ipvs *ipvs, struct ip_vs_service_user_kern *u,\n \n \t/* Update the virtual service counters */\n \tif (svc->port == FTPPORT)\n-\t\tatomic_inc(&ipvs->ftpsvc_counter);\n-\telse if (svc->port == 0)\n-\t\tatomic_inc(&ipvs->nullsvc_counter);\n+\t\tatomic_inc(&ipvs->ftpsvc_counter[af_id]);\n+\telse if (!svc->port && !svc->fwmark)\n+\t\tatomic_inc(&ipvs->nullsvc_counter[af_id]);\n \tif (pe && pe->conn_out)\n-\t\tatomic_inc(&ipvs->conn_out_counter);\n+\t\tatomic_inc(&ipvs->conn_out_counter[af_id]);\n \n \t/* Bind the ct retriever */\n \tRCU_INIT_POINTER(svc->pe, pe);\n \tpe = NULL;\n \n-\t/* Count only IPv4 services for old get/setsockopt interface */\n-\tif (svc->af == AF_INET)\n-\t\tipvs->num_services++;\n-\telse if (svc->af == AF_INET6)\n-\t\tipvs->num_services6++;\n+\tif (svc->fwmark)\n+\t\tatomic_inc(&ipvs->fwm_services[af_id]);\n+\telse\n+\t\tatomic_inc(&ipvs->nonfwm_services[af_id]);\n+\tatomic_inc(&ipvs->num_services[af_id]);\n \n \t/* Hash the service into the service table */\n \tip_vs_svc_hash(svc);\n@@ -1503,6 +1510,8 @@ ip_vs_edit_service(struct ip_vs_service *svc, struct ip_vs_service_user_kern *u)\n \tstruct ip_vs_pe *pe = NULL, *old_pe = NULL;\n \tint ret = 0;\n \tbool new_pe_conn_out, old_pe_conn_out;\n+\tstruct netns_ipvs *ipvs = svc->ipvs;\n+\tint af_id = ip_vs_af_index(svc->af);\n \n \t/*\n \t * Lookup the scheduler, by 'u->sched_name'\n@@ -1571,9 +1580,9 @@ ip_vs_edit_service(struct ip_vs_service *svc, struct ip_vs_service_user_kern *u)\n \t\tnew_pe_conn_out = (pe && pe->conn_out) ? true : false;\n \t\told_pe_conn_out = (old_pe && old_pe->conn_out) ? true : false;\n \t\tif (new_pe_conn_out && !old_pe_conn_out)\n-\t\t\tatomic_inc(&svc->ipvs->conn_out_counter);\n+\t\t\tatomic_inc(&ipvs->conn_out_counter[af_id]);\n \t\tif (old_pe_conn_out && !new_pe_conn_out)\n-\t\t\tatomic_dec(&svc->ipvs->conn_out_counter);\n+\t\t\tatomic_dec(&ipvs->conn_out_counter[af_id]);\n \t}\n \n out:\n@@ -1593,16 +1602,15 @@ static void __ip_vs_del_service(struct ip_vs_service *svc, bool cleanup)\n \tstruct ip_vs_scheduler *old_sched;\n \tstruct ip_vs_pe *old_pe;\n \tstruct netns_ipvs *ipvs = svc->ipvs;\n+\tint af_id = ip_vs_af_index(svc->af);\n \n-\tif (svc->af == AF_INET) {\n-\t\tipvs->num_services--;\n-\t\tif (!ipvs->num_services)\n-\t\t\tip_vs_unregister_hooks(ipvs, svc->af);\n-\t} else if (svc->af == AF_INET6) {\n-\t\tipvs->num_services6--;\n-\t\tif (!ipvs->num_services6)\n-\t\t\tip_vs_unregister_hooks(ipvs, svc->af);\n-\t}\n+\tatomic_dec(&ipvs->num_services[af_id]);\n+\tif (!atomic_read(&ipvs->num_services[af_id]))\n+\t\tip_vs_unregister_hooks(ipvs, svc->af);\n+\tif (svc->fwmark)\n+\t\tatomic_dec(&ipvs->fwm_services[af_id]);\n+\telse\n+\t\tatomic_dec(&ipvs->nonfwm_services[af_id]);\n \n \tip_vs_stop_estimator(svc->ipvs, &svc->stats);\n \n@@ -1614,7 +1622,7 @@ static void __ip_vs_del_service(struct ip_vs_service *svc, bool cleanup)\n \t/* Unbind persistence engine, keep svc->pe */\n \told_pe = rcu_dereference_protected(svc->pe, 1);\n \tif (old_pe && old_pe->conn_out)\n-\t\tatomic_dec(&ipvs->conn_out_counter);\n+\t\tatomic_dec(&ipvs->conn_out_counter[af_id]);\n \tip_vs_pe_put(old_pe);\n \n \t/*\n@@ -1629,9 +1637,9 @@ static void __ip_vs_del_service(struct ip_vs_service *svc, bool cleanup)\n \t *    Update the virtual service counters\n \t */\n \tif (svc->port == FTPPORT)\n-\t\tatomic_dec(&ipvs->ftpsvc_counter);\n-\telse if (svc->port == 0)\n-\t\tatomic_dec(&ipvs->nullsvc_counter);\n+\t\tatomic_dec(&ipvs->ftpsvc_counter[af_id]);\n+\telse if (!svc->port && !svc->fwmark)\n+\t\tatomic_dec(&ipvs->nullsvc_counter[af_id]);\n \n \t/*\n \t *    Free the service if nobody refers to it\n@@ -2961,7 +2969,8 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)\n \t\tstruct ip_vs_getinfo info;\n \t\tinfo.version = IP_VS_VERSION_CODE;\n \t\tinfo.size = ip_vs_conn_tab_size;\n-\t\tinfo.num_services = ipvs->num_services;\n+\t\tinfo.num_services =\n+\t\t\tatomic_read(&ipvs->num_services[IP_VS_AF_INET]);\n \t\tif (copy_to_user(user, &info, sizeof(info)) != 0)\n \t\t\tret = -EFAULT;\n \t}\n@@ -4307,9 +4316,14 @@ int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs)\n \tINIT_LIST_HEAD(&ipvs->dest_trash);\n \tspin_lock_init(&ipvs->dest_trash_lock);\n \ttimer_setup(&ipvs->dest_trash_timer, ip_vs_dest_trash_expire, 0);\n-\tatomic_set(&ipvs->ftpsvc_counter, 0);\n-\tatomic_set(&ipvs->nullsvc_counter, 0);\n-\tatomic_set(&ipvs->conn_out_counter, 0);\n+\tfor (idx = 0; idx < IP_VS_AF_MAX; idx++) {\n+\t\tatomic_set(&ipvs->num_services[idx], 0);\n+\t\tatomic_set(&ipvs->fwm_services[idx], 0);\n+\t\tatomic_set(&ipvs->nonfwm_services[idx], 0);\n+\t\tatomic_set(&ipvs->ftpsvc_counter[idx], 0);\n+\t\tatomic_set(&ipvs->nullsvc_counter[idx], 0);\n+\t\tatomic_set(&ipvs->conn_out_counter[idx], 0);\n+\t}\n \n \tINIT_DELAYED_WORK(&ipvs->est_reload_work, est_reload_work_handler);\n \n",
    "prefixes": [
        "nf-next",
        "5/6"
    ]
}