DPDK patches and discussions
 help / color / mirror / Atom feed
From: Alejandro Lucero <alejandro.lucero@netronome.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/3] nfp: clean tx descriptor flags
Date: Tue, 21 Mar 2017 10:43:19 +0000	[thread overview]
Message-ID: <1490093001-15710-1-git-send-email-alejandro.lucero@netronome.com> (raw)

When LSO, not doing this can led to firmware disruption. It does
not show as error because TCP ends up sending data again later on.

Fixes: 9ba3d0ae2090 (\"net/nfp: add TSO support\")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_net.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index f8ed976..9d9420d 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1660,16 +1660,22 @@ static void nfp_net_read_mac(struct nfp_net_hw *hw)
 	struct nfp_net_hw *hw = txq->hw;
 
 	if (!(hw->cap & NFP_NET_CFG_CTRL_LSO))
-		return;
+		goto clean_txd;
 
 	ol_flags = mb->ol_flags;
 
 	if (!(ol_flags & PKT_TX_TCP_SEG))
-		return;
+		goto clean_txd;
 
 	txd->l4_offset = mb->l2_len + mb->l3_len + mb->l4_len;
 	txd->lso = rte_cpu_to_le_16(mb->tso_segsz);
-	txd->flags |= PCIE_DESC_TX_LSO;
+	txd->flags = PCIE_DESC_TX_LSO;
+	return;
+
+clean_txd:
+	txd->flags = 0;
+	txd->l4_offset = 0;
+	txd->lso = 0;
 }
 
 /* nfp_net_tx_cksum - Set TX CSUM offload flags in TX descriptor */
-- 
1.9.1

             reply	other threads:[~2017-03-21 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 10:43 Alejandro Lucero [this message]
2017-03-21 10:43 ` [dpdk-dev] [PATCH 2/3] nfp: fix problem with pkt_len to data_len conversion Alejandro Lucero
2017-03-21 10:43 ` [dpdk-dev] [PATCH 3/3] nfp: fix problem with rx interrupts Alejandro Lucero
2017-03-21 16:03 ` [dpdk-dev] [PATCH 1/3] nfp: clean tx descriptor flags Ferruh Yigit

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=1490093001-15710-1-git-send-email-alejandro.lucero@netronome.com \
    --to=alejandro.lucero@netronome.com \
    --cc=dev@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).