From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2212AA04F5 for ; Wed, 11 Dec 2019 22:28:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 17D871D9E; Wed, 11 Dec 2019 22:28:49 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id A54151D9E for ; Wed, 11 Dec 2019 22:28:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576099725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nVQltnnbhhdN4yHhYQrVucLPiqKDKiHSR4jIyNDpKzU=; b=Hxb5b5D09jdIOzG8BKxL6FBbZ8Y0NMe6pIQp2HACJYcwVgIAlk0aPkitgFd6u0R/yf8cF4 HLxtdJFBRy5kSmARlJz+kW8svn3AzPzs5oZXSDJRgfljCvtFw94dTmDFaAI6xjc3FNd/zr 4lq3+8wOGUNybvzQdSveHv3mby2fJhA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-365-TfKuyPHeMmu_Cz1DTwi9NA-1; Wed, 11 Dec 2019 16:28:41 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C755DBE6; Wed, 11 Dec 2019 21:28:40 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4182410013A1; Wed, 11 Dec 2019 21:28:39 +0000 (UTC) From: Kevin Traynor To: Krzysztof Kanas Cc: Chas Williams , Ferruh Yigit , dpdk stable Date: Wed, 11 Dec 2019 21:26:31 +0000 Message-Id: <20191211212702.27851-39-ktraynor@redhat.com> In-Reply-To: <20191211212702.27851-1-ktraynor@redhat.com> References: <20191211212702.27851-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: TfKuyPHeMmu_Cz1DTwi9NA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/bonding: fix selection logic' has been queued to LTS release 18.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.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 12/17/19. 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 rebasi= ng (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/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/f64b3144cef8e9d14d= 85a303d8f7590f219e7108 Thanks. Kevin. --- >From f64b3144cef8e9d14d85a303d8f7590f219e7108 Mon Sep 17 00:00:00 2001 From: Krzysztof Kanas Date: Wed, 13 Nov 2019 09:22:24 +0100 Subject: [PATCH] net/bonding: fix selection logic [ upstream commit 8d75f49e61c11bff2ecf48818f7acf4520329848 ] Arrays agg_count and agg_bandwidth should be indexed by slave_id not by aggregator port_id. The new_agg_id should be chosen as slave_id from slaves table in different selection modes. Fixes: 6d72657ce379 ("net/bonding: add other aggregator modes") Signed-off-by: Krzysztof Kanas Acked-by: Chas Williams Acked-by: Ferruh Yigit --- drivers/net/bonding/rte_eth_bond_8023ad.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bondin= g/rte_eth_bond_8023ad.c index def27c9f1..0beea19c4 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -673,7 +673,6 @@ selection_logic(struct bond_dev_private *internals, uin= t16_t slave_id) =09uint64_t agg_count[RTE_MAX_ETHPORTS] =3D {0}; =09uint16_t default_slave =3D 0; -=09uint16_t mode_count_id; -=09uint16_t mode_band_id; =09struct rte_eth_link link_info; +=09uint16_t agg_new_idx =3D 0; =20 =09slaves =3D internals->active_slaves; @@ -688,7 +687,7 @@ selection_logic(struct bond_dev_private *internals, uin= t16_t slave_id) =09=09=09continue; =20 -=09=09agg_count[agg->aggregator_port_id] +=3D 1; +=09=09agg_count[i] +=3D 1; =09=09rte_eth_link_get_nowait(slaves[i], &link_info); -=09=09agg_bandwidth[agg->aggregator_port_id] +=3D link_info.link_speed; +=09=09agg_bandwidth[i] +=3D link_info.link_speed; =20 =09=09/* Actors system ID is not checked since all slave device have the s= ame @@ -710,14 +709,14 @@ selection_logic(struct bond_dev_private *internals, u= int16_t slave_id) =09switch (internals->mode4.agg_selection) { =09case AGG_COUNT: -=09=09mode_count_id =3D max_index(agg_count, slaves_count); -=09=09new_agg_id =3D mode_count_id; +=09=09agg_new_idx =3D max_index(agg_count, slaves_count); +=09=09new_agg_id =3D slaves[agg_new_idx]; =09=09break; =09case AGG_BANDWIDTH: -=09=09mode_band_id =3D max_index(agg_bandwidth, slaves_count); -=09=09new_agg_id =3D mode_band_id; +=09=09agg_new_idx =3D max_index(agg_bandwidth, slaves_count); +=09=09new_agg_id =3D slaves[agg_new_idx]; =09=09break; =09case AGG_STABLE: =09=09if (default_slave =3D=3D slaves_count) -=09=09=09new_agg_id =3D slave_id; +=09=09=09new_agg_id =3D slaves[slave_id]; =09=09else =09=09=09new_agg_id =3D slaves[default_slave]; @@ -725,5 +724,5 @@ selection_logic(struct bond_dev_private *internals, uin= t16_t slave_id) =09default: =09=09if (default_slave =3D=3D slaves_count) -=09=09=09new_agg_id =3D slave_id; +=09=09=09new_agg_id =3D slaves[slave_id]; =09=09else =09=09=09new_agg_id =3D slaves[default_slave]; --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-11 21:24:15.802475506 +0000 +++ 0039-net-bonding-fix-selection-logic.patch=092019-12-11 21:24:12.675651= 052 +0000 @@ -1 +1 @@ -From 8d75f49e61c11bff2ecf48818f7acf4520329848 Mon Sep 17 00:00:00 2001 +From f64b3144cef8e9d14d85a303d8f7590f219e7108 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 8d75f49e61c11bff2ecf48818f7acf4520329848 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 05b3004c4..b77a37ddb 100644 +index def27c9f1..0beea19c4 100644 @@ -26 +27 @@ -@@ -674,7 +674,6 @@ selection_logic(struct bond_dev_private *internals, ui= nt16_t slave_id) +@@ -673,7 +673,6 @@ selection_logic(struct bond_dev_private *internals, ui= nt16_t slave_id) @@ -33 +33,0 @@ - =09int ret; @@ -35 +35,2 @@ -@@ -697,6 +696,6 @@ selection_logic(struct bond_dev_private *internals, ui= nt16_t slave_id) + =09slaves =3D internals->active_slaves; +@@ -688,7 +687,7 @@ selection_logic(struct bond_dev_private *internals, ui= nt16_t slave_id) @@ -37 +38 @@ - =09=09} +=20 @@ -39 +39,0 @@ --=09=09agg_bandwidth[agg->aggregator_port_id] +=3D link_info.link_speed; @@ -40,0 +41,2 @@ + =09=09rte_eth_link_get_nowait(slaves[i], &link_info); +-=09=09agg_bandwidth[agg->aggregator_port_id] +=3D link_info.link_speed; @@ -44 +46 @@ -@@ -719,14 +718,14 @@ selection_logic(struct bond_dev_private *internals, = uint16_t slave_id) +@@ -710,14 +709,14 @@ selection_logic(struct bond_dev_private *internals, = uint16_t slave_id) @@ -64 +66 @@ -@@ -734,5 +733,5 @@ selection_logic(struct bond_dev_private *internals, ui= nt16_t slave_id) +@@ -725,5 +724,5 @@ selection_logic(struct bond_dev_private *internals, ui= nt16_t slave_id)