Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/659/?format=api
{ "id": 659, "url": "http://patchwork.ozlabs.org/api/patches/659/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/alpine.LNX.2.00.0809192040250.22510@titan.stealer.net/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<alpine.LNX.2.00.0809192040250.22510@titan.stealer.net>", "list_archive_url": null, "date": "2008-09-19T18:41:56", "name": "ipvs: Restrict sync message to 255 connections", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "990fc7d180310db7482482b27e4a0831b0795c18", "submitter": { "id": 324, "url": "http://patchwork.ozlabs.org/api/people/324/?format=api", "name": "Sven Wegener", "email": "sven.wegener@stealer.net" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/alpine.LNX.2.00.0809192040250.22510@titan.stealer.net/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/659/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/659/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.176.167])\n\tby ozlabs.org (Postfix) with ESMTP id 41F0ADDDFA\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 20 Sep 2008 04:42:43 +1000 (EST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1755192AbYISSm1 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 19 Sep 2008 14:42:27 -0400", "(majordomo@vger.kernel.org) by vger.kernel.org id S1755180AbYISSmZ\n\t(ORCPT <rfc822; netdev-outgoing>); Fri, 19 Sep 2008 14:42:25 -0400", "from smtp1.stealer.net ([88.198.224.204]:58977 \"EHLO\n\tsmtp1.stealer.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1755018AbYISSmX (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Fri, 19 Sep 2008 14:42:23 -0400", "from titan.stealer.net ([88.198.224.206]:58529)\n\tby smtp1.stealer.net with esmtps (TLSv1:AES256-SHA:256)\n\tid 1KgkvY-0006A1-M4\n\tfrom sender sven.wegener@stealer.net; Fri, 19 Sep 2008 18:42:08 +0000", "from sven (helo=localhost)\n\tby titan.stealer.net with local-esmtp (Exim 4.69)\n\t(envelope-from <sven.wegener@stealer.net>)\n\tid 1KgkvU-0001wA-VD; Fri, 19 Sep 2008 18:41:57 +0000" ], "Date": "Fri, 19 Sep 2008 20:41:56 +0200 (CEST)", "From": "Sven Wegener <sven.wegener@stealer.net>", "To": "lvs-devel@vger.kernel.org, netdev@vger.kernel.org,\n\tJulian Anastasov <ja@ssi.bg>, Simon Horman <horms@verge.net.au>,\n\tWensong Zhang <wensong@linux-vs.org>", "Subject": "[PATCH] ipvs: Restrict sync message to 255 connections", "Message-ID": "<alpine.LNX.2.00.0809192040250.22510@titan.stealer.net>", "User-Agent": "Alpine 2.00 (LNX 1167 2008-08-23)", "Organization": "STEALER.net", "MIME-Version": "1.0", "Content-Type": "TEXT/PLAIN; charset=US-ASCII", "X-Spam-Score": "0.1", "X-Spam-Bar": "/", "X-Spam-Report": "Scanned by SpamAssassin 3.2.1-gr1 2007-05-02 on\n\tsmtp1.stealer.net at Fri, 19 Sep 2008 18:42:08 +0000\n\tBayes: 0.4956 Tokens: new, 242; hammy, 2; neutral, 4; spammy, 1.\n\tAutoLearn: no\n\t* 0.1 RDNS_NONE Delivered to trusted network by a host with no rDNS\n\t* 0.0 BAYES_50 BODY: Bayesian spam probability is 40 to 60%\n\t* [score: 0.4956]", "X-Spam-Signature": "62666bda00f2e9370a9062030b1cfea632119b6a", "X-DomainKey-Status": "no signature", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "The nr_conns variable in the sync message header is only eight bits wide\nand will overflow on interfaces with a large MTU. As a result the backup\nwon't parse all connections contained in the sync buffer. On regular\nethernet with an MTU of 1500 this isn't a problem, because we can't\noverflow the value, but consider jumbo frames being used on a cross-over\nconnection between both directors.\n\nWe now restrict the size of the sync buffer, so that we never put more\nthan 255 connections into a single sync buffer.\n\nSigned-off-by: Sven Wegener <sven.wegener@stealer.net>", "diff": "diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c\nindex 28237a5..de5e7e1 100644\n--- a/net/ipv4/ipvs/ip_vs_sync.c\n+++ b/net/ipv4/ipvs/ip_vs_sync.c\n@@ -30,6 +30,7 @@\n #include <linux/err.h>\n #include <linux/kthread.h>\n #include <linux/wait.h>\n+#include <linux/kernel.h>\n \n #include <net/ip.h>\n #include <net/sock.h>\n@@ -99,6 +100,7 @@ struct ip_vs_sync_thread_data {\n */\n \n #define SYNC_MESG_HEADER_LEN\t4\n+#define MAX_CONNS_PER_SYNCBUFF\t255 /* nr_conns in ip_vs_sync_mesg is 8 bit */\n \n struct ip_vs_sync_mesg {\n \t__u8 nr_conns;\n@@ -516,8 +518,8 @@ static int set_sync_mesg_maxlen(int sync_state)\n \t\tnum = (dev->mtu - sizeof(struct iphdr) -\n \t\t sizeof(struct udphdr) -\n \t\t SYNC_MESG_HEADER_LEN - 20) / SIMPLE_CONN_SIZE;\n-\t\tsync_send_mesg_maxlen =\n-\t\t\tSYNC_MESG_HEADER_LEN + SIMPLE_CONN_SIZE * num;\n+\t\tsync_send_mesg_maxlen = SYNC_MESG_HEADER_LEN +\n+\t\t\tSIMPLE_CONN_SIZE * min(num, MAX_CONNS_PER_SYNCBUFF);\n \t\tIP_VS_DBG(7, \"setting the maximum length of sync sending \"\n \t\t\t \"message %d.\\n\", sync_send_mesg_maxlen);\n \t} else if (sync_state == IP_VS_STATE_BACKUP) {\n", "prefixes": [] }