DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jijiang Liu <jijiang.liu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 5/6] i40e:support GRE tunnel TX checksum offload
Date: Mon, 26 Jan 2015 11:43:24 +0800	[thread overview]
Message-ID: <1422243805-10906-6-git-send-email-jijiang.liu@intel.com> (raw)
In-Reply-To: <1422243805-10906-1-git-send-email-jijiang.liu@intel.com>

Support NVGRE TX checksum offload, which includes
  - outer L3(IP) checksum offload
  - inner L3(IP) checksum offload
  - inner L4(UDP, TCP and SCTP) checksum offload

In addition, for GRE packet, the L4 tunnel type should be I40E_TXD_CTX_GRE_TUNNELING. 

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
---
 lib/librte_pmd_i40e/i40e_rxtx.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.c
index 2beae3c..6c1e324 100644
--- a/lib/librte_pmd_i40e/i40e_rxtx.c
+++ b/lib/librte_pmd_i40e/i40e_rxtx.c
@@ -476,8 +476,15 @@ i40e_txd_enable_checksum(uint64_t ol_flags,
 		return;
 	}
 
-	/* UDP tunneling packet TX checksum offload */
-	if (unlikely(ol_flags & PKT_TX_UDP_TUNNEL_PKT)) {
+	/* UDP/GRE tunneling packet TX checksum offload */
+	if (unlikely(ol_flags & (PKT_TX_UDP_TUNNEL_PKT |
+			PKT_TX_GRE_TUNNEL_PKT))) {
+		uint32_t tunnel_flag;
+
+		if (ol_flags & PKT_TX_UDP_TUNNEL_PKT)
+			tunnel_flag = I40E_TXD_CTX_UDP_TUNNELING;
+		else
+			tunnel_flag = I40E_TXD_CTX_GRE_TUNNELING;
 
 		*td_offset |= (outer_l2_len >> 1)
 				<< I40E_TX_DESC_LENGTH_MACLEN_SHIFT;
@@ -492,7 +499,7 @@ i40e_txd_enable_checksum(uint64_t ol_flags,
 		/* Now set the ctx descriptor fields */
 		*cd_tunneling |= (outer_l3_len >> 2) <<
 				I40E_TXD_CTX_QW0_EXT_IPLEN_SHIFT |
-				I40E_TXD_CTX_UDP_TUNNELING |
+				tunnel_flag |
 				(l2_len >> 1) <<
 				I40E_TXD_CTX_QW0_NATLEN_SHIFT;
 
-- 
1.7.7.6

  parent reply	other threads:[~2015-01-26  3:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-26  3:43 [dpdk-dev] [PATCH 0/6] Support NVGRE on i40e Jijiang Liu
2015-01-26  3:43 ` [dpdk-dev] [PATCH 1/6] librte_ether:add NVGRE header Jijiang Liu
2015-01-26  3:43 ` [dpdk-dev] [PATCH 2/6] i40e:support RX tunnel filter for NVGRE packet Jijiang Liu
2015-01-26  3:43 ` [dpdk-dev] [PATCH 3/6] app/testpmd:test " Jijiang Liu
2015-01-26  3:43 ` [dpdk-dev] [PATCH 4/6] mbuf:add a GRE TX tunnel ol_flag Jijiang Liu
2015-01-26  3:43 ` Jijiang Liu [this message]
2015-01-26  3:43 ` [dpdk-dev] [PATCH 6/6] app/testpmd:test NVGRE Tx checksum offload Jijiang Liu
2015-01-27  5:46 ` [dpdk-dev] [PATCH 0/6] Support NVGRE on i40e Cao, Min
2015-01-28 11:08   ` Olivier MATZ

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=1422243805-10906-6-git-send-email-jijiang.liu@intel.com \
    --to=jijiang.liu@intel.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).