patches for DPDK stable branches
 help / color / mirror / Atom feed
From: wei zhao <wei.zhao1@intel.com>
To: qabuild@intel.com
Cc: wei zhao <wei.zhao1@intel.com>, stable@dpdk.org
Subject: [dpdk-stable] [DPDK 2/2] app/testpmd: fix offloads overwrite by default configuration
Date: Sun,  5 May 2019 16:33:27 +0800	[thread overview]
Message-ID: <1557045207-45779-1-git-send-email-wei.zhao1@intel.com> (raw)

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


                 reply	other threads:[~2019-05-05  9:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1557045207-45779-1-git-send-email-wei.zhao1@intel.com \
    --to=wei.zhao1@intel.com \
    --cc=qabuild@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).