[{"id":1767268,"web_url":"http://patchwork.ozlabs.org/comment/1767268/","msgid":"<CAF2d9jgwYYBYGGEyGnUmhR8rf4x0K6iJiUY5SkCC-hrgTbQgsA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-12T17:40:44","subject":"Re: [PATCH net] net: bonding: fix tlb_dynamic_lb default value","submitter":{"id":6061,"url":"http://patchwork.ozlabs.org/api/people/6061/","name":"Mahesh Bandewar (महेश बंडेवार)","email":"maheshb@google.com"},"content":"On Tue, Sep 12, 2017 at 5:10 AM, Nikolay Aleksandrov\n<nikolay@cumulusnetworks.com> wrote:\n> Commit 8b426dc54cf4 (\"bonding: remove hardcoded value\") changed the\n> default value for tlb_dynamic_lb which lead to either broken ALB mode\n> (since tlb_dynamic_lb can be changed only in TLB) or setting TLB mode\n> with tlb_dynamic_lb equal to 0.\n> The first issue was recently fixed by setting tlb_dynamic_lb to 1 always\n> when switching to ALB mode, but the default value is still wrong and\n> we'll enter TLB mode with tlb_dynamic_lb equal to 0 if the mode is\n> changed via netlink or sysfs. In order to restore the previous behaviour\n> and default value simply remove the mode check around the default param\n> initialization for tlb_dynamic_lb which will always set it to 1 as\n> before.\n>\n> Fixes: 8b426dc54cf4 (\"bonding: remove hardcoded value\")\n> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>\nAcked-by: Mahesh Bandewar <maheshb@google.com>\n> ---\n>  drivers/net/bonding/bond_main.c | 17 +++++++----------\n>  1 file changed, 7 insertions(+), 10 deletions(-)\n>\n> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c\n> index fc63992ab0e0..c99dc59d729b 100644\n> --- a/drivers/net/bonding/bond_main.c\n> +++ b/drivers/net/bonding/bond_main.c\n> @@ -4289,7 +4289,7 @@ static int bond_check_params(struct bond_params *params)\n>         int bond_mode   = BOND_MODE_ROUNDROBIN;\n>         int xmit_hashtype = BOND_XMIT_POLICY_LAYER2;\n>         int lacp_fast = 0;\n> -       int tlb_dynamic_lb = 0;\n> +       int tlb_dynamic_lb;\n>\n>         /* Convert string parameters. */\n>         if (mode) {\n> @@ -4601,16 +4601,13 @@ static int bond_check_params(struct bond_params *params)\n>         }\n>         ad_user_port_key = valptr->value;\n>\n> -       if ((bond_mode == BOND_MODE_TLB) || (bond_mode == BOND_MODE_ALB)) {\n> -               bond_opt_initstr(&newval, \"default\");\n> -               valptr = bond_opt_parse(bond_opt_get(BOND_OPT_TLB_DYNAMIC_LB),\n> -                                       &newval);\n> -               if (!valptr) {\n> -                       pr_err(\"Error: No tlb_dynamic_lb default value\");\n> -                       return -EINVAL;\n> -               }\n> -               tlb_dynamic_lb = valptr->value;\n> +       bond_opt_initstr(&newval, \"default\");\n> +       valptr = bond_opt_parse(bond_opt_get(BOND_OPT_TLB_DYNAMIC_LB), &newval);\n> +       if (!valptr) {\n> +               pr_err(\"Error: No tlb_dynamic_lb default value\");\n> +               return -EINVAL;\n>         }\n> +       tlb_dynamic_lb = valptr->value;\n>\n>         if (lp_interval == 0) {\n>                 pr_warn(\"Warning: ip_interval must be between 1 and %d, so it was reset to %d\\n\",\n> --\n> 2.1.4\n>","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"Thvf1Lyp\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xsBsx4Qnnz9sNV\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 13 Sep 2017 03:41:09 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751518AbdILRlG (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 12 Sep 2017 13:41:06 -0400","from mail-yw0-f178.google.com ([209.85.161.178]:33006 \"EHLO\n\tmail-yw0-f178.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751435AbdILRlF (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Tue, 12 Sep 2017 13:41:05 -0400","by mail-yw0-f178.google.com with SMTP id s62so29835646ywg.0\n\tfor <netdev@vger.kernel.org>; Tue, 12 Sep 2017 10:41:05 -0700 (PDT)","by 10.37.161.71 with HTTP; Tue, 12 Sep 2017 10:40:44 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=google.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=qocbX0Pd10E/CJ9YRw4mpHWe7rjC9WtdPSETMPNXe6I=;\n\tb=Thvf1Lypyi2IgrbV5esufkzXKZ2kWmBcjtR+inXP6JnOKizn4TUsJF/7d79QGVoKia\n\tA4eM728eWMQmAvM8JFBEKbJ5PyZg3iF4fTfkgzoCj52GKiS9sQEXl6NTPvh8oUtVIl7S\n\tb3vbs3OwltW2nltpyzc+53+Y8qCjCh4rkSNZDFiiSp8grlzWVaKXfMN05KsJf48zkIc5\n\tdMZgZvbzzgpV0r5nl454L+6FYPwq2W/X3uGdq1VZUKNQ54stEUJbwMuS25hqwu3k0SUj\n\tO9UysiUU7NkVcp+IQw8s8bHLzZExH1exYGDGaS/KNkJDRCtQXhN/h3FhYNbWk8zUIJTN\n\tJb1g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=qocbX0Pd10E/CJ9YRw4mpHWe7rjC9WtdPSETMPNXe6I=;\n\tb=AuUmdpWIkEpQXo8ZyfxsRi++Io7VfcOHzQf7mT88MgGgHiKyHAqLJt4WQzN/mt+lIG\n\tg+SqHRcKGrXLDXI9lhLiijhozvCOHp+Ct7ExPVkiDDDyPA9Dka6k6kSmwD+6bPEYZ14P\n\ti4v5ZnqXHMby3ImFp0/XqxX20oXrigv935KNoVsON3g2XGe+zltt7zlQLudTbBfRm4qY\n\tH6fwGKPUNPRCh+OfLAm6aRfA+nIGIVplOOdwblsOtlQxNn97kSQ2udeQmSzntUHsRFm1\n\tC7VTAiGhb72O7lMPmKFaul0L6JksH0Qz98YOTVYlOSzSryYCLTlpUJq5Ll6jl70RbkNa\n\tzAPA==","X-Gm-Message-State":"AHPjjUiDJXb87Nr7YKzYAe0XdLeIuH4IZqW+AEqGWKy2Lp5jrIKmpE/b\n\t6pSvMDotAGiuYocC3Qzir8xyytxE+3sYyew=","X-Google-Smtp-Source":"ADKCNb54womYVvKWj/67ba7f//b1ZG3ghY5d0oE1OQbWXr8Azxy4rj8ptAUpdIsuL0rkF4cClQZeXR1Q5/E1frX0vDk=","X-Received":"by 10.129.78.131 with SMTP id\n\tc125mr13911481ywb.157.1505238064931; \n\tTue, 12 Sep 2017 10:41:04 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<1505218205-2637-1-git-send-email-nikolay@cumulusnetworks.com>","References":"<1505218205-2637-1-git-send-email-nikolay@cumulusnetworks.com>","From":"=?utf-8?b?TWFoZXNoIEJhbmRld2FyICjgpK7gpLngpYfgpLYg4KSs4KSC4KSh4KWH?=\n\t=?utf-8?b?4KS14KS+4KSwKQ==?=         <maheshb@google.com>","Date":"Tue, 12 Sep 2017 10:40:44 -0700","Message-ID":"<CAF2d9jgwYYBYGGEyGnUmhR8rf4x0K6iJiUY5SkCC-hrgTbQgsA@mail.gmail.com>","Subject":"Re: [PATCH net] net: bonding: fix tlb_dynamic_lb default value","To":"Nikolay Aleksandrov <nikolay@cumulusnetworks.com>","Cc":"linux-netdev <netdev@vger.kernel.org>, j.vosburgh@gmail.com,\n\tvfalico@gmail.com, andy@greyhouse.net","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}},{"id":1767537,"web_url":"http://patchwork.ozlabs.org/comment/1767537/","msgid":"<20170912.205900.438222724554183210.davem@davemloft.net>","list_archive_url":null,"date":"2017-09-13T03:59:00","subject":"Re: [PATCH net] net: bonding: fix tlb_dynamic_lb default value","submitter":{"id":15,"url":"http://patchwork.ozlabs.org/api/people/15/","name":"David Miller","email":"davem@davemloft.net"},"content":"From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>\nDate: Tue, 12 Sep 2017 15:10:05 +0300\n\n> Commit 8b426dc54cf4 (\"bonding: remove hardcoded value\") changed the\n> default value for tlb_dynamic_lb which lead to either broken ALB mode\n> (since tlb_dynamic_lb can be changed only in TLB) or setting TLB mode\n> with tlb_dynamic_lb equal to 0.\n> The first issue was recently fixed by setting tlb_dynamic_lb to 1 always\n> when switching to ALB mode, but the default value is still wrong and\n> we'll enter TLB mode with tlb_dynamic_lb equal to 0 if the mode is\n> changed via netlink or sysfs. In order to restore the previous behaviour\n> and default value simply remove the mode check around the default param\n> initialization for tlb_dynamic_lb which will always set it to 1 as\n> before.\n> \n> Fixes: 8b426dc54cf4 (\"bonding: remove hardcoded value\")\n> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>\n\nApplied and queued up for -stable, thanks.","headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xsSZw3jj3z9sNw\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 13 Sep 2017 13:59:04 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751732AbdIMD7C (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 12 Sep 2017 23:59:02 -0400","from shards.monkeyblade.net ([184.105.139.130]:37512 \"EHLO\n\tshards.monkeyblade.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751458AbdIMD7B (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Tue, 12 Sep 2017 23:59:01 -0400","from localhost (74-93-104-98-Washington.hfc.comcastbusiness.net\n\t[74.93.104.98]) (using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\t(Authenticated sender: davem-davemloft)\n\tby shards.monkeyblade.net (Postfix) with ESMTPSA id E3F0F10241E39;\n\tTue, 12 Sep 2017 20:59:00 -0700 (PDT)"],"Date":"Tue, 12 Sep 2017 20:59:00 -0700 (PDT)","Message-Id":"<20170912.205900.438222724554183210.davem@davemloft.net>","To":"nikolay@cumulusnetworks.com","Cc":"netdev@vger.kernel.org, j.vosburgh@gmail.com, vfalico@gmail.com,\n\tandy@greyhouse.net, maheshb@google.com","Subject":"Re: [PATCH net] net: bonding: fix tlb_dynamic_lb default value","From":"David Miller <davem@davemloft.net>","In-Reply-To":"<1505218205-2637-1-git-send-email-nikolay@cumulusnetworks.com>","References":"<1505218205-2637-1-git-send-email-nikolay@cumulusnetworks.com>","X-Mailer":"Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO)","Mime-Version":"1.0","Content-Type":"Text/Plain; charset=us-ascii","Content-Transfer-Encoding":"7bit","X-Greylist":"Sender succeeded SMTP AUTH, not delayed by\n\tmilter-greylist-4.5.12 (shards.monkeyblade.net\n\t[149.20.54.216]); Tue, 12 Sep 2017 20:59:01 -0700 (PDT)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"}}]