Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2219830/?format=api
{ "id": 2219830, "url": "http://patchwork.ozlabs.org/api/patches/2219830/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260404153439.30077-3-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": "<20260404153439.30077-3-ja@ssi.bg>", "list_archive_url": null, "date": "2026-04-04T15:34:38", "name": "[PATCHv2,nf-next,2/3] ipvs: add ip_vs_status info", "commit_ref": null, "pull_url": null, "state": "under-review", "archived": false, "hash": "370a866eb5dd475265c60985b21e35d410bf16b4", "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/20260404153439.30077-3-ja@ssi.bg/mbox/", "series": [ { "id": 498737, "url": "http://patchwork.ozlabs.org/api/series/498737/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=498737", "date": "2026-04-04T15:34:36", "name": "IPVS changes, part 4 of 4 - extras", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498737/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2219830/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2219830/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <netfilter-devel+bounces-11636-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=szfrh2UC;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11636-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=\"szfrh2UC\"", "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 sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fp08k4X0fz1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 02:37:42 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 41FB73004F35\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 4 Apr 2026 15:37:40 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 53E723191BD;\n\tSat, 4 Apr 2026 15:37:39 +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 861582765D7;\n\tSat, 4 Apr 2026 15:37:36 +0000 (UTC)", "from mx.ssi.bg (localhost [127.0.0.1])\n\tby mx.ssi.bg (Potsfix) with ESMTP id E787A21C5F;\n\tSat, 04 Apr 2026 18:37:21 +0300 (EEST)", "from box.ssi.bg (box.ssi.bg [193.238.174.46])\n\tby mx.ssi.bg (Potsfix) with ESMTPS;\n\tSat, 04 Apr 2026 18:37:20 +0300 (EEST)", "from ja.ssi.bg (unknown [213.16.62.126])\n\tby box.ssi.bg (Potsfix) with ESMTPSA id 997BA60F8A;\n\tSat, 4 Apr 2026 18:37:20 +0300 (EEST)", "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 634FZDGU030107;\n\tSat, 4 Apr 2026 18:35:13 +0300", "(from root@localhost)\n\tby ja.home.ssi.bg (8.18.1/8.18.1/Submit) id 634FZDVO030106;\n\tSat, 4 Apr 2026 18:35:13 +0300" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775317058; cv=none;\n b=OqxmT1HNaZYF9RI6XT7X3uycKVC5nKHCWIr6WuVb12klMrVlaxxL8a50Te6Pi5RnpDuHOOVnKJzi0a8biyKa7LsxqrCdxzAErG/KJ0kF/t/1Yy4b1kJwZ8XLO8PGlUJgL5tOpOyRa/XdIyhctXIh62ZoQJNLzkaN50B7Wk3lUdU=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775317058; c=relaxed/simple;\n\tbh=y3Ru4CWtXCvrUn02IqehNzekb527kTsA+m3qWY19bV0=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=gRwoZTt+64AXq6QT7D/0EfuC3a3pMhrfPg4o4mlNI7Y2ASSGuLfwGwwFa6iCdc72KJ6ho8331StgyEEoIibWun+anQUFfIfjTtW43AGrXxrb/YNxCrMUHTRPr7ymYDQd5YwqQx2xkR8FwOOMZBRV7aR59Ow+SCG2joAvTBUhCQI=", "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=szfrh2UC;\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=JBOfbLh6Kd7sYujwAwhUlqY4NGBayISrUkseZw5brU8=; b=szfrh2UCFLm5\n\tpLZKUCurtAkqOk9ts+rsW9xAROF3FqjeSs7Tq8gsAiYx7dkFWPwJkA+7FvdJ32CY\n\tgX2r4jydWIkfVKRdrCZXLGeRmTc6X30PJuGuVxfSgflwwmoqTvWQUJm8vVFefoyj\n\tU15dhk4vwHYl5UO02IUcAVUFjHdKqQ/Rlm9+se42QuAwoKg79u74MLkef1F6dJkt\n\tluLnvFqTG3BRoapRgZeD60bgGde23LU7wN5XMVMw8tZ5rxXreEIbZu6+OWwO2RO8\n\txaqKv36DIeDlUhp8zNkSEWZmT3IrJ4cconRRaxtlNqaX8jLSWEDA3iazfAQzlsGA\n\t+4Q2DVBYFc3cM8cquFky5PuvP/zIVGKSEBBkKlguoBbbGoPf+bFhsXbNvuohk3Qi\n\tzPZsmFrfJFGPNLTlYWZpT1BOkAdzRy7xlDX6Ys2nmAuFnaTIsbeVQ8zB7kLtWG2A\n\t5R6Rxxe7LU3L+Ei8c9enZXu9kaybl1FZnDSAYy2pPIIuEaDvZyvTVfP6vtcc4FUP\n\txgEKFslGGwQ+T4w/AtPL9KweWHAJJqNOwbrBl6b6DVHgEnuoZQmH1hEfmNRWmmyF\n\tgxny5PqtvKiCEwAh1FLC5HZiudmfOCUfEckp5f1lLSP+TPcCN/lVYHxNAurOxc0G\n\tzMTepk37dlQmOQGDFc9mNYxY/n7dNO0=", "From": "Julian Anastasov <ja@ssi.bg>", "To": "Simon Horman <horms@verge.net.au>", "Cc": "Pablo Neira Ayuso <pablo@netfilter.org>, Florian Westphal <fw@strlen.de>,\n lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org,\n Dust Li <dust.li@linux.alibaba.com>,\n Jiejian Wu <jiejian@linux.alibaba.com>", "Subject": "[PATCHv2 nf-next 2/3] ipvs: add ip_vs_status info", "Date": "Sat, 4 Apr 2026 18:34:38 +0300", "Message-ID": "<20260404153439.30077-3-ja@ssi.bg>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260404153439.30077-1-ja@ssi.bg>", "References": "<20260404153439.30077-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": "Add /proc/net/ip_vs_status to show current state of IPVS.\n\nThe motivation for this new /proc interface is to provide the output\nfor the users to help them decide when to tune the load factor for\nhash tables, which is possible with the new sysctl knobs coming in\nfollowup patch.\n\nThe output also includes information for the kthreads used for stats.\n\nSigned-off-by: Julian Anastasov <ja@ssi.bg>\n---\n net/netfilter/ipvs/ip_vs_ctl.c | 145 +++++++++++++++++++++++++++++++++\n 1 file changed, 145 insertions(+)", "diff": "diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c\nindex d06d710dac83..b536799a725f 100644\n--- a/net/netfilter/ipvs/ip_vs_ctl.c\n+++ b/net/netfilter/ipvs/ip_vs_ctl.c\n@@ -2925,6 +2925,144 @@ static int ip_vs_stats_percpu_show(struct seq_file *seq, void *v)\n \n \treturn 0;\n }\n+\n+static int ip_vs_status_show(struct seq_file *seq, void *v)\n+{\n+\tstruct net *net = seq_file_single_net(seq);\n+\tstruct netns_ipvs *ipvs = net_ipvs(net);\n+\tunsigned int resched_score = 0;\n+\tstruct ip_vs_conn_hnode *hn;\n+\tstruct hlist_bl_head *head;\n+\tstruct ip_vs_service *svc;\n+\tstruct ip_vs_rht *t, *pt;\n+\tstruct hlist_bl_node *e;\n+\tint old_gen, new_gen;\n+\tu32 counts[8];\n+\tu32 bucket;\n+\tint count;\n+\tu32 sum1;\n+\tu32 sum;\n+\tint i;\n+\n+\trcu_read_lock();\n+\n+\tt = rcu_dereference(ipvs->conn_tab);\n+\n+\tseq_printf(seq, \"Conns:\\t%d\\n\", atomic_read(&ipvs->conn_count));\n+\tseq_printf(seq, \"Conn buckets:\\t%d (%d bits, lfactor %d)\\n\",\n+\t\t t ? t->size : 0, t ? t->bits : 0, t ? t->lfactor : 0);\n+\n+\tif (!atomic_read(&ipvs->conn_count))\n+\t\tgoto after_conns;\n+\told_gen = atomic_read(&ipvs->conn_tab_changes);\n+\n+repeat_conn:\n+\tsmp_rmb(); /* ipvs->conn_tab and conn_tab_changes */\n+\tmemset(counts, 0, sizeof(counts));\n+\tip_vs_rht_for_each_table_rcu(ipvs->conn_tab, t, pt) {\n+\t\tfor (bucket = 0; bucket < t->size; bucket++) {\n+\t\t\tDECLARE_IP_VS_RHT_WALK_BUCKET_RCU();\n+\n+\t\t\tcount = 0;\n+\t\t\tresched_score++;\n+\t\t\tip_vs_rht_walk_bucket_rcu(t, bucket, head) {\n+\t\t\t\tcount = 0;\n+\t\t\t\thlist_bl_for_each_entry_rcu(hn, e, head, node)\n+\t\t\t\t\tcount++;\n+\t\t\t}\n+\t\t\tresched_score += count;\n+\t\t\tif (resched_score >= 100) {\n+\t\t\t\tresched_score = 0;\n+\t\t\t\tcond_resched_rcu();\n+\t\t\t\tnew_gen = atomic_read(&ipvs->conn_tab_changes);\n+\t\t\t\t/* New table installed ? */\n+\t\t\t\tif (old_gen != new_gen) {\n+\t\t\t\t\told_gen = new_gen;\n+\t\t\t\t\tgoto repeat_conn;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tcounts[min(count, (int)ARRAY_SIZE(counts) - 1)]++;\n+\t\t}\n+\t}\n+\tfor (sum = 0, i = 0; i < ARRAY_SIZE(counts); i++)\n+\t\tsum += counts[i];\n+\tsum1 = sum - counts[0];\n+\tseq_printf(seq, \"Conn buckets empty:\\t%u (%lu%%)\\n\",\n+\t\t counts[0], (unsigned long)counts[0] * 100 / max(sum, 1U));\n+\tfor (i = 1; i < ARRAY_SIZE(counts); i++) {\n+\t\tif (!counts[i])\n+\t\t\tcontinue;\n+\t\tseq_printf(seq, \"Conn buckets len-%d:\\t%u (%lu%%)\\n\",\n+\t\t\t i, counts[i],\n+\t\t\t (unsigned long)counts[i] * 100 / max(sum1, 1U));\n+\t}\n+\n+after_conns:\n+\tt = rcu_dereference(ipvs->svc_table);\n+\n+\tcount = ip_vs_get_num_services(ipvs);\n+\tseq_printf(seq, \"Services:\\t%d\\n\", count);\n+\tseq_printf(seq, \"Service buckets:\\t%d (%d bits, lfactor %d)\\n\",\n+\t\t t ? t->size : 0, t ? t->bits : 0, t ? t->lfactor : 0);\n+\n+\tif (!count)\n+\t\tgoto after_svc;\n+\told_gen = atomic_read(&ipvs->svc_table_changes);\n+\n+repeat_svc:\n+\tsmp_rmb(); /* ipvs->svc_table and svc_table_changes */\n+\tmemset(counts, 0, sizeof(counts));\n+\tip_vs_rht_for_each_table_rcu(ipvs->svc_table, t, pt) {\n+\t\tfor (bucket = 0; bucket < t->size; bucket++) {\n+\t\t\tDECLARE_IP_VS_RHT_WALK_BUCKET_RCU();\n+\n+\t\t\tcount = 0;\n+\t\t\tresched_score++;\n+\t\t\tip_vs_rht_walk_bucket_rcu(t, bucket, head) {\n+\t\t\t\tcount = 0;\n+\t\t\t\thlist_bl_for_each_entry_rcu(svc, e, head,\n+\t\t\t\t\t\t\t s_list)\n+\t\t\t\t\tcount++;\n+\t\t\t}\n+\t\t\tresched_score += count;\n+\t\t\tif (resched_score >= 100) {\n+\t\t\t\tresched_score = 0;\n+\t\t\t\tcond_resched_rcu();\n+\t\t\t\tnew_gen = atomic_read(&ipvs->svc_table_changes);\n+\t\t\t\t/* New table installed ? */\n+\t\t\t\tif (old_gen != new_gen) {\n+\t\t\t\t\told_gen = new_gen;\n+\t\t\t\t\tgoto repeat_svc;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tcounts[min(count, (int)ARRAY_SIZE(counts) - 1)]++;\n+\t\t}\n+\t}\n+\tfor (sum = 0, i = 0; i < ARRAY_SIZE(counts); i++)\n+\t\tsum += counts[i];\n+\tsum1 = sum - counts[0];\n+\tseq_printf(seq, \"Service buckets empty:\\t%u (%lu%%)\\n\",\n+\t\t counts[0], (unsigned long)counts[0] * 100 / max(sum, 1U));\n+\tfor (i = 1; i < ARRAY_SIZE(counts); i++) {\n+\t\tif (!counts[i])\n+\t\t\tcontinue;\n+\t\tseq_printf(seq, \"Service buckets len-%d:\\t%u (%lu%%)\\n\",\n+\t\t\t i, counts[i],\n+\t\t\t (unsigned long)counts[i] * 100 / max(sum1, 1U));\n+\t}\n+\n+after_svc:\n+\tseq_printf(seq, \"Stats thread slots:\\t%d (max %lu)\\n\",\n+\t\t ipvs->est_kt_count, ipvs->est_max_threads);\n+\tseq_printf(seq, \"Stats chain max len:\\t%d\\n\", ipvs->est_chain_max);\n+\tseq_printf(seq, \"Stats thread ests:\\t%d\\n\",\n+\t\t ipvs->est_chain_max * IPVS_EST_CHAIN_FACTOR *\n+\t\t IPVS_EST_NTICKS);\n+\n+\trcu_read_unlock();\n+\treturn 0;\n+}\n+\n #endif\n \n /*\n@@ -4826,6 +4964,9 @@ int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs)\n \t\t\t\t ipvs->net->proc_net,\n \t\t\t\t ip_vs_stats_percpu_show, NULL))\n \t\tgoto err_percpu;\n+\tif (!proc_create_net_single(\"ip_vs_status\", 0, ipvs->net->proc_net,\n+\t\t\t\t ip_vs_status_show, NULL))\n+\t\tgoto err_status;\n #endif\n \n \tret = ip_vs_control_net_init_sysctl(ipvs);\n@@ -4836,6 +4977,9 @@ int __net_init ip_vs_control_net_init(struct netns_ipvs *ipvs)\n \n err:\n #ifdef CONFIG_PROC_FS\n+\tremove_proc_entry(\"ip_vs_status\", ipvs->net->proc_net);\n+\n+err_status:\n \tremove_proc_entry(\"ip_vs_stats_percpu\", ipvs->net->proc_net);\n \n err_percpu:\n@@ -4861,6 +5005,7 @@ void __net_exit ip_vs_control_net_cleanup(struct netns_ipvs *ipvs)\n \tip_vs_control_net_cleanup_sysctl(ipvs);\n \tcancel_delayed_work_sync(&ipvs->est_reload_work);\n #ifdef CONFIG_PROC_FS\n+\tremove_proc_entry(\"ip_vs_status\", ipvs->net->proc_net);\n \tremove_proc_entry(\"ip_vs_stats_percpu\", ipvs->net->proc_net);\n \tremove_proc_entry(\"ip_vs_stats\", ipvs->net->proc_net);\n \tremove_proc_entry(\"ip_vs\", ipvs->net->proc_net);\n", "prefixes": [ "PATCHv2", "nf-next", "2/3" ] }