DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v8 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load
Date: Wed,  9 Mar 2016 11:35:13 +0800	[thread overview]
Message-ID: <1457494514-5862-5-git-send-email-wenzhuo.lu@intel.com> (raw)
In-Reply-To: <1457494514-5862-1-git-send-email-wenzhuo.lu@intel.com>

X550 will do VxLAN & NVGRE RX checksum off-load automatically.
This patch exposes the result of the checksum off-load.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c |  4 ++++
 drivers/net/ixgbe/ixgbe_rxtx.c   | 11 ++++++++++-
 lib/librte_ether/rte_ethdev.h    |  1 +
 lib/librte_mbuf/rte_mbuf.c       |  2 +-
 lib/librte_mbuf/rte_mbuf.h       |  2 +-
 5 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 25e2e38..4722ea4 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2799,6 +2799,10 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	    !RTE_ETH_DEV_SRIOV(dev).active)
 		dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_TCP_LRO;
 
+	if (hw->mac.type == ixgbe_mac_X550 ||
+	    hw->mac.type == ixgbe_mac_X550EM_x)
+		dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
+
 	dev_info->tx_offload_capa =
 		DEV_TX_OFFLOAD_VLAN_INSERT |
 		DEV_TX_OFFLOAD_IPV4_CKSUM  |
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index e95e6b7..6b913ee 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -1003,6 +1003,8 @@ rx_desc_status_to_pkt_flags(uint32_t rx_status)
 static inline uint64_t
 rx_desc_error_to_pkt_flags(uint32_t rx_status)
 {
+	uint64_t pkt_flags;
+
 	/*
 	 * Bit 31: IPE, IPv4 checksum error
 	 * Bit 30: L4I, L4I integrity error
@@ -1011,8 +1013,15 @@ rx_desc_error_to_pkt_flags(uint32_t rx_status)
 		0,  PKT_RX_L4_CKSUM_BAD, PKT_RX_IP_CKSUM_BAD,
 		PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD
 	};
-	return error_to_pkt_flags_map[(rx_status >>
+	pkt_flags = error_to_pkt_flags_map[(rx_status >>
 		IXGBE_RXDADV_ERR_CKSUM_BIT) & IXGBE_RXDADV_ERR_CKSUM_MSK];
+
+	if ((rx_status & IXGBE_RXD_STAT_OUTERIPCS) &&
+	    (rx_status & IXGBE_RXDADV_ERR_OUTERIPER)) {
+		pkt_flags |= PKT_RX_EIP_CKSUM_BAD;
+	}
+
+	return pkt_flags;
 }
 
 /*
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 377dbe7..1c6c7d7 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -810,6 +810,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_TCP_CKSUM   0x00000008
 #define DEV_RX_OFFLOAD_TCP_LRO     0x00000010
 #define DEV_RX_OFFLOAD_QINQ_STRIP  0x00000020
+#define DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040
 
 /**
  * TX offload capabilities of a device.
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index c18b438..dc0467c 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -253,7 +253,7 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask)
 	case PKT_RX_FDIR: return "PKT_RX_FDIR";
 	case PKT_RX_L4_CKSUM_BAD: return "PKT_RX_L4_CKSUM_BAD";
 	case PKT_RX_IP_CKSUM_BAD: return "PKT_RX_IP_CKSUM_BAD";
-	/* case PKT_RX_EIP_CKSUM_BAD: return "PKT_RX_EIP_CKSUM_BAD"; */
+	case PKT_RX_EIP_CKSUM_BAD: return "PKT_RX_EIP_CKSUM_BAD";
 	/* case PKT_RX_OVERSIZE: return "PKT_RX_OVERSIZE"; */
 	/* case PKT_RX_HBUF_OVERFLOW: return "PKT_RX_HBUF_OVERFLOW"; */
 	/* case PKT_RX_RECIP_ERR: return "PKT_RX_RECIP_ERR"; */
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index c973e9b..c4e7e25 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -88,7 +88,7 @@ extern "C" {
 #define PKT_RX_FDIR          (1ULL << 2)  /**< RX packet with FDIR match indicate. */
 #define PKT_RX_L4_CKSUM_BAD  (1ULL << 3)  /**< L4 cksum of RX pkt. is not OK. */
 #define PKT_RX_IP_CKSUM_BAD  (1ULL << 4)  /**< IP cksum of RX pkt. is not OK. */
-#define PKT_RX_EIP_CKSUM_BAD (0ULL << 0)  /**< External IP header checksum error. */
+#define PKT_RX_EIP_CKSUM_BAD (1ULL << 5)  /**< External IP header checksum error. */
 #define PKT_RX_OVERSIZE      (0ULL << 0)  /**< Num of desc of an RX pkt oversize. */
 #define PKT_RX_HBUF_OVERFLOW (0ULL << 0)  /**< Header buffer overflow. */
 #define PKT_RX_RECIP_ERR     (0ULL << 0)  /**< Hardware processing error. */
-- 
1.9.3

  parent reply	other threads:[~2016-03-09  3:35 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11  7:07 [dpdk-dev] [PATCH 0/4] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-01-11  7:07 ` [dpdk-dev] [PATCH 1/4] ixgbe: support UDP tunnel add/del Wenzhuo Lu
2016-01-11  7:40   ` Vincent JARDIN
2016-01-11  8:28     ` Lu, Wenzhuo
2016-01-11  8:41       ` Vincent JARDIN
2016-01-12 12:37       ` Thomas Monjalon
2016-01-13  2:50         ` Lu, Wenzhuo
2016-03-03  6:57   ` Qiu, Michael
2016-03-03  7:14     ` Lu, Wenzhuo
2016-01-11  7:07 ` [dpdk-dev] [PATCH 2/4] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-01-11  7:07 ` [dpdk-dev] [PATCH 3/4] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-01-11  7:07 ` [dpdk-dev] [PATCH 4/4] doc: update release note for VxLAN & NVGRE checksum off-load support Wenzhuo Lu
2016-01-12 13:44   ` Mcnamara, John
2016-01-13  2:52     ` Lu, Wenzhuo
2016-01-14  1:38 ` [dpdk-dev] [PATCH v2 0/6] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-01-14  1:38   ` [dpdk-dev] [PATCH v2 1/6] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-01-14  1:38   ` [dpdk-dev] [PATCH v2 2/6] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-01-14  1:38   ` [dpdk-dev] [PATCH v2 3/6] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-01-14  1:38   ` [dpdk-dev] [PATCH v2 4/6] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-02-04 20:16     ` Ananyev, Konstantin
2016-02-15  2:15       ` Lu, Wenzhuo
2016-01-14  1:38   ` [dpdk-dev] [PATCH v2 5/6] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-02-04 18:55     ` Ananyev, Konstantin
2016-02-15  5:32       ` Lu, Wenzhuo
2016-02-15 10:03         ` Thomas Monjalon
2016-02-15 13:15           ` Ananyev, Konstantin
2016-02-17  5:47             ` Lu, Wenzhuo
2016-01-14  1:38   ` [dpdk-dev] [PATCH v2 6/6] doc: update release note for VxLAN & NVGRE checksum off-load support Wenzhuo Lu
2016-02-18  3:17 ` [dpdk-dev] [PATCH v3 0/5] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-02-18  3:17   ` [dpdk-dev] [PATCH v3 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-02-18  3:17   ` [dpdk-dev] [PATCH v3 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-02-18  3:17   ` [dpdk-dev] [PATCH v3 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-02-18  3:17   ` [dpdk-dev] [PATCH v3 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-02-18  3:17   ` [dpdk-dev] [PATCH v3 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-02-25 14:53     ` Ananyev, Konstantin
2016-02-26  1:34       ` Lu, Wenzhuo
2016-02-26  1:37       ` Lu, Wenzhuo
2016-02-26  8:35 ` [dpdk-dev] [PATCH v4 0/5] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-02-26  8:35   ` [dpdk-dev] [PATCH v4 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-02-26  8:35   ` [dpdk-dev] [PATCH v4 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-02-26  8:35   ` [dpdk-dev] [PATCH v4 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-02-26  8:35   ` [dpdk-dev] [PATCH v4 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-02-26  8:35   ` [dpdk-dev] [PATCH v4 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-03-02  6:45 ` [dpdk-dev] [PATCH v5 0/5] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-03-02  6:45   ` [dpdk-dev] [PATCH v5 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-03-02  8:56     ` Panu Matilainen
2016-03-02  6:45   ` [dpdk-dev] [PATCH v5 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-03-02  6:45   ` [dpdk-dev] [PATCH v5 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-03-02  6:45   ` [dpdk-dev] [PATCH v5 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-03-02  6:45   ` [dpdk-dev] [PATCH v5 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-03-03  1:22 ` [dpdk-dev] [PATCH v6 0/5] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-03-03  1:22   ` [dpdk-dev] [PATCH v6 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-03-03  9:51     ` Panu Matilainen
2016-03-03  1:22   ` [dpdk-dev] [PATCH v6 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-03-03  1:22   ` [dpdk-dev] [PATCH v6 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-03-03  1:22   ` [dpdk-dev] [PATCH v6 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-03-03  1:22   ` [dpdk-dev] [PATCH v6 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-03-03 18:37   ` [dpdk-dev] [PATCH v6 0/5] Support VxLAN & NVGRE checksum off-load on X550 Ananyev, Konstantin
2016-03-04  2:35 ` [dpdk-dev] [PATCH v7 " Wenzhuo Lu
2016-03-04  2:35   ` [dpdk-dev] [PATCH v7 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-03-08 23:35     ` Thomas Monjalon
2016-03-09  0:53       ` Lu, Wenzhuo
2016-03-09  1:04         ` Thomas Monjalon
2016-03-09  1:25           ` Lu, Wenzhuo
2016-03-09  2:30             ` Lu, Wenzhuo
2016-03-09  9:32             ` Thomas Monjalon
2016-03-10  0:37               ` Lu, Wenzhuo
2016-03-04  2:35   ` [dpdk-dev] [PATCH v7 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-03-04  2:35   ` [dpdk-dev] [PATCH v7 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-03-04  2:35   ` [dpdk-dev] [PATCH v7 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-03-04  2:35   ` [dpdk-dev] [PATCH v7 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu
2016-03-04  5:45   ` [dpdk-dev] [PATCH v7 0/5] Support VxLAN & NVGRE checksum off-load on X550 Liu, Yong
2016-03-04  9:24   ` Liu, Yong
2016-03-08 23:23   ` Thomas Monjalon
2016-03-09  0:33     ` Lu, Wenzhuo
2016-03-09  3:35 ` [dpdk-dev] [PATCH v8 " Wenzhuo Lu
2016-03-09  3:35   ` [dpdk-dev] [PATCH v8 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-03-09  9:48     ` Thomas Monjalon
2016-03-10  0:40       ` Lu, Wenzhuo
2016-03-09  3:35   ` [dpdk-dev] [PATCH v8 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-03-09  3:35   ` [dpdk-dev] [PATCH v8 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-03-09  3:35   ` Wenzhuo Lu [this message]
2016-03-09  3:35   ` [dpdk-dev] [PATCH v8 5/5] ixgbe: support VxLAN & NVGRE TX checksum off-load Wenzhuo Lu
2016-03-10  2:42 ` [dpdk-dev] [PATCH v9 0/5] Support VxLAN & NVGRE checksum off-load on X550 Wenzhuo Lu
2016-03-10  2:42   ` [dpdk-dev] [PATCH v9 1/5] lib/librte_ether: change function name of tunnel port config Wenzhuo Lu
2016-03-11 23:02     ` Thomas Monjalon
2016-03-10  2:42   ` [dpdk-dev] [PATCH v9 2/5] i40e: rename the tunnel port config functions Wenzhuo Lu
2016-03-10  2:42   ` [dpdk-dev] [PATCH v9 3/5] ixgbe: support UDP tunnel port config Wenzhuo Lu
2016-03-10  2:42   ` [dpdk-dev] [PATCH v9 4/5] ixgbe: support VxLAN & NVGRE RX checksum off-load Wenzhuo Lu
2016-03-10  2:42   ` [dpdk-dev] [PATCH v9 5/5] ixgbe: support VxLAN & NVGRE TX " Wenzhuo Lu

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=1457494514-5862-5-git-send-email-wenzhuo.lu@intel.com \
    --to=wenzhuo.lu@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).