From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3C5AC454E8 for ; Tue, 25 Jun 2024 01:59:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37E2E4026F; Tue, 25 Jun 2024 01:59:42 +0200 (CEST) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mails.dpdk.org (Postfix) with ESMTP id 644BA41101 for ; Tue, 25 Jun 2024 01:59:41 +0200 (CEST) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-42499b98d4cso3488025e9.2 for ; Mon, 24 Jun 2024 16:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719273581; x=1719878381; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W+vrs+IP2+hhzC1nOAzq4A6I4rUd/pPPXJ/o4k44pUw=; b=VMSMmBeYyKUQhAwpSJ9cVfWshkiHuBDG+/aqXH1SM4UsjhvB4szyXCSkN0kGdINEcL vW++e3KnPiaXrwuGoX/WkOBBeALVHKt9Uler5NMqzEU8hxGRuEvLTciaYdiR46HRlvyh M9Hw3HcSM5Xv6WNZQZ0fjn5Dw5+7rXCdXNA0bdHt5sD6+3aeBKAD+J5RFIxriGFQVVZj Fk+jHJAyEhvDRaojREn+Q1qC4c8uGGausFltka3LhE4AVJwO6vLPjSMCx+whnl8AtJGO GS7k3AGZ/i8lb81wP+yXVxESMER00FhHF/0v/eUeUj0TWD+r/aSNTPmdjis9AIuuhTsQ 1WRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719273581; x=1719878381; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W+vrs+IP2+hhzC1nOAzq4A6I4rUd/pPPXJ/o4k44pUw=; b=EwQXOX+zyRmY00z0GOoVWh9DH0GARxCBMPLU2Xsvtqniaah4M6sRV/++BVUGcNRhSS O2fPZc5qj6NxT4vgOuJTLOZgYCqaNJwzpPvI8KjWlK6wu/g4DIoyr5jkhiUfFcXsXP01 t/KJv2YbFB4tKVmne0bOZs/JYicZQ6DCDZaTN0neCbFLbxUTLGoTgIsM3bRmCcJaVR4e T1CLyXaEJQnT0nfzqJ86uuMgy8ow6VG3+rZPB8OhVAgzvUJHBifwkO+EYXdDTXdICRAr OW02ia1EreWE9B0H0wFnmJo3JbBIHyrDSZL6rtwRym2mNguk+jKwLcj7YsNdlvzNYQT5 5YqA== X-Gm-Message-State: AOJu0Yzu7wTM5h4zBH5V8lxTBIQ5FSIo9NICAdkQocQxBBzZZL6C6FCP rbP+1pTfQTkXQ8TGrhn1ML11BI4ZsVdIgqMM6zClB5RTP9GpNBV267cxGw== X-Google-Smtp-Source: AGHT+IFrzrQ3Zph4IFjDFcdKyRUkNJqYCvJ3y9kOPwrciHf2PJqco9q/O6UbLRNhUn7khDQ9zz1Aig== X-Received: by 2002:a05:600c:3553:b0:424:7fda:dc75 with SMTP id 5b1f17b1804b1-4248cc2ba92mr39841285e9.16.1719273581009; Mon, 24 Jun 2024 16:59:41 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:7aef:1aaa:3dff:d546]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4247d21243esm193397445e9.43.2024.06.24.16.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 16:59:40 -0700 (PDT) From: luca.boccassi@gmail.com To: Gaoxiang Liu Cc: dpdk stable Subject: patch 'net/bonding: fix failover time of LACP with mode 4' has been queued to stable release 22.11.6 Date: Tue, 25 Jun 2024 00:57:55 +0100 Message-Id: <20240624235907.885628-9-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240624235907.885628-1-luca.boccassi@gmail.com> References: <20240624235907.885628-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/27/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/6282bde96dc3f9d60c67eaaf4a340a20c3347829 Thanks. Luca Boccassi --- >From 6282bde96dc3f9d60c67eaaf4a340a20c3347829 Mon Sep 17 00:00:00 2001 From: Gaoxiang Liu Date: Mon, 6 Jun 2022 22:34:45 +0800 Subject: [PATCH] net/bonding: fix failover time of LACP with mode 4 [ upstream commit a78a1ed8ba6ae7666d13fee1895badb8eb2abf5f ] When the primary port of bond member with bond mode 4 linked down, the system id of the other member ports changed. It may cause some switches to renegotiate, and the process takes a few seconds. It is not acceptable for any Telcos. We need sub-second switch-over time like in Linux. Set the MAC of the bond port to the member port's system to solve the problem. Bugzilla ID: 551 Fixes: 46fb43683679 ("bond: add mode 4") Signed-off-by: Gaoxiang Liu --- drivers/net/bonding/rte_eth_bond_8023ad.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 928dfca7af..2a81ab5bf3 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -865,7 +865,6 @@ bond_mode_8023ad_periodic_cb(void *arg) struct bond_dev_private *internals = bond_dev->data->dev_private; struct port *port; struct rte_eth_link link_info; - struct rte_ether_addr slave_addr; struct rte_mbuf *lacp_pkt = NULL; uint16_t slave_id; uint16_t i; @@ -892,7 +891,6 @@ bond_mode_8023ad_periodic_cb(void *arg) key = 0; } - rte_eth_macaddr_get(slave_id, &slave_addr); port = &bond_mode_8023ad_ports[slave_id]; key = rte_cpu_to_be_16(key); @@ -904,8 +902,8 @@ bond_mode_8023ad_periodic_cb(void *arg) SM_FLAG_SET(port, NTT); } - if (!rte_is_same_ether_addr(&port->actor.system, &slave_addr)) { - rte_ether_addr_copy(&slave_addr, &port->actor.system); + if (!rte_is_same_ether_addr(&internals->mode4.mac_addr, &port->actor.system)) { + rte_ether_addr_copy(&internals->mode4.mac_addr, &port->actor.system); if (port->aggregator_port_id == slave_id) SM_FLAG_SET(port, NTT); } @@ -1171,21 +1169,20 @@ void bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev) { struct bond_dev_private *internals = bond_dev->data->dev_private; - struct rte_ether_addr slave_addr; struct port *slave, *agg_slave; uint16_t slave_id, i, j; bond_mode_8023ad_stop(bond_dev); + rte_eth_macaddr_get(internals->port_id, &internals->mode4.mac_addr); for (i = 0; i < internals->active_slave_count; i++) { slave_id = internals->active_slaves[i]; slave = &bond_mode_8023ad_ports[slave_id]; - rte_eth_macaddr_get(slave_id, &slave_addr); - if (rte_is_same_ether_addr(&slave_addr, &slave->actor.system)) + if (rte_is_same_ether_addr(&internals->mode4.mac_addr, &slave->actor.system)) continue; - rte_ether_addr_copy(&slave_addr, &slave->actor.system); + rte_ether_addr_copy(&internals->mode4.mac_addr, &slave->actor.system); /* Do nothing if this port is not an aggregator. In other case * Set NTT flag on every port that use this aggregator. */ if (slave->aggregator_port_id != slave_id) -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-06-25 00:22:14.010325082 +0100 +++ 0009-net-bonding-fix-failover-time-of-LACP-with-mode-4.patch 2024-06-25 00:22:13.073183366 +0100 @@ -1 +1 @@ -From a78a1ed8ba6ae7666d13fee1895badb8eb2abf5f Mon Sep 17 00:00:00 2001 +From 6282bde96dc3f9d60c67eaaf4a340a20c3347829 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit a78a1ed8ba6ae7666d13fee1895badb8eb2abf5f ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index 79f1b3f1a0..06c21ebe6d 100644 +index 928dfca7af..2a81ab5bf3 100644 @@ -32 +33 @@ -- struct rte_ether_addr member_addr; +- struct rte_ether_addr slave_addr; @@ -34 +35 @@ - uint16_t member_id; + uint16_t slave_id; @@ -40,2 +41,2 @@ -- rte_eth_macaddr_get(member_id, &member_addr); - port = &bond_mode_8023ad_ports[member_id]; +- rte_eth_macaddr_get(slave_id, &slave_addr); + port = &bond_mode_8023ad_ports[slave_id]; @@ -48,2 +49,2 @@ -- if (!rte_is_same_ether_addr(&port->actor.system, &member_addr)) { -- rte_ether_addr_copy(&member_addr, &port->actor.system); +- if (!rte_is_same_ether_addr(&port->actor.system, &slave_addr)) { +- rte_ether_addr_copy(&slave_addr, &port->actor.system); @@ -52 +53 @@ - if (port->aggregator_port_id == member_id) + if (port->aggregator_port_id == slave_id) @@ -55 +56 @@ -@@ -1173,21 +1171,20 @@ void +@@ -1171,21 +1169,20 @@ void @@ -59,3 +60,3 @@ -- struct rte_ether_addr member_addr; - struct port *member, *agg_member; - uint16_t member_id, i, j; +- struct rte_ether_addr slave_addr; + struct port *slave, *agg_slave; + uint16_t slave_id, i, j; @@ -66,4 +67,4 @@ - for (i = 0; i < internals->active_member_count; i++) { - member_id = internals->active_members[i]; - member = &bond_mode_8023ad_ports[member_id]; -- rte_eth_macaddr_get(member_id, &member_addr); + for (i = 0; i < internals->active_slave_count; i++) { + slave_id = internals->active_slaves[i]; + slave = &bond_mode_8023ad_ports[slave_id]; +- rte_eth_macaddr_get(slave_id, &slave_addr); @@ -71,2 +72,2 @@ -- if (rte_is_same_ether_addr(&member_addr, &member->actor.system)) -+ if (rte_is_same_ether_addr(&internals->mode4.mac_addr, &member->actor.system)) +- if (rte_is_same_ether_addr(&slave_addr, &slave->actor.system)) ++ if (rte_is_same_ether_addr(&internals->mode4.mac_addr, &slave->actor.system)) @@ -75,2 +76,2 @@ -- rte_ether_addr_copy(&member_addr, &member->actor.system); -+ rte_ether_addr_copy(&internals->mode4.mac_addr, &member->actor.system); +- rte_ether_addr_copy(&slave_addr, &slave->actor.system); ++ rte_ether_addr_copy(&internals->mode4.mac_addr, &slave->actor.system); @@ -79 +80 @@ - if (member->aggregator_port_id != member_id) + if (slave->aggregator_port_id != slave_id)