Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2221779/?format=api
{ "id": 2221779, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2221779/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260410112352.23599-3-fw@strlen.de/", "project": { "id": 26, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260410112352.23599-3-fw@strlen.de>", "list_archive_url": null, "date": "2026-04-10T11:23:43", "name": "[net-next,02/11] ipvs: add ip_vs_status info", "commit_ref": null, "pull_url": null, "state": "handled-elsewhere", "archived": true, "hash": "370a866eb5dd475265c60985b21e35d410bf16b4", "submitter": { "id": 1025, "url": "http://patchwork.ozlabs.org/api/1.2/people/1025/?format=api", "name": "Florian Westphal", "email": "fw@strlen.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260410112352.23599-3-fw@strlen.de/mbox/", "series": [ { "id": 499444, "url": "http://patchwork.ozlabs.org/api/1.2/series/499444/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=499444", "date": "2026-04-10T11:23:46", "name": "[net-next,01/11] ipvs: show the current conn_tab size to users", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499444/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2221779/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2221779/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <netfilter-devel+bounces-11798-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 spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11798-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=91.216.245.30", "smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=strlen.de", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\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 4fsZNK4Njdz1yGS\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 21:30:09 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id AEDB430530F9\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 11:24:08 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 0036139DBF9;\n\tFri, 10 Apr 2026 11:24:08 +0000 (UTC)", "from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc\n [91.216.245.30])\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 5B209284B37;\n\tFri, 10 Apr 2026 11:24:06 +0000 (UTC)", "by Chamillionaire.breakpoint.cc (Postfix, from userid 1003)\n\tid E5F516065F; Fri, 10 Apr 2026 13:24:04 +0200 (CEST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775820247; cv=none;\n b=CmTbuyXko3WPl7CohG55XkoqKu/w+xWIZvp2JzpAarKGytoUXjM2uf1TQuega+kT263STK6Glvimi6ltptqmCjl3iqUjvGQQRDxbRNsp4NgFZ1kUqP6B2XhHVPdqf1E8kTI6GfGD+wRg6OEMmk2FY/0ZtSJdj8Ik7ZuCaYdUIsk=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775820247; c=relaxed/simple;\n\tbh=9AuAAHNhUFBBT3Jd+R7NHtBE6sStdcftR8LBWk6DYN4=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=N9UFyECi5UkPwmgzTUaVwyWpjcefgs6bpwTKVrnOb09uUB5U68Uzi2BWS0CwwbXMnESu+9GwBt5pVnn1wSvsd/Pj+P2jarhxErYSvYczl0hnbHN8wUpwqxr/91LN1IZJb0elCz/BqM+0YXoZgoTPd+r9tWNelRvWu3Qeil3NUeM=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=strlen.de;\n spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc;\n arc=none smtp.client-ip=91.216.245.30", "From": "Florian Westphal <fw@strlen.de>", "To": "<netdev@vger.kernel.org>", "Cc": "Paolo Abeni <pabeni@redhat.com>,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\tEric Dumazet <edumazet@google.com>,\n\tJakub Kicinski <kuba@kernel.org>,\n\t<netfilter-devel@vger.kernel.org>,\n\tpablo@netfilter.org", "Subject": "[PATCH net-next 02/11] ipvs: add ip_vs_status info", "Date": "Fri, 10 Apr 2026 13:23:43 +0200", "Message-ID": "<20260410112352.23599-3-fw@strlen.de>", "X-Mailer": "git-send-email 2.52.0", "In-Reply-To": "<20260410112352.23599-1-fw@strlen.de>", "References": "<20260410112352.23599-1-fw@strlen.de>", "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": "From: Julian Anastasov <ja@ssi.bg>\n\nAdd /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>\nSigned-off-by: Florian Westphal <fw@strlen.de>\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 1322dd54ed7c..fb1df61edfdd 100644\n--- a/net/netfilter/ipvs/ip_vs_ctl.c\n+++ b/net/netfilter/ipvs/ip_vs_ctl.c\n@@ -2924,6 +2924,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@@ -4825,6 +4963,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@@ -4835,6 +4976,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@@ -4860,6 +5004,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": [ "net-next", "02/11" ] }