From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 5F72AA00E6 for ; Tue, 16 Apr 2019 16:38:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 448CA1B4E5; Tue, 16 Apr 2019 16:38:48 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 252121B4DF for ; Tue, 16 Apr 2019 16:38:46 +0200 (CEST) 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 mx1.redhat.com (Postfix) with ESMTPS id 91434308793F; Tue, 16 Apr 2019 14:38:45 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-214.ams2.redhat.com [10.36.117.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id 689F91001DE0; Tue, 16 Apr 2019 14:38:44 +0000 (UTC) From: Kevin Traynor To: David Marchand Cc: Ferruh Yigit , dpdk stable Date: Tue, 16 Apr 2019 15:36:59 +0100 Message-Id: <20190416143719.21601-41-ktraynor@redhat.com> In-Reply-To: <20190416143719.21601-1-ktraynor@redhat.com> References: <20190416143719.21601-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 16 Apr 2019 14:38:45 +0000 (UTC) Subject: [dpdk-stable] patch 'net/bonding: fix slave id types' has been queued to LTS release 18.11.2 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.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/24/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 rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Kevin Traynor --- >From a48b960a6d4c325a62c6480fe1e4311423c353b0 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Wed, 20 Mar 2019 12:47:20 +0100 Subject: [PATCH] net/bonding: fix slave id types [ upstream commit 1d6cab8a91ba461b6a223f98a527d81182c9a6d2 ] Caught by code review, with port id conversion to 16bits, the slave id have been extended to 16bits as well (both slave index and count). Fixes: f8244c6399d9 ("ethdev: increase port id range") Signed-off-by: David Marchand Reviewed-by: Ferruh Yigit --- drivers/net/bonding/rte_eth_bond_8023ad.c | 10 +++--- drivers/net/bonding/rte_eth_bond_alb.c | 4 +-- drivers/net/bonding/rte_eth_bond_api.c | 4 +-- drivers/net/bonding/rte_eth_bond_pmd.c | 36 ++++++++++++---------- drivers/net/bonding/rte_eth_bond_private.h | 8 ++--- 5 files changed, 33 insertions(+), 29 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index dac23ac7b..1e6a3fc7c 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -665,5 +665,5 @@ max_index(uint64_t *a, int n) */ static void -selection_logic(struct bond_dev_private *internals, uint8_t slave_id) +selection_logic(struct bond_dev_private *internals, uint16_t slave_id) { struct port *agg, *port; @@ -782,5 +782,5 @@ link_speed_key(uint16_t speed) { static void -rx_machine_update(struct bond_dev_private *internals, uint8_t slave_id, +rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id, struct rte_mbuf *lacp_pkt) { struct lacpdu_header *lacp; @@ -813,6 +813,6 @@ bond_mode_8023ad_periodic_cb(void *arg) struct ether_addr slave_addr; struct rte_mbuf *lacp_pkt = NULL; - - uint8_t i, slave_id; + uint16_t slave_id; + uint16_t i; @@ -1157,5 +1157,5 @@ bond_mode_8023ad_enable(struct rte_eth_dev *bond_dev) { struct bond_dev_private *internals = bond_dev->data->dev_private; - uint8_t i; + uint16_t i; for (i = 0; i < internals->active_slave_count; i++) diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bonding/rte_eth_bond_alb.c index c3891c7e3..d3e16d4bd 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.c +++ b/drivers/net/bonding/rte_eth_bond_alb.c @@ -19,8 +19,8 @@ simple_hash(uint8_t *hash_start, int hash_size) } -static uint8_t +static uint16_t calculate_slave(struct bond_dev_private *internals) { - uint8_t idx; + uint16_t idx; idx = (internals->mode6.last_slave + 1) % internals->active_slave_count; diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index b55752ed3..a23988dc7 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -77,5 +77,5 @@ activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { struct bond_dev_private *internals = eth_dev->data->dev_private; - uint8_t active_count = internals->active_slave_count; + uint16_t active_count = internals->active_slave_count; if (internals->mode == BONDING_MODE_8023AD) @@ -797,5 +797,5 @@ rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], { struct bond_dev_private *internals; - uint8_t i; + uint16_t i; if (valid_bonded_port_id(bonded_port_id) != 0) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index df0a3b419..bbe2568cd 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -354,5 +354,5 @@ bond_ethdev_tx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, for (i = 0; i < nb_bufs; i++) { /* Populate slave mbuf arrays with mbufs for that slave. */ - uint8_t slave_idx = bufs_slave_port_idxs[i]; + uint16_t slave_idx = bufs_slave_port_idxs[i]; slave_bufs[slave_idx][slave_nb_bufs[slave_idx]++] = bufs[i]; @@ -405,6 +405,7 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint8_t collecting; /* current slave collecting status */ const uint8_t promisc = internals->promiscuous_en; - uint8_t i, j, k; uint8_t subtype; + uint8_t j, k; + uint16_t i; /* Copy slave list to protect against slave up/down changes during tx @@ -775,5 +776,5 @@ ipv6_hash(struct ipv6_hdr *ipv6_hdr) void burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts, - uint8_t slave_count, uint16_t *slaves) + uint16_t slave_count, uint16_t *slaves) { struct ether_hdr *eth_hdr; @@ -792,5 +793,5 @@ burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts, void burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts, - uint8_t slave_count, uint16_t *slaves) + uint16_t slave_count, uint16_t *slaves) { uint16_t i; @@ -830,5 +831,5 @@ burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts, void burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, - uint8_t slave_count, uint16_t *slaves) + uint16_t slave_count, uint16_t *slaves) { struct ether_hdr *eth_hdr; @@ -900,5 +901,5 @@ struct bwg_slave { uint64_t bwg_left_int; uint64_t bwg_left_remainder; - uint8_t slave; + uint16_t slave; }; @@ -953,9 +954,10 @@ bond_ethdev_update_tlb_slave_cb(void *arg) struct rte_eth_stats slave_stats; struct bwg_slave bwg_array[RTE_MAX_ETHPORTS]; - uint8_t slave_count; + uint16_t slave_count; uint64_t tx_bytes; uint8_t update_stats = 0; - uint8_t i, slave_id; + uint16_t slave_id; + uint16_t i; internals->slave_update_idx++; @@ -1244,5 +1246,5 @@ bond_ethdev_tx_burst_balance(void *queue, struct rte_mbuf **bufs, for (i = 0; i < nb_bufs; i++) { /* Populate slave mbuf arrays with mbufs for that slave. */ - uint8_t slave_idx = bufs_slave_port_idxs[i]; + uint16_t slave_idx = bufs_slave_port_idxs[i]; slave_bufs[slave_idx][slave_nb_bufs[slave_idx]++] = bufs[i]; @@ -1355,5 +1357,5 @@ bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, * slave */ - uint8_t slave_idx = bufs_slave_port_idxs[i]; + uint16_t slave_idx = bufs_slave_port_idxs[i]; slave_bufs[slave_idx][slave_nb_bufs[slave_idx]++] = @@ -1397,6 +1399,7 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs, struct bond_tx_queue *bd_tx_q; - uint8_t tx_failed_flag = 0, num_of_slaves; uint16_t slaves[RTE_MAX_ETHPORTS]; + uint8_t tx_failed_flag = 0; + uint16_t num_of_slaves; uint16_t max_nb_of_tx_pkts = 0; @@ -1949,5 +1952,5 @@ slave_remove(struct bond_dev_private *internals, struct rte_eth_dev *slave_eth_dev) { - uint8_t i; + uint16_t i; for (i = 0; i < internals->slave_count; i++) @@ -2148,5 +2151,5 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) { struct bond_dev_private *internals = eth_dev->data->dev_private; - uint8_t i; + uint16_t i; if (internals->mode == BONDING_MODE_8023AD) { @@ -2244,5 +2247,5 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) if (internals->slave_count > 0) { struct rte_eth_dev_info slave_info; - uint8_t idx; + uint16_t idx; for (idx = 0; idx < internals->slave_count; idx++) { @@ -2657,7 +2660,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, int rc = -1; - int i, valid_slave = 0; - uint8_t active_pos; uint8_t lsc_flag = 0; + int valid_slave = 0; + uint16_t active_pos; + uint16_t i; if (type != RTE_ETH_EVENT_INTR_LSC || param == NULL) diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h index 032ffed02..8afef39ba 100644 --- a/drivers/net/bonding/rte_eth_bond_private.h +++ b/drivers/net/bonding/rte_eth_bond_private.h @@ -101,5 +101,5 @@ struct rte_flow { typedef void (*burst_xmit_hash_t)(struct rte_mbuf **buf, uint16_t nb_pkts, - uint8_t slave_count, uint16_t *slaves); + uint16_t slave_count, uint16_t *slaves); /** Link Bonding PMD device private configuration Structure */ @@ -257,13 +257,13 @@ slave_add(struct bond_dev_private *internals, void burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts, - uint8_t slave_count, uint16_t *slaves); + uint16_t slave_count, uint16_t *slaves); void burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts, - uint8_t slave_count, uint16_t *slaves); + uint16_t slave_count, uint16_t *slaves); void burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, - uint8_t slave_count, uint16_t *slaves); + uint16_t slave_count, uint16_t *slaves); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-04-16 15:34:27.020153420 +0100 +++ 0041-net-bonding-fix-slave-id-types.patch 2019-04-16 15:34:25.199179528 +0100 @@ -1,13 +1,14 @@ -From 1d6cab8a91ba461b6a223f98a527d81182c9a6d2 Mon Sep 17 00:00:00 2001 +From a48b960a6d4c325a62c6480fe1e4311423c353b0 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Wed, 20 Mar 2019 12:47:20 +0100 Subject: [PATCH] net/bonding: fix slave id types +[ upstream commit 1d6cab8a91ba461b6a223f98a527d81182c9a6d2 ] + Caught by code review, with port id conversion to 16bits, the slave id have been extended to 16bits as well (both slave index and count). Fixes: f8244c6399d9 ("ethdev: increase port id range") -Cc: stable@dpdk.org Signed-off-by: David Marchand Reviewed-by: Ferruh Yigit