[dpdk-dev] [PATCH v3 3/3] app/testpmd: fix dynamic config error

Steve Yang stevex.yang at intel.com
Fri Jan 22 10:01:10 CET 2021


The offloads of 'tx/rx_conf' didn't keep up with the corresponding
offloads of 'dev_conf' if rx queue capability was 0, it would cause
the configuration invalid.

For example:
Configuring 'max-pkt-len' would change 'rx_offloads' in dev_conf while
rx_conf.offloads of each queue still kept the old value.
It would cause the failure of offloads check in 'rte_eth_rx_queue_setup'.

This patch applied tx/rx offloads configuration for each queue
once it changed and corresponding tx/rx queue capability was 0.

Fixes: 5e91aeef218c ("app/testpmd: fix offload flags after port config")

Signed-off-by: Steve Yang <stevex.yang at intel.com>
---
 app/test-pmd/testpmd.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index a2c9aad960..8307c7f9e9 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3296,7 +3296,11 @@ rxtx_port_config(struct rte_port *port)
 	for (qid = 0; qid < nb_rxq; qid++) {
 		offloads = port->rx_conf[qid].offloads;
 		port->rx_conf[qid] = port->dev_info.default_rxconf;
-		if (offloads != 0)
+		if (port->dev_info.rx_queue_offload_capa == 0 &&
+		    offloads != port->dev_conf.rxmode.offloads)
+			port->rx_conf[qid].offloads =
+				port->dev_conf.rxmode.offloads;
+		else if (offloads != 0)
 			port->rx_conf[qid].offloads = offloads;
 
 		/* Check if any Rx parameters have been passed */
@@ -3321,7 +3325,11 @@ rxtx_port_config(struct rte_port *port)
 	for (qid = 0; qid < nb_txq; qid++) {
 		offloads = port->tx_conf[qid].offloads;
 		port->tx_conf[qid] = port->dev_info.default_txconf;
-		if (offloads != 0)
+		if (port->dev_info.tx_queue_offload_capa == 0 &&
+		    offloads != port->dev_conf.txmode.offloads)
+			port->tx_conf[qid].offloads =
+				port->dev_conf.txmode.offloads;
+		else if (offloads != 0)
 			port->tx_conf[qid].offloads = offloads;
 
 		/* Check if any Tx parameters have been passed */
-- 
2.17.1



More information about the dev mailing list