From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 95BB54CB3 for ; Tue, 14 Aug 2018 13:07:07 +0200 (CEST) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=lap.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fpXAJ-0000wO-Fq; Tue, 14 Aug 2018 11:07:07 +0000 From: Christian Ehrhardt To: Konstantin Ananyev Cc: Bernard Iremonger , dpdk stable Date: Tue, 14 Aug 2018 13:06:12 +0200 Message-Id: <20180814110651.25277-9-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180814110651.25277-1-christian.ehrhardt@canonical.com> References: <20180814110651.25277-1-christian.ehrhardt@canonical.com> Subject: [dpdk-stable] patch 'app/testpmd: fix DCB config' has been queued to stable release 18.05.1 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: , X-List-Received-Date: Tue, 14 Aug 2018 11:07:07 -0000 Hi, FYI, your patch has been queued to stable release 18.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/16/18. So please shout if anyone has objections. Thanks. Christian Ehrhardt --- >>From 19ded3d093f8488083f18e7edde4c885d8a0f7b9 Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Tue, 31 Jul 2018 15:43:34 +0100 Subject: [PATCH] app/testpmd: fix DCB config [ upstream commit ac7c491c3fecb835d637e867467dcf7cc8736828 ] After adding RSS hash offload check, default rss_hf will fail on devices that do not support all bits. This will lead to dcb config failure. The patch fixes this issue by reading current valid rss_conf from the device. Fixes: 8863a1fbfc66 ("ethdev: add supported hash function check") Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic class") Signed-off-by: Konstantin Ananyev Acked-by: Bernard Iremonger --- app/test-pmd/testpmd.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index acdce2a01..e35603de5 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2454,12 +2454,14 @@ const uint16_t vlan_tags[] = { }; static int -get_eth_dcb_conf(struct rte_eth_conf *eth_conf, +get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf, enum dcb_mode_enable dcb_mode, enum rte_eth_nb_tcs num_tcs, uint8_t pfc_en) { uint8_t i; + int32_t rc; + struct rte_eth_rss_conf rss_conf; /* * Builds up the correct configuration for dcb+vt based on the vlan tags array @@ -2499,6 +2501,10 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct rte_eth_dcb_tx_conf *tx_conf = ð_conf->tx_adv_conf.dcb_tx_conf; + rc = rte_eth_dev_rss_hash_conf_get(pid, &rss_conf); + if (rc != 0) + return rc; + rx_conf->nb_tcs = num_tcs; tx_conf->nb_tcs = num_tcs; @@ -2506,8 +2512,9 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, rx_conf->dcb_tc[i] = i % num_tcs; tx_conf->dcb_tc[i] = i % num_tcs; } + eth_conf->rxmode.mq_mode = ETH_MQ_RX_DCB_RSS; - eth_conf->rx_adv_conf.rss_conf.rss_hf = rss_hf; + eth_conf->rx_adv_conf.rss_conf = rss_conf; eth_conf->txmode.mq_mode = ETH_MQ_TX_DCB; } @@ -2541,7 +2548,7 @@ init_port_dcb_config(portid_t pid, port_conf.txmode = rte_port->dev_conf.txmode; /*set configuration of DCB in vt mode and DCB in non-vt mode*/ - retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en); + retval = get_eth_dcb_conf(pid, &port_conf, dcb_mode, num_tcs, pfc_en); if (retval < 0) return retval; port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; -- 2.17.1