patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [DPDK] app/testpmd: fix offloads overwrite by default configuration
@ 2019-05-05  8:19 wei zhao
  0 siblings, 0 replies; 2+ messages in thread
From: wei zhao @ 2019-05-05  8:19 UTC (permalink / raw)
  To: qabuild; +Cc: wei zhao, stable

There is an error in function rxtx_port_config(), which may overwrite
offloads configuration get from function launch_args_parse() when run
testpmd app. So rxtx_port_config() should do "or" for port offloads.

Fixes: d44f8a485f5d ("app/testpmd: enable per queue configure")
cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
 app/test-pmd/testpmd.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 6fbfd29..4e71e85 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2809,9 +2809,17 @@ static void
 rxtx_port_config(struct rte_port *port)
 {
 	uint16_t qid;
+	struct rte_eth_rxconf *rxconf = &port->dev_info.default_rxconf;
+	struct rte_eth_txconf *txconf = &port->dev_info.default_txconf;
 
 	for (qid = 0; qid < nb_rxq; qid++) {
-		port->rx_conf[qid] = port->dev_info.default_rxconf;
+		port->rx_conf[qid] = (struct rte_eth_rxconf){
+			.rx_thresh = rxconf->rx_thresh,
+			.rx_drop_en = rxconf->rx_drop_en,
+			.rx_free_thresh = rxconf->rx_free_thresh,
+			.rx_deferred_start = rxconf->rx_deferred_start,
+		};
+		port->rx_conf[qid].offloads |= rxconf->offloads;
 
 		/* Check if any Rx parameters have been passed */
 		if (rx_pthresh != RTE_PMD_PARAM_UNSET)
@@ -2833,7 +2841,13 @@ rxtx_port_config(struct rte_port *port)
 	}
 
 	for (qid = 0; qid < nb_txq; qid++) {
-		port->tx_conf[qid] = port->dev_info.default_txconf;
+		port->tx_conf[qid] = (struct rte_eth_txconf){
+			.tx_thresh = txconf->tx_thresh,
+			.tx_rs_thresh = txconf->tx_rs_thresh,
+			.tx_free_thresh = txconf->tx_free_thresh,
+			.tx_deferred_start = txconf->tx_deferred_start,
+		};
+		port->tx_conf[qid].offloads |= txconf->offloads;
 
 		/* Check if any Tx parameters have been passed */
 		if (tx_pthresh != RTE_PMD_PARAM_UNSET)
-- 
2.7.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dpdk-stable] [DPDK] app/testpmd: fix offloads overwrite by default configuration
@ 2019-05-05  8:19 wei zhao
  0 siblings, 0 replies; 2+ messages in thread
From: wei zhao @ 2019-05-05  8:19 UTC (permalink / raw)
  To: qabuild; +Cc: wei zhao, stable

There is an error in function rxtx_port_config(), which may overwrite
offloads configuration get from function launch_args_parse() when run
testpmd app. So rxtx_port_config() should do "or" for port offloads.

Fixes: d44f8a485f5d ("app/testpmd: enable per queue configure")
cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
 app/test-pmd/testpmd.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 6fbfd29..4e71e85 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2809,9 +2809,17 @@ static void
 rxtx_port_config(struct rte_port *port)
 {
 	uint16_t qid;
+	struct rte_eth_rxconf *rxconf = &port->dev_info.default_rxconf;
+	struct rte_eth_txconf *txconf = &port->dev_info.default_txconf;
 
 	for (qid = 0; qid < nb_rxq; qid++) {
-		port->rx_conf[qid] = port->dev_info.default_rxconf;
+		port->rx_conf[qid] = (struct rte_eth_rxconf){
+			.rx_thresh = rxconf->rx_thresh,
+			.rx_drop_en = rxconf->rx_drop_en,
+			.rx_free_thresh = rxconf->rx_free_thresh,
+			.rx_deferred_start = rxconf->rx_deferred_start,
+		};
+		port->rx_conf[qid].offloads |= rxconf->offloads;
 
 		/* Check if any Rx parameters have been passed */
 		if (rx_pthresh != RTE_PMD_PARAM_UNSET)
@@ -2833,7 +2841,13 @@ rxtx_port_config(struct rte_port *port)
 	}
 
 	for (qid = 0; qid < nb_txq; qid++) {
-		port->tx_conf[qid] = port->dev_info.default_txconf;
+		port->tx_conf[qid] = (struct rte_eth_txconf){
+			.tx_thresh = txconf->tx_thresh,
+			.tx_rs_thresh = txconf->tx_rs_thresh,
+			.tx_free_thresh = txconf->tx_free_thresh,
+			.tx_deferred_start = txconf->tx_deferred_start,
+		};
+		port->tx_conf[qid].offloads |= txconf->offloads;
 
 		/* Check if any Tx parameters have been passed */
 		if (tx_pthresh != RTE_PMD_PARAM_UNSET)
-- 
2.7.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-05  8:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-05  8:19 [dpdk-stable] [DPDK] app/testpmd: fix offloads overwrite by default configuration wei zhao
2019-05-05  8:19 wei zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).