From 575e0fd1a0b33b5b6c977f743fd4ba27b3523517 Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Mon, 10 Jun 2019 14:45:10 +0800 Subject: [PATCH] app/testpmd: fix offloads config There is no need to use default offloads configuration if offloads configuration has been pass down from upper layer. The default offloads are overwritten if not zero. Fixes: 5e91aeef218c ("app/testpmd: fix offload flags after port config") Cc: stable@dpdk.org Signed-off-by: Wei Zhao Reviewed-by: Ferruh Yigit --- app/test-pmd/testpmd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index c578f75e77..3ed3523b79 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2824,7 +2824,8 @@ 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; - port->rx_conf[qid].offloads |= offloads; + if (offloads != 0) + port->rx_conf[qid].offloads = offloads; /* Check if any Rx parameters have been passed */ if (rx_pthresh != RTE_PMD_PARAM_UNSET) @@ -2848,7 +2849,8 @@ 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; - port->tx_conf[qid].offloads |= offloads; + if (offloads != 0) + port->tx_conf[qid].offloads = offloads; /* Check if any Tx parameters have been passed */ if (tx_pthresh != RTE_PMD_PARAM_UNSET) -- 2.20.1