From patchwork Tue May 16 13:44:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Palczewski X-Patchwork-Id: 13243203 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C9AE34CD9 for ; Tue, 16 May 2023 13:50:24 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76B9B1721 for ; Tue, 16 May 2023 06:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684245021; x=1715781021; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gpfUFUucWBxadKGnBNsvGfbgUWvCCyHXrLjw0Qu0HQY=; b=MXiS0gGyg17pkvBmT62FQpbiGOCXIW5ds08pXnGRzCpGjDZLDkQa4Xso Yq6zhcQeVC9a0THLutheBstVt0OQQg/vY8ERWIsokpmWdD2XvaN/WKDOa ayInzZkrRNoqIVGNk6CG9dxbgCi62DVgn+aGIB0ZLMQZCsRzmHdpLEK+D bDDGk0R1mz7fFCGsj6eWcobT9+4gj5C7kqgO7rKVG5oRX1+rgFZN2AYnD OxKHRGneUSQqIxos03d9kv9y8dQ0kJ5nuiYa92z938eqKHI6UhSmvPAWu deBPgDClOe7fHytjIjD20EYtOT9SSguWYOyq2t5IqxyDjREKZQzVnQdA0 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="350319872" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="350319872" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2023 06:50:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="651846458" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="651846458" Received: from amlin-018-068.igk.intel.com ([10.102.18.68]) by orsmga003.jf.intel.com with ESMTP; 16 May 2023 06:50:20 -0700 From: Mateusz Palczewski To: j.vosburgh@gmail.com, andy@greyhouse.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, dbanerje@akamai.com, netdev@vger.kernel.org Cc: Sebastian Basierski , Mateusz Palczewski Subject: [PATCH iwl-net v1 1/2] drivers/net/bonding/bond_3ad: Use updated MAC address for lacpdu packets Date: Tue, 16 May 2023 09:44:46 -0400 Message-Id: <20230516134447.193511-2-mateusz.palczewski@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230516134447.193511-1-mateusz.palczewski@intel.com> References: <20230516134447.193511-1-mateusz.palczewski@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Sebastian Basierski After changing VFs MAC address, bonding driver shouldn't use the old address. Otherwise lapcdu packets will have set wrong source MAC address. Fixes: ada0f8633c5b ("bonding: Convert memcpy(foo, bar, ETH_ALEN) to ether_addr_copy(foo, bar)") Signed-off-by: Sebastian Basierski Signed-off-by: Mateusz Palczewski --- drivers/net/bonding/bond_3ad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index c99ffe6c683a..b5202af79f20 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -869,10 +869,10 @@ static int ad_lacpdu_send(struct port *port) lacpdu_header = skb_put(skb, length); ether_addr_copy(lacpdu_header->hdr.h_dest, lacpdu_mcast_addr); - /* Note: source address is set to be the member's PERMANENT address, + /* Note: source address is set to be the member's CURRENT address, * because we use it to identify loopback lacpdus in receive. */ - ether_addr_copy(lacpdu_header->hdr.h_source, slave->perm_hwaddr); + ether_addr_copy(lacpdu_header->hdr.h_source, slave->dev->dev_addr); lacpdu_header->hdr.h_proto = PKT_TYPE_LACPDU; lacpdu_header->lacpdu = port->lacpdu; From patchwork Tue May 16 13:44:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Palczewski X-Patchwork-Id: 13243204 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26CF734CD9 for ; Tue, 16 May 2023 13:50:28 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13ED4D2 for ; Tue, 16 May 2023 06:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684245025; x=1715781025; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vQcJU3lSJAF6PsC5BotX8CiRprRz0zuovMimtLk2P4k=; b=j7f/DU8wG96saoCKkjwE76ZxTJuOwOz1VhSbNxx5oXxHwkdNFNy1qLMD A3I+JZO9GLG1W0TZqOt7dlh5I2I4mRsMfrrOxThV5JemaPZH0INDpSJ1S RjN9Ad4MVmbMtE/U2LGVxZFZL2FlTEF0zMmNXEGIfFAEsyLivG/G/FUSa 2K3rJ7KIz2jijydMK1AeXvek9cfHCt/ABPOyQxXOUv+yZORsS5+PqS0yH Gs7XGl2VrFS55xkVSWB6Y+TSCIKbmIn7+qryYXhmCBngXdvgxPbw/ELzX bPcLMcAVNCVsx6N5ZMEAB/G7S/PXdc+1SKSy4UDgk/yDV02DEtfCucHK6 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="350319896" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="350319896" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2023 06:50:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="651846494" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="651846494" Received: from amlin-018-068.igk.intel.com ([10.102.18.68]) by orsmga003.jf.intel.com with ESMTP; 16 May 2023 06:50:24 -0700 From: Mateusz Palczewski To: j.vosburgh@gmail.com, andy@greyhouse.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, dbanerje@akamai.com, netdev@vger.kernel.org Cc: Sebastian Basierski , Mateusz Palczewski Subject: [PATCH iwl-net v1 2/2] drivers/net/bonding: Added some delay while checking for VFs link Date: Tue, 16 May 2023 09:44:47 -0400 Message-Id: <20230516134447.193511-3-mateusz.palczewski@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230516134447.193511-1-mateusz.palczewski@intel.com> References: <20230516134447.193511-1-mateusz.palczewski@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Sebastian Basierski Right now bonding driver checks if link is ready once. VF interface takes a little more time to get ready than PF, so driver needs to wait for it to be ready. 1000ms delay was set, if VF link will not be set within given amount of time, for sure problems should be investigated elsewhere. Fixes: b3c898e20b18 ("Revert "bonding: allow carrier and link status to determine link state"") Signed-off-by: Sebastian Basierski Signed-off-by: Mateusz Palczewski --- drivers/net/bonding/bond_main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 710548dbd0c1..6d49fb25969e 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -736,6 +736,8 @@ const char *bond_slave_link_status(s8 link) * It'd be nice if there was a good way to tell if a driver supports * netif_carrier, but there really isn't. */ +#define BOND_CARRIER_CHECK_TIMEOUT 1000 + static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_dev, int reporting) { @@ -743,12 +745,22 @@ static int bond_check_dev_link(struct bonding *bond, int (*ioctl)(struct net_device *, struct ifreq *, int); struct ifreq ifr; struct mii_ioctl_data *mii; + int delay; if (!reporting && !netif_running(slave_dev)) return 0; + for (delay = 0; delay < BOND_CARRIER_CHECK_TIMEOUT; delay++) { + mdelay(1); + + if (bond->params.use_carrier && + netif_carrier_ok(slave_dev)) { + return BMSR_LSTATUS; + } + } + if (bond->params.use_carrier) - return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0; + return 0; /* Try to get link status using Ethtool first. */ if (slave_dev->ethtool_ops->get_link)