[dpdk-dev] nfp: tx checksum offload fixes

Message ID 1456999706-16440-1-git-send-email-alejandro.lucero@netronome.com (mailing list archive)
State Superseded, archived
Delegated to: Bruce Richardson
Headers

Commit Message

Alejandro Lucero March 3, 2016, 10:08 a.m. UTC
  Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_net.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon March 3, 2016, 10:14 a.m. UTC | #1
Hi Alejandro,

Please start the title with a verb (fix here),
describe briefly the bug,
and add a Fixes: tag.

More info in this doc:
http://dpdk.org/doc/guides/contributing/patches.html#commit-messages-subject-line

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

Patch

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index fd4dd39..6078e9f 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -1522,7 +1522,7 @@  static inline void
 nfp_net_tx_cksum(struct nfp_net_txq *txq, struct nfp_net_tx_desc *txd,
 		 struct rte_mbuf *mb)
 {
-	uint16_t ol_flags;
+	uint64_t ol_flags;
 	struct nfp_net_hw *hw = txq->hw;
 
 	if (!(hw->cap & NFP_NET_CFG_CTRL_TXCSUM))
@@ -1543,7 +1543,8 @@  nfp_net_tx_cksum(struct nfp_net_txq *txq, struct nfp_net_tx_desc *txd,
 		break;
 	}
 
-	txd->flags |= PCIE_DESC_TX_CSUM;
+	if (ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK))
+		txd->flags |= PCIE_DESC_TX_CSUM;
 }
 
 /* nfp_net_rx_cksum - set mbuf checksum flags based on RX descriptor flags */