DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support
@ 2018-09-13 13:47 Jerin Jacob
  2018-09-13 13:47 ` [dpdk-dev] [PATCH 2/4] mbuf: fix Tx offload mask Jerin Jacob
                   ` (7 more replies)
  0 siblings, 8 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-09-13 13:47 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: dev, Jerin Jacob

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 app/test-pmd/config.c          | 9 +++++++++
 doc/guides/nics/features.rst   | 4 ++--
 lib/librte_ethdev/rte_ethdev.c | 1 +
 lib/librte_ethdev/rte_ethdev.h | 1 +
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 14ccd6864..c4ed8d474 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -576,6 +576,15 @@ port_offload_cap_display(portid_t port_id)
 			printf("off\n");
 	}
 
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SCTP_CKSUM) {
+		printf("RX SCTP checksum:               ");
+		if (ports[port_id].dev_conf.rxmode.offloads &
+		    DEV_RX_OFFLOAD_SCTP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
 	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM) {
 		printf("RX Outer IPv4 checksum:               ");
 		if (ports[port_id].dev_conf.rxmode.offloads &
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index cddc877d4..a98356a16 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -575,7 +575,7 @@ L4 checksum offload
 
 Supports L4 checksum offload.
 
-* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM,DEV_RX_OFFLOAD_SCTP_CKSUM``.
 * **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_L4_NO_CKSUM`` | ``PKT_TX_TCP_CKSUM`` |
@@ -583,7 +583,7 @@ Supports L4 checksum offload.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_L4_CKSUM_UNKNOWN`` |
   ``PKT_RX_L4_CKSUM_BAD`` | ``PKT_RX_L4_CKSUM_GOOD`` |
   ``PKT_RX_L4_CKSUM_NONE``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM,DEV_RX_OFFLOAD_SCTP_CKSUM``,
   ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 
 .. _nic_features_hw_timestamp:
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 4c3202505..d91870e90 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -127,6 +127,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP),
 	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
+	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 7070e9ab4..adbe936a4 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -900,6 +900,7 @@ struct rte_eth_conf {
  * No DEV_RX_OFFLOAD_CRC_STRIP flag means keep CRC
  */
 #define DEV_RX_OFFLOAD_KEEP_CRC		0x00010000
+#define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
 				 DEV_RX_OFFLOAD_TCP_CKSUM)
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev]  [PATCH 2/4] mbuf: fix Tx offload mask
  2018-09-13 13:47 [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support Jerin Jacob
@ 2018-09-13 13:47 ` Jerin Jacob
  2018-10-01 13:45   ` Ferruh Yigit
  2018-09-13 13:47 ` [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4 checksum definitions Jerin Jacob
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-09-13 13:47 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Jerin Jacob, stable, jiayu.hu

Fixes missing PKT_TX_UDP_SEG value in PKT_TX_OFFLOAD_MASK.

Fixes: 6d18505efaa6 ("vhost: support UDP Fragmentation Offload")
Cc: stable@dpdk.org
Cc: jiayu.hu@intel.com

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 lib/librte_mbuf/rte_mbuf.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 9ce5d76d7..6a5dbbc8f 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -343,7 +343,8 @@ extern "C" {
 		PKT_TX_VLAN_PKT |        \
 		PKT_TX_TUNNEL_MASK |	 \
 		PKT_TX_MACSEC |		 \
-		PKT_TX_SEC_OFFLOAD)
+		PKT_TX_SEC_OFFLOAD |	\
+		PKT_TX_UDP_SEG)
 
 /**
  * Mbuf having an external buffer attached. shinfo in mbuf must be filled.
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4 checksum definitions
  2018-09-13 13:47 [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support Jerin Jacob
  2018-09-13 13:47 ` [dpdk-dev] [PATCH 2/4] mbuf: fix Tx offload mask Jerin Jacob
@ 2018-09-13 13:47 ` Jerin Jacob
  2018-09-13 17:24   ` Shahaf Shuler
  2018-09-13 13:47 ` [dpdk-dev] [PATCH 4/4] ethdev: add Tx " Jerin Jacob
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-09-13 13:47 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz
  Cc: dev, Jerin Jacob

Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM, DEV_RX_OFFLOAD_OUTER_TCP_CKSUM
and DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM offload flags and

PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to enable outer Rx L4 checksum
offload.

# To use hardware Rx outer L4 checksum offload, the user needs to
configure DEV_RX_OFFLOAD_OUTER_* offload flags in slowpath.

# Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 app/test-pmd/config.c          | 27 +++++++++++++++++++++++++++
 doc/guides/nics/features.rst   |  3 +++
 lib/librte_ethdev/rte_ethdev.c |  3 +++
 lib/librte_ethdev/rte_ethdev.h |  9 +++++++++
 lib/librte_mbuf/rte_mbuf.c     |  2 ++
 lib/librte_mbuf/rte_mbuf.h     |  3 +++
 6 files changed, 47 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index c4ed8d474..92a177e29 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -594,6 +594,33 @@ port_offload_cap_display(portid_t port_id)
 			printf("off\n");
 	}
 
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_UDP_CKSUM) {
+		printf("RX Outer UDP checksum:               ");
+		if (ports[port_id].dev_conf.rxmode.offloads &
+		    DEV_RX_OFFLOAD_OUTER_UDP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_TCP_CKSUM) {
+		printf("RX Outer TCP checksum:               ");
+		if (ports[port_id].dev_conf.rxmode.offloads &
+		    DEV_RX_OFFLOAD_OUTER_TCP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM) {
+		printf("RX Outer SCTP checksum:               ");
+		if (ports[port_id].dev_conf.rxmode.offloads &
+		    DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
 	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {
 		printf("Large receive offload:         ");
 		if (ports[port_id].dev_conf.rxmode.offloads &
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index a98356a16..68420d196 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -638,6 +638,9 @@ Inner L4 checksum
 
 Supports inner packet L4 checksum.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM,DEV_RX_OFFLOAD_OUTER_TCP_CKSUM,DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EL4_CKSUM_BAD``.
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM,DEV_RX_OFFLOAD_OUTER_TCP_CKSUM,DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM``,
 
 .. _nic_features_packet_type_parsing:
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index d91870e90..547132a8c 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -128,6 +128,9 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(OUTER_TCP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(OUTER_SCTP_CKSUM),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index adbe936a4..4665bd6f7 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -901,6 +901,10 @@ struct rte_eth_conf {
  */
 #define DEV_RX_OFFLOAD_KEEP_CRC		0x00010000
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
+#define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM	0x00040000
+#define DEV_RX_OFFLOAD_OUTER_TCP_CKSUM	0x00080000
+#define DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM	0x00100000
+
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
 				 DEV_RX_OFFLOAD_TCP_CKSUM)
@@ -908,6 +912,11 @@ struct rte_eth_conf {
 			     DEV_RX_OFFLOAD_VLAN_FILTER | \
 			     DEV_RX_OFFLOAD_VLAN_EXTEND)
 
+#define DEV_RX_OFFLOAD_OUTER_CHECKSUM (DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | \
+				DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | \
+				DEV_RX_OFFLOAD_OUTER_TCP_CKSUM | \
+				DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM)
+
 /*
  * If new Rx offload capabilities are defined, they also must be
  * mentioned in rte_rx_offload_names in rte_ethdev.c file.
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index e714c5a59..022e92b3c 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -301,6 +301,7 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask)
 	case PKT_RX_TIMESTAMP: return "PKT_RX_TIMESTAMP";
 	case PKT_RX_SEC_OFFLOAD: return "PKT_RX_SEC_OFFLOAD";
 	case PKT_RX_SEC_OFFLOAD_FAILED: return "PKT_RX_SEC_OFFLOAD_FAILED";
+	case PKT_RX_EL4_CKSUM_BAD: return "PKT_RX_EL4_CKSUM_BAD";
 	default: return NULL;
 	}
 }
@@ -339,6 +340,7 @@ rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		{ PKT_RX_SEC_OFFLOAD, PKT_RX_SEC_OFFLOAD, NULL },
 		{ PKT_RX_SEC_OFFLOAD_FAILED, PKT_RX_SEC_OFFLOAD_FAILED, NULL },
 		{ PKT_RX_QINQ, PKT_RX_QINQ, NULL },
+		{ PKT_RX_EL4_CKSUM_BAD, PKT_RX_EL4_CKSUM_BAD, NULL },
 	};
 	const char *name;
 	unsigned int i;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 6a5dbbc8f..80989483b 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -177,6 +177,9 @@ extern "C" {
  */
 #define PKT_RX_QINQ          (1ULL << 20)
 
+/**< External/Outer Layer4 header checksum error. */
+#define PKT_RX_EL4_CKSUM_BAD (1ULL << 21)
+
 /* add new RX flags here */
 
 /* add new TX flags here */
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH 4/4] ethdev: add Tx offload outer L4 checksum definitions
  2018-09-13 13:47 [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support Jerin Jacob
  2018-09-13 13:47 ` [dpdk-dev] [PATCH 2/4] mbuf: fix Tx offload mask Jerin Jacob
  2018-09-13 13:47 ` [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4 checksum definitions Jerin Jacob
@ 2018-09-13 13:47 ` Jerin Jacob
  2018-10-01 13:45   ` Ferruh Yigit
  2018-10-01 13:45 ` [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support Ferruh Yigit
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-09-13 13:47 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz
  Cc: dev, Jerin Jacob

Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM, DEV_TX_OFFLOAD_OUTER_TCP_CKSUM
and DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM offload flags and

PKT_TX_OUTER_L4_NO_CKSUM, PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM
and PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer L4 checksum
offload.

To use hardware Tx outer L4 checksum offload, the user needs to.
# enable following in mbuff:
- fill outer_l2_len and outer_l3_len in mbuf
- set the flags PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM or
PKT_TX_OUTER_UDP_CKSUM
- set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6

# configure DEV_TX_OFFLOAD_OUTER_* offload flags in slow path.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 app/test-pmd/config.c          | 27 +++++++++++++++++++++++++++
 doc/guides/nics/features.rst   |  6 ++++++
 lib/librte_ethdev/rte_ethdev.c |  3 +++
 lib/librte_ethdev/rte_ethdev.h |  6 ++++++
 lib/librte_mbuf/rte_mbuf.c     |  5 +++++
 lib/librte_mbuf/rte_mbuf.h     | 23 ++++++++++++++++++++++-
 6 files changed, 69 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 92a177e29..85f832bf0 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -773,6 +773,33 @@ port_offload_cap_display(portid_t port_id)
 		else
 			printf("off\n");
 	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
+		printf("TX Outer UDP checksum:               ");
+		if (ports[port_id].dev_conf.txmode.offloads &
+		    DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_TCP_CKSUM) {
+		printf("TX Outer TCP checksum:               ");
+		if (ports[port_id].dev_conf.txmode.offloads &
+		    DEV_TX_OFFLOAD_OUTER_TCP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM) {
+		printf("TX Outer SCTP checksum:               ");
+		if (ports[port_id].dev_conf.txmode.offloads &
+		    DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
 }
 
 int
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 68420d196..884dbd7a5 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -639,8 +639,14 @@ Inner L4 checksum
 Supports inner packet L4 checksum.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM,DEV_RX_OFFLOAD_OUTER_TCP_CKSUM,DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM,DEV_TX_OFFLOAD_OUTER_TCP_CKSUM,DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM``.
+* **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_OUTER_IPV4`` | ``PKT_TX_OUTER_IPV6``.
+  ``mbuf.ol_flags:PKT_TX_OUTER_L4_NO_CKSUM`` | ``PKT_TX_OUTER_TCP_CKSUM`` |
+  ``PKT_TX_OUTER_SCTP_CKSUM`` | ``PKT_TX_OUTER_UDP_CKSUM``.
+* **[uses]     mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EL4_CKSUM_BAD``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM,DEV_RX_OFFLOAD_OUTER_TCP_CKSUM,DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM``,
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM,DEV_TX_OFFLOAD_OUTER_TCP_CKSUM,DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM``.
 
 .. _nic_features_packet_type_parsing:
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 547132a8c..6cc5ad055 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -160,6 +160,9 @@ static const struct {
 	RTE_TX_OFFLOAD_BIT2STR(MULTI_SEGS),
 	RTE_TX_OFFLOAD_BIT2STR(MBUF_FAST_FREE),
 	RTE_TX_OFFLOAD_BIT2STR(SECURITY),
+	RTE_TX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_TX_OFFLOAD_BIT2STR(OUTER_TCP_CKSUM),
+	RTE_TX_OFFLOAD_BIT2STR(OUTER_SCTP_CKSUM),
 };
 
 #undef RTE_TX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 4665bd6f7..a5b33a27f 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -963,6 +963,12 @@ struct rte_eth_conf {
  * for tunnel TSO.
  */
 #define DEV_TX_OFFLOAD_IP_TNL_TSO       0x00080000
+/** Device supports outer UDP checksum */
+#define DEV_TX_OFFLOAD_OUTER_UDP_CKSUM  0x00100000
+/** Device supports outer TCP checksum */
+#define DEV_TX_OFFLOAD_OUTER_TCP_CKSUM  0x00200000
+/** Device supports outer SCTP checksum */
+#define DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM 0x00400000
 
 #define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001
 /**< Device supports Rx queue setup after device started*/
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 022e92b3c..af14d9273 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -437,6 +437,11 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		  "PKT_TX_TUNNEL_NONE" },
 		{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
 		{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
+		{ PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_L4_MASK, NULL },
+		{ PKT_TX_OUTER_SCTP_CKSUM, PKT_TX_OUTER_L4_MASK, NULL },
+		{ PKT_TX_OUTER_UDP_CKSUM, PKT_TX_OUTER_L4_MASK, NULL },
+		{ PKT_TX_OUTER_L4_NO_CKSUM, PKT_TX_OUTER_L4_MASK,
+		"PKT_TX_OUTER_L4_NO_CKSUM" },
 	};
 	const char *name;
 	unsigned int i;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 80989483b..541521d7d 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -184,6 +184,26 @@ extern "C" {
 
 /* add new TX flags here */
 
+/**
+ * Bits 40+41 used for outer L4 packet type with checksum enabled: 00: Reserved,
+ * 01: Outer TCP checksum, 10: Outer SCTP checksum, 11: Outer UDP checksum.
+ * To use hardware outer L4 checksum offload, the user needs to:
+ *  - fill outer_l2_len and outer_l3_len in mbuf
+ *  - set the flags PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM or
+ *  PKT_TX_OUTER_UDP_CKSUM
+ *  - set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6
+ */
+#define PKT_TX_OUTER_L4_NO_CKSUM   (0ULL << 40)
+/**< Disable Outer L4 cksum of TX pkt. */
+#define PKT_TX_OUTER_TCP_CKSUM     (1ULL << 40)
+/**< Outer TCP cksum of TX pkt. computed by NIC. */
+#define PKT_TX_OUTER_SCTP_CKSUM    (2ULL << 40)
+/**< Outer SCTP cksum of TX pkt. computed by NIC. */
+#define PKT_TX_OUTER_UDP_CKSUM     (3ULL << 40)
+/**< Outer UDP cksum of TX pkt. computed by NIC. */
+#define PKT_TX_OUTER_L4_MASK       (3ULL << 40)
+/**< Mask for Outer L4 cksum offload request. */
+
 /**
  * UDP Fragmentation Offload flag. This flag is used for enabling UDP
  * fragmentation in SW or in HW. When use UFO, mbuf->tso_segsz is used
@@ -347,7 +367,8 @@ extern "C" {
 		PKT_TX_TUNNEL_MASK |	 \
 		PKT_TX_MACSEC |		 \
 		PKT_TX_SEC_OFFLOAD |	\
-		PKT_TX_UDP_SEG)
+		PKT_TX_UDP_SEG |	\
+		PKT_TX_OUTER_L4_MASK)
 
 /**
  * Mbuf having an external buffer attached. shinfo in mbuf must be filled.
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4 checksum definitions
  2018-09-13 13:47 ` [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4 checksum definitions Jerin Jacob
@ 2018-09-13 17:24   ` Shahaf Shuler
  2018-09-14  3:05     ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Shahaf Shuler @ 2018-09-13 17:24 UTC (permalink / raw)
  To: Jerin Jacob, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	John McNamara, Marko Kovacevic, Thomas Monjalon, Ferruh Yigit,
	Andrew Rybchenko, Olivier Matz
  Cc: dev

Thursday, September 13, 2018 4:47 PM, Jerin Jacob:
> Subject: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4 checksum
> definitions
> 
> Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM,
> DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and
> DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM offload flags and

Out of curiosity, which TCP based tunnels you target with this current patchset? 

> 
> PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to enable outer Rx L4 checksum
> offload.
> 
> # To use hardware Rx outer L4 checksum offload, the user needs to
> configure DEV_RX_OFFLOAD_OUTER_* offload flags in slowpath.
> 
> # Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum
> failure similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4 checksum definitions
  2018-09-13 17:24   ` Shahaf Shuler
@ 2018-09-14  3:05     ` Jerin Jacob
  2018-09-16  5:53       ` Shahaf Shuler
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-09-14  3:05 UTC (permalink / raw)
  To: Shahaf Shuler
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz, dev

-----Original Message-----
> Date: Thu, 13 Sep 2018 17:24:26 +0000
> From: Shahaf Shuler <shahafs@mellanox.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>  Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>  <ferruh.yigit@intel.com>, Andrew Rybchenko <arybchenko@solarflare.com>,
>  Olivier Matz <olivier.matz@6wind.com>
> CC: "dev@dpdk.org" <dev@dpdk.org>
> Subject: RE: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4
>  checksum definitions
> 
> 
> Thursday, September 13, 2018 4:47 PM, Jerin Jacob:
> > Subject: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4 checksum
> > definitions
> >
> > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM,
> > DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and
> > DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM offload flags and
> 
> Out of curiosity, which TCP based tunnels you target with this current patchset?

I am not aware of any _popular_/_non proprietary_  protocols except SSTP for VPN.


> 
> >
> > PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to enable outer Rx L4 checksum
> > offload.
> >
> > # To use hardware Rx outer L4 checksum offload, the user needs to
> > configure DEV_RX_OFFLOAD_OUTER_* offload flags in slowpath.
> >
> > # Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum
> > failure similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4 checksum definitions
  2018-09-14  3:05     ` Jerin Jacob
@ 2018-09-16  5:53       ` Shahaf Shuler
  2018-09-16  9:32         ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Shahaf Shuler @ 2018-09-16  5:53 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz, dev

Friday, September 14, 2018 6:06 AM, Jerin Jacob:
> Subject: Re: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4
> checksum definitions
> 
> -----Original Message-----
> > Date: Thu, 13 Sep 2018 17:24:26 +0000
> > From: Shahaf Shuler <shahafs@mellanox.com>
> > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
> > <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
> > Iremonger <bernard.iremonger@intel.com>, John McNamara
> > <john.mcnamara@intel.com>, Marko Kovacevic
> > <marko.kovacevic@intel.com>,  Thomas Monjalon
> <thomas@monjalon.net>,
> > Ferruh Yigit  <ferruh.yigit@intel.com>, Andrew Rybchenko
> > <arybchenko@solarflare.com>,  Olivier Matz <olivier.matz@6wind.com>
> > CC: "dev@dpdk.org" <dev@dpdk.org>
> > Subject: RE: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4
> > checksum definitions
> >
> >
> > Thursday, September 13, 2018 4:47 PM, Jerin Jacob:
> > > Subject: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4
> > > checksum definitions
> > >
> > > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM,
> > > DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and
> DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM
> > > offload flags and
> >
> > Out of curiosity, which TCP based tunnels you target with this current
> patchset?
> 
> I am not aware of any _popular_/_non proprietary_  protocols except SSTP
> for VPN.

And your device can support such protocol inner and outer checksum check?
>From what I see the inner packet of SSTP is encrypted by SSL.

So for outer and inner checksum validation device will need to:
1. compute the outer TCP checksum
2. if valid decrypt the inner PPP packet
3. compute the PPP checksum. 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4 checksum definitions
  2018-09-16  5:53       ` Shahaf Shuler
@ 2018-09-16  9:32         ` Jerin Jacob
  0 siblings, 0 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-09-16  9:32 UTC (permalink / raw)
  To: Shahaf Shuler
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz, dev

-----Original Message-----
> Date: Sun, 16 Sep 2018 05:53:30 +0000
> From: Shahaf Shuler <shahafs@mellanox.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>  Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>  <ferruh.yigit@intel.com>, Andrew Rybchenko <arybchenko@solarflare.com>,
>  Olivier Matz <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>
> Subject: RE: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4
>  checksum definitions
> 
> Friday, September 14, 2018 6:06 AM, Jerin Jacob:
> > Subject: Re: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4
> > checksum definitions
> >
> > -----Original Message-----
> > > Date: Thu, 13 Sep 2018 17:24:26 +0000
> > > From: Shahaf Shuler <shahafs@mellanox.com>
> > > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
> > > <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
> > > Iremonger <bernard.iremonger@intel.com>, John McNamara
> > > <john.mcnamara@intel.com>, Marko Kovacevic
> > > <marko.kovacevic@intel.com>,  Thomas Monjalon
> > <thomas@monjalon.net>,
> > > Ferruh Yigit  <ferruh.yigit@intel.com>, Andrew Rybchenko
> > > <arybchenko@solarflare.com>,  Olivier Matz <olivier.matz@6wind.com>
> > > CC: "dev@dpdk.org" <dev@dpdk.org>
> > > Subject: RE: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4
> > > checksum definitions
> > >
> > >
> > > Thursday, September 13, 2018 4:47 PM, Jerin Jacob:
> > > > Subject: [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4
> > > > checksum definitions
> > > >
> > > > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM,
> > > > DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and
> > DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM
> > > > offload flags and
> > >
> > > Out of curiosity, which TCP based tunnels you target with this current
> > patchset?
> >
> > I am not aware of any _popular_/_non proprietary_  protocols except SSTP
> > for VPN.
> 
> And your device can support such protocol inner and outer checksum check?

Yes for TCP/UDP/SCTP.

> From what I see the inner packet of SSTP is encrypted by SSL.
> 
> So for outer and inner checksum validation device will need to:
> 1. compute the outer TCP checksum
> 2. if valid decrypt the inner PPP packet
> 3. compute the PPP checksum.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 2/4] mbuf: fix Tx offload mask
  2018-09-13 13:47 ` [dpdk-dev] [PATCH 2/4] mbuf: fix Tx offload mask Jerin Jacob
@ 2018-10-01 13:45   ` Ferruh Yigit
  2018-10-01 15:53     ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-01 13:45 UTC (permalink / raw)
  To: Jerin Jacob, Olivier Matz; +Cc: dev, stable, jiayu.hu

On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> Fixes missing PKT_TX_UDP_SEG value in PKT_TX_OFFLOAD_MASK.
> 
> Fixes: 6d18505efaa6 ("vhost: support UDP Fragmentation Offload")
> Cc: stable@dpdk.org
> Cc: jiayu.hu@intel.com
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
>  lib/librte_mbuf/rte_mbuf.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index 9ce5d76d7..6a5dbbc8f 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -343,7 +343,8 @@ extern "C" {
>  		PKT_TX_VLAN_PKT |        \
>  		PKT_TX_TUNNEL_MASK |	 \
>  		PKT_TX_MACSEC |		 \
> -		PKT_TX_SEC_OFFLOAD)
> +		PKT_TX_SEC_OFFLOAD |	\
> +		PKT_TX_UDP_SEG)

Also can you sort the list, it seem there was an intention to sort from high
bits to low, but broken, it makes easy to recognize missing items later.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support
  2018-09-13 13:47 [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support Jerin Jacob
                   ` (2 preceding siblings ...)
  2018-09-13 13:47 ` [dpdk-dev] [PATCH 4/4] ethdev: add Tx " Jerin Jacob
@ 2018-10-01 13:45 ` Ferruh Yigit
  2018-10-01 13:46 ` Ferruh Yigit
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-01 13:45 UTC (permalink / raw)
  To: Jerin Jacob, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	John McNamara, Marko Kovacevic, Thomas Monjalon,
	Andrew Rybchenko
  Cc: dev

On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
>  app/test-pmd/config.c          | 9 +++++++++
>  doc/guides/nics/features.rst   | 4 ++--
>  lib/librte_ethdev/rte_ethdev.c | 1 +
>  lib/librte_ethdev/rte_ethdev.h | 1 +
>  4 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 14ccd6864..c4ed8d474 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -576,6 +576,15 @@ port_offload_cap_display(portid_t port_id)
>  			printf("off\n");
>  	}
>  
> +	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SCTP_CKSUM) {
> +		printf("RX SCTP checksum:               ");

There is extra space in log, it doesn't align with other logs.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 4/4] ethdev: add Tx offload outer L4 checksum definitions
  2018-09-13 13:47 ` [dpdk-dev] [PATCH 4/4] ethdev: add Tx " Jerin Jacob
@ 2018-10-01 13:45   ` Ferruh Yigit
  2018-10-02  9:52     ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-01 13:45 UTC (permalink / raw)
  To: Jerin Jacob, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	John McNamara, Marko Kovacevic, Thomas Monjalon,
	Andrew Rybchenko, Olivier Matz
  Cc: dev

On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM, DEV_TX_OFFLOAD_OUTER_TCP_CKSUM
> and DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM offload flags and
> 
> PKT_TX_OUTER_L4_NO_CKSUM, PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM
> and PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer L4 checksum
> offload.
> 
> To use hardware Tx outer L4 checksum offload, the user needs to.
> # enable following in mbuff:
> - fill outer_l2_len and outer_l3_len in mbuf
> - set the flags PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM or
> PKT_TX_OUTER_UDP_CKSUM
> - set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6
> 
> # configure DEV_TX_OFFLOAD_OUTER_* offload flags in slow path.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
>  app/test-pmd/config.c          | 27 +++++++++++++++++++++++++++
>  doc/guides/nics/features.rst   |  6 ++++++
>  lib/librte_ethdev/rte_ethdev.c |  3 +++
>  lib/librte_ethdev/rte_ethdev.h |  6 ++++++
>  lib/librte_mbuf/rte_mbuf.c     |  5 +++++
>  lib/librte_mbuf/rte_mbuf.h     | 23 ++++++++++++++++++++++-
>  6 files changed, 69 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 92a177e29..85f832bf0 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -773,6 +773,33 @@ port_offload_cap_display(portid_t port_id)
>  		else
>  			printf("off\n");
>  	}
> +
> +	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
> +		printf("TX Outer UDP checksum:               ");
> +		if (ports[port_id].dev_conf.txmode.offloads &
> +		    DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
> +			printf("on\n");
> +		else
> +			printf("off\n");
> +	}
> +
> +	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_TCP_CKSUM) {
> +		printf("TX Outer TCP checksum:               ");
> +		if (ports[port_id].dev_conf.txmode.offloads &
> +		    DEV_TX_OFFLOAD_OUTER_TCP_CKSUM)
> +			printf("on\n");
> +		else
> +			printf("off\n");
> +	}
> +
> +	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM) {
> +		printf("TX Outer SCTP checksum:               ");
> +		if (ports[port_id].dev_conf.txmode.offloads &
> +		    DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM)
> +			printf("on\n");
> +		else
> +			printf("off\n");
> +	}
>  }

There is also "csum show", "csum set" functions, can you please check that too?
And I am not sure why those functions seems only concerned about Tx csum offloads.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support
  2018-09-13 13:47 [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support Jerin Jacob
                   ` (3 preceding siblings ...)
  2018-10-01 13:45 ` [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support Ferruh Yigit
@ 2018-10-01 13:46 ` Ferruh Yigit
  2018-10-01 15:59   ` Jerin Jacob
  2018-10-02 10:51 ` [dpdk-dev] [PATCH v2 1/2] " Jerin Jacob
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-01 13:46 UTC (permalink / raw)
  To: Jerin Jacob, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	John McNamara, Marko Kovacevic, Thomas Monjalon,
	Andrew Rybchenko
  Cc: dev

On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Overall set looks good to me, I put some comments on individual patches.

And can you please rebase on top of latest head?

Thanks,
ferruh

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 2/4] mbuf: fix Tx offload mask
  2018-10-01 13:45   ` Ferruh Yigit
@ 2018-10-01 15:53     ` Jerin Jacob
  2018-10-01 16:13       ` Ferruh Yigit
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-01 15:53 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Olivier Matz, dev, stable, jiayu.hu

-----Original Message-----
> Date: Mon, 1 Oct 2018 14:45:02 +0100
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Olivier Matz
>  <olivier.matz@6wind.com>
> CC: dev@dpdk.org, stable@dpdk.org, jiayu.hu@intel.com
> Subject: Re: [dpdk-dev] [PATCH 2/4] mbuf: fix Tx offload mask
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>  Thunderbird/52.9.1
> 
> 
> On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> > Fixes missing PKT_TX_UDP_SEG value in PKT_TX_OFFLOAD_MASK.
> >
> > Fixes: 6d18505efaa6 ("vhost: support UDP Fragmentation Offload")
> > Cc: stable@dpdk.org
> > Cc: jiayu.hu@intel.com
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > ---
> >  lib/librte_mbuf/rte_mbuf.h | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> > index 9ce5d76d7..6a5dbbc8f 100644
> > --- a/lib/librte_mbuf/rte_mbuf.h
> > +++ b/lib/librte_mbuf/rte_mbuf.h
> > @@ -343,7 +343,8 @@ extern "C" {
> >               PKT_TX_VLAN_PKT |        \
> >               PKT_TX_TUNNEL_MASK |     \
> >               PKT_TX_MACSEC |          \
> > -             PKT_TX_SEC_OFFLOAD)
> > +             PKT_TX_SEC_OFFLOAD |    \
> > +             PKT_TX_UDP_SEG)
> 
> Also can you sort the list, it seem there was an intention to sort from high
> bits to low, but broken, it makes easy to recognize missing items later.

I think, sorting from high bits to low bits makes it easy to recognize.
If it broken, How about fixing that(order based on bits) while rebasing to top of tree?

I don't have strong opinion or sorting based on bit order vs name. Just shared
my thought. Let me know your opinion, I will update it accordingly.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support
  2018-10-01 13:46 ` Ferruh Yigit
@ 2018-10-01 15:59   ` Jerin Jacob
  2018-10-01 16:11     ` Ferruh Yigit
  2018-10-02  9:13     ` Ferruh Yigit
  0 siblings, 2 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-01 15:59 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Andrew Rybchenko, dev

-----Original Message-----
> Date: Mon, 1 Oct 2018 14:46:39 +0100
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>  Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, Andrew Rybchenko
>  <arybchenko@solarflare.com>
> CC: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload
>  support
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>  Thunderbird/52.9.1
> 
> 
> On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> 
> Overall set looks good to me, I put some comments on individual patches.
> 
> And can you please rebase on top of latest head?

Sure.

Regarding space issue mentioned in other email in this thread.
It looks like similar space added in other offloads.
example: http://git.dpdk.org/dpdk/tree/app/test-pmd/config.c#n571

So, I expect no change in this patch other than rebase to latest head.
If not, let me know.

> 
> Thanks,
> ferruh
> 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support
  2018-10-01 15:59   ` Jerin Jacob
@ 2018-10-01 16:11     ` Ferruh Yigit
  2018-10-02  8:53       ` Jerin Jacob
  2018-10-02  9:13     ` Ferruh Yigit
  1 sibling, 1 reply; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-01 16:11 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Andrew Rybchenko, dev

On 10/1/2018 4:59 PM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Mon, 1 Oct 2018 14:46:39 +0100
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>>  Iremonger <bernard.iremonger@intel.com>, John McNamara
>>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>  Thomas Monjalon <thomas@monjalon.net>, Andrew Rybchenko
>>  <arybchenko@solarflare.com>
>> CC: dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload
>>  support
>> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>>  Thunderbird/52.9.1
>>
>>
>> On 9/13/2018 2:47 PM, Jerin Jacob wrote:
>>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>>
>> Overall set looks good to me, I put some comments on individual patches.
>>
>> And can you please rebase on top of latest head?
> 
> Sure.
> 
> Regarding space issue mentioned in other email in this thread.
> It looks like similar space added in other offloads.
> example: http://git.dpdk.org/dpdk/tree/app/test-pmd/config.c#n571

Hi Jerin,

This is just detail, the alignment is broken in the output of the log, for
others on/off start from column 56, for this one it is 57, just delete a space
from printf please.

> 
> So, I expect no change in this patch other than rebase to latest head.
> If not, let me know.
> 
>>
>> Thanks,
>> ferruh
>>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 2/4] mbuf: fix Tx offload mask
  2018-10-01 15:53     ` Jerin Jacob
@ 2018-10-01 16:13       ` Ferruh Yigit
  0 siblings, 0 replies; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-01 16:13 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: Olivier Matz, dev, stable, jiayu.hu

On 10/1/2018 4:53 PM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Mon, 1 Oct 2018 14:45:02 +0100
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Olivier Matz
>>  <olivier.matz@6wind.com>
>> CC: dev@dpdk.org, stable@dpdk.org, jiayu.hu@intel.com
>> Subject: Re: [dpdk-dev] [PATCH 2/4] mbuf: fix Tx offload mask
>> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>>  Thunderbird/52.9.1
>>
>>
>> On 9/13/2018 2:47 PM, Jerin Jacob wrote:
>>> Fixes missing PKT_TX_UDP_SEG value in PKT_TX_OFFLOAD_MASK.
>>>
>>> Fixes: 6d18505efaa6 ("vhost: support UDP Fragmentation Offload")
>>> Cc: stable@dpdk.org
>>> Cc: jiayu.hu@intel.com
>>>
>>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>>> ---
>>>  lib/librte_mbuf/rte_mbuf.h | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
>>> index 9ce5d76d7..6a5dbbc8f 100644
>>> --- a/lib/librte_mbuf/rte_mbuf.h
>>> +++ b/lib/librte_mbuf/rte_mbuf.h
>>> @@ -343,7 +343,8 @@ extern "C" {
>>>               PKT_TX_VLAN_PKT |        \
>>>               PKT_TX_TUNNEL_MASK |     \
>>>               PKT_TX_MACSEC |          \
>>> -             PKT_TX_SEC_OFFLOAD)
>>> +             PKT_TX_SEC_OFFLOAD |    \
>>> +             PKT_TX_UDP_SEG)
>>
>> Also can you sort the list, it seem there was an intention to sort from high
>> bits to low, but broken, it makes easy to recognize missing items later.
> 
> I think, sorting from high bits to low bits makes it easy to recognize.
> If it broken, How about fixing that(order based on bits) while rebasing to top of tree?

I am for order based on bits unless Olivier objects.

> 
> I don't have strong opinion or sorting based on bit order vs name. Just shared
> my thought. Let me know your opinion, I will update it accordingly.
> 
> 
> 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support
  2018-10-01 16:11     ` Ferruh Yigit
@ 2018-10-02  8:53       ` Jerin Jacob
  0 siblings, 0 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-02  8:53 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Andrew Rybchenko, dev

-----Original Message-----
> Date: Mon, 1 Oct 2018 17:11:50 +0100
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>  Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, Andrew Rybchenko
>  <arybchenko@solarflare.com>, dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload
>  support
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>  Thunderbird/52.9.1
> 
> On 10/1/2018 4:59 PM, Jerin Jacob wrote:
> > -----Original Message-----
> >> Date: Mon, 1 Oct 2018 14:46:39 +0100
> >> From: Ferruh Yigit <ferruh.yigit@intel.com>
> >> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
> >>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
> >>  Iremonger <bernard.iremonger@intel.com>, John McNamara
> >>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
> >>  Thomas Monjalon <thomas@monjalon.net>, Andrew Rybchenko
> >>  <arybchenko@solarflare.com>
> >> CC: dev@dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload
> >>  support
> >> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
> >>  Thunderbird/52.9.1
> >>
> >>
> >> On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> >>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> >>
> >> Overall set looks good to me, I put some comments on individual patches.
> >>
> >> And can you please rebase on top of latest head?
> >
> > Sure.
> >
> > Regarding space issue mentioned in other email in this thread.
> > It looks like similar space added in other offloads.
> > example: http://git.dpdk.org/dpdk/tree/app/test-pmd/config.c#n571
> 
> Hi Jerin,
> 
> This is just detail, the alignment is broken in the output of the log, for
> others on/off start from column 56, for this one it is 57, just delete a space
> from printf please.

Sure Ferruh. Will add it in v2

> 
> >
> > So, I expect no change in this patch other than rebase to latest head.
> > If not, let me know.
> >
> >>
> >> Thanks,
> >> ferruh
> >>
> 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support
  2018-10-01 15:59   ` Jerin Jacob
  2018-10-01 16:11     ` Ferruh Yigit
@ 2018-10-02  9:13     ` Ferruh Yigit
  1 sibling, 0 replies; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-02  9:13 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Andrew Rybchenko, dev

On 10/1/2018 4:59 PM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Mon, 1 Oct 2018 14:46:39 +0100
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>>  Iremonger <bernard.iremonger@intel.com>, John McNamara
>>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>  Thomas Monjalon <thomas@monjalon.net>, Andrew Rybchenko
>>  <arybchenko@solarflare.com>
>> CC: dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload
>>  support
>> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>>  Thunderbird/52.9.1
>>
>>
>> On 9/13/2018 2:47 PM, Jerin Jacob wrote:
>>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>>
>> Overall set looks good to me, I put some comments on individual patches.
>>
>> And can you please rebase on top of latest head?
> 
> Sure.
> 
> Regarding space issue mentioned in other email in this thread.
> It looks like similar space added in other offloads.
> example: http://git.dpdk.org/dpdk/tree/app/test-pmd/config.c#n571
> 
> So, I expect no change in this patch other than rebase to latest head.
> If not, let me know.

As commented to the patch, can you also check "csum show", "csum set" functions
in testpmd, I think they are affected and need to be updated with your patch.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH 4/4] ethdev: add Tx offload outer L4 checksum definitions
  2018-10-01 13:45   ` Ferruh Yigit
@ 2018-10-02  9:52     ` Jerin Jacob
  0 siblings, 0 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-02  9:52 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Andrew Rybchenko, Olivier Matz,
	dev, shahafs

-----Original Message-----
> Date: Mon, 1 Oct 2018 14:45:39 +0100
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>  Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, Andrew Rybchenko
>  <arybchenko@solarflare.com>, Olivier Matz <olivier.matz@6wind.com>
> CC: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 4/4] ethdev: add Tx offload outer L4
>  checksum definitions
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>  Thunderbird/52.9.1
> 
> On 9/13/2018 2:47 PM, Jerin Jacob wrote:
> > Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM, DEV_TX_OFFLOAD_OUTER_TCP_CKSUM
> > and DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM offload flags and
> >
> > PKT_TX_OUTER_L4_NO_CKSUM, PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM
> > and PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer L4 checksum
> > offload.
> >
> > To use hardware Tx outer L4 checksum offload, the user needs to.
> > # enable following in mbuff:
> > - fill outer_l2_len and outer_l3_len in mbuf
> > - set the flags PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM or
> > PKT_TX_OUTER_UDP_CKSUM
> > - set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6
> >
> > # configure DEV_TX_OFFLOAD_OUTER_* offload flags in slow path.
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > ---
> >  app/test-pmd/config.c          | 27 +++++++++++++++++++++++++++
> >  doc/guides/nics/features.rst   |  6 ++++++
> >  lib/librte_ethdev/rte_ethdev.c |  3 +++
> >  lib/librte_ethdev/rte_ethdev.h |  6 ++++++
> >  lib/librte_mbuf/rte_mbuf.c     |  5 +++++
> >  lib/librte_mbuf/rte_mbuf.h     | 23 ++++++++++++++++++++++-
> >  6 files changed, 69 insertions(+), 1 deletion(-)
> >
> > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> > index 92a177e29..85f832bf0 100644
> > --- a/app/test-pmd/config.c
> > +++ b/app/test-pmd/config.c
> > @@ -773,6 +773,33 @@ port_offload_cap_display(portid_t port_id)
> >               else
> >                       printf("off\n");
> >       }
> > +
> > +     if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
> > +             printf("TX Outer UDP checksum:               ");
> > +             if (ports[port_id].dev_conf.txmode.offloads &
> > +                 DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
> > +                     printf("on\n");
> > +             else
> > +                     printf("off\n");
> > +     }
> > +
> > +     if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_TCP_CKSUM) {
> > +             printf("TX Outer TCP checksum:               ");
> > +             if (ports[port_id].dev_conf.txmode.offloads &
> > +                 DEV_TX_OFFLOAD_OUTER_TCP_CKSUM)
> > +                     printf("on\n");
> > +             else
> > +                     printf("off\n");
> > +     }
> > +
> > +     if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM) {
> > +             printf("TX Outer SCTP checksum:               ");
> > +             if (ports[port_id].dev_conf.txmode.offloads &
> > +                 DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM)
> > +                     printf("on\n");
> > +             else
> > +                     printf("off\n");
> > +     }
> >  }
> 
> There is also "csum show", "csum set" functions, can you please check that too?

+ Shahaf

I checked the details. It is for "csumonly.c" forward engine to select
various Tx checksum in HW or SW(provide fallback SW implementation) for
testing purpose.

If I need to implement this support for this release, I will reduce the
scope to DEV_TX_OFFLOAD_OUTER_UDP_CKSUM and
DEV_RX_OFFLOAD_OUTER_UDP_CKSUM.

Since there is NO real world non encrypted TCP/SCTP based tunnel
protocols(Based on http://patches.dpdk.org/patch/44692/ discussions)
I will limit the offload definition only to DEV_?X_OFFLOAD_OUTER_UDP_CKSUM and
associated test code in "csumonly.c" forward engine in v2.

Thoughts?

I will split 1/4 and 2/4 as separate patch series and and rework 3/4 and
4/4 as separate series to make forward progress.


> And I am not sure why those functions seems only concerned about Tx csum offloads.

It does check for errors in Rx checksum too. See rx_bad_ip_csum,
rx_bad_l4_csum

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v2 1/2] ethdev: add SCTP Rx checksum offload support
  2018-09-13 13:47 [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support Jerin Jacob
                   ` (4 preceding siblings ...)
  2018-10-01 13:46 ` Ferruh Yigit
@ 2018-10-02 10:51 ` Jerin Jacob
  2018-10-02 10:51   ` [dpdk-dev] [PATCH v2 2/2] mbuf: fix Tx offload mask Jerin Jacob
  2018-10-03 18:52   ` [dpdk-dev] [PATCH v2 1/2] ethdev: add SCTP Rx checksum offload support Ferruh Yigit
  2018-10-02 19:24 ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
  2018-10-03 18:16 ` [dpdk-dev] [PATCH v3 " Jerin Jacob
  7 siblings, 2 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-02 10:51 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: dev, Jerin Jacob

Added SCTP Rx checksum offload support

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2:
- Fix printf formatting error(Ferruh Yigit)
---
 app/test-pmd/config.c          | 9 +++++++++
 doc/guides/nics/features.rst   | 4 ++--
 lib/librte_ethdev/rte_ethdev.c | 1 +
 lib/librte_ethdev/rte_ethdev.h | 1 +
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 794aa5268..1adc9b94b 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -576,6 +576,15 @@ port_offload_cap_display(portid_t port_id)
 			printf("off\n");
 	}
 
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SCTP_CKSUM) {
+		printf("RX SCTP checksum:              ");
+		if (ports[port_id].dev_conf.rxmode.offloads &
+		    DEV_RX_OFFLOAD_SCTP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
 	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM) {
 		printf("RX Outer IPv4 checksum:        ");
 		if (ports[port_id].dev_conf.rxmode.offloads &
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index b085bda86..d42489b6d 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -576,7 +576,7 @@ L4 checksum offload
 
 Supports L4 checksum offload.
 
-* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM,DEV_RX_OFFLOAD_SCTP_CKSUM``.
 * **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 * **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_IPV4`` | ``PKT_TX_IPV6``,
   ``mbuf.ol_flags:PKT_TX_L4_NO_CKSUM`` | ``PKT_TX_TCP_CKSUM`` |
@@ -584,7 +584,7 @@ Supports L4 checksum offload.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_L4_CKSUM_UNKNOWN`` |
   ``PKT_RX_L4_CKSUM_BAD`` | ``PKT_RX_L4_CKSUM_GOOD`` |
   ``PKT_RX_L4_CKSUM_NONE``.
-* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM``,
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_UDP_CKSUM,DEV_RX_OFFLOAD_TCP_CKSUM,DEV_RX_OFFLOAD_SCTP_CKSUM``,
   ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_UDP_CKSUM,DEV_TX_OFFLOAD_TCP_CKSUM,DEV_TX_OFFLOAD_SCTP_CKSUM``.
 
 .. _nic_features_hw_timestamp:
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index ef99f7068..e9a82fe7f 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -126,6 +126,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP),
 	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
+	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 012577b0a..d02db14ad 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -888,6 +888,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_TIMESTAMP	0x00004000
 #define DEV_RX_OFFLOAD_SECURITY         0x00008000
 #define DEV_RX_OFFLOAD_KEEP_CRC		0x00010000
+#define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev]  [PATCH v2 2/2] mbuf: fix Tx offload mask
  2018-10-02 10:51 ` [dpdk-dev] [PATCH v2 1/2] " Jerin Jacob
@ 2018-10-02 10:51   ` Jerin Jacob
  2018-10-04  2:31     ` Hu, Jiayu
  2018-10-03 18:52   ` [dpdk-dev] [PATCH v2 1/2] ethdev: add SCTP Rx checksum offload support Ferruh Yigit
  1 sibling, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-02 10:51 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Jerin Jacob, stable, jiayu.hu

Fixes missing PKT_TX_UDP_SEG, PKT_TX_OUTER_IPV6,PKT_TX_OUTER_IPV4,
PKT_TX_IPV6 and  PKT_TX_IPV4 values in PKT_TX_OFFLOAD_MASK.

Also sort them in bit wise order to recognize missing items later.

Fixes: 6d18505efaa6 ("vhost: support UDP Fragmentation Offload")
Fixes: 1c3b7c33e977 ("mbuf: add Tx offloading flags for tunnels")
Fixes: 711ba9e23e68 ("mbuf: remove aliasing of Tx offloading flags with Rx ones")
Cc: stable@dpdk.org
Cc: jiayu.hu@intel.com

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v2:
- Add all missing PKT_TX_ types
- Sort them in bit mask order(Ferruh Yigit)
---
 lib/librte_mbuf/rte_mbuf.h | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index a50b05c64..c8ebc3230 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -334,16 +334,21 @@ extern "C" {
  * which can be set for packet.
  */
 #define PKT_TX_OFFLOAD_MASK (    \
+		PKT_TX_OUTER_IPV6 |	 \
+		PKT_TX_OUTER_IPV4 |	 \
+		PKT_TX_OUTER_IP_CKSUM |  \
+		PKT_TX_VLAN_PKT |        \
+		PKT_TX_IPV6 |		 \
+		PKT_TX_IPV4 |		 \
 		PKT_TX_IP_CKSUM |        \
 		PKT_TX_L4_MASK |         \
-		PKT_TX_OUTER_IP_CKSUM |  \
-		PKT_TX_TCP_SEG |         \
 		PKT_TX_IEEE1588_TMST |	 \
+		PKT_TX_TCP_SEG |         \
 		PKT_TX_QINQ_PKT |        \
-		PKT_TX_VLAN_PKT |        \
 		PKT_TX_TUNNEL_MASK |	 \
 		PKT_TX_MACSEC |		 \
-		PKT_TX_SEC_OFFLOAD)
+		PKT_TX_SEC_OFFLOAD |	\
+		PKT_TX_UDP_SEG)
 
 /**
  * Mbuf having an external buffer attached. shinfo in mbuf must be filled.
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-09-13 13:47 [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support Jerin Jacob
                   ` (5 preceding siblings ...)
  2018-10-02 10:51 ` [dpdk-dev] [PATCH v2 1/2] " Jerin Jacob
@ 2018-10-02 19:24 ` Jerin Jacob
  2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx " Jerin Jacob
                     ` (5 more replies)
  2018-10-03 18:16 ` [dpdk-dev] [PATCH v3 " Jerin Jacob
  7 siblings, 6 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-02 19:24 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz
  Cc: dev, shahafs, Jerin Jacob

Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
failure.

- To use hardware Rx outer UDP checksum offload, the user needs to
configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.

- Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---

v2:
- Removed DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM
as there is no realworld use case for it.
See: http://patches.dpdk.org/patch/44692/

This patch series is depended on http://patches.dpdk.org/patch/45840/

--
 app/test-pmd/config.c          | 9 +++++++++
 doc/guides/nics/features.rst   | 3 +++
 lib/librte_ethdev/rte_ethdev.c | 1 +
 lib/librte_ethdev/rte_ethdev.h | 1 +
 lib/librte_mbuf/rte_mbuf.c     | 2 ++
 lib/librte_mbuf/rte_mbuf.h     | 3 +++
 6 files changed, 19 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1adc9b94b..d53c527e5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -594,6 +594,15 @@ port_offload_cap_display(portid_t port_id)
 			printf("off\n");
 	}
 
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_UDP_CKSUM) {
+		printf("RX Outer UDP checksum:               ");
+		if (ports[port_id].dev_conf.rxmode.offloads &
+		    DEV_RX_OFFLOAD_OUTER_UDP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
 	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {
 		printf("Large receive offload:         ");
 		if (ports[port_id].dev_conf.rxmode.offloads &
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index d42489b6d..2c2959e0b 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -639,6 +639,9 @@ Inner L4 checksum
 
 Supports inner packet L4 checksum.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EL4_CKSUM_BAD``.
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``,
 
 .. _nic_features_packet_type_parsing:
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index e9a82fe7f..a630c4fda 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -127,6 +127,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d02db14ad..821d371c3 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -889,6 +889,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SECURITY         0x00008000
 #define DEV_RX_OFFLOAD_KEEP_CRC		0x00010000
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
+#define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index e714c5a59..022e92b3c 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -301,6 +301,7 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask)
 	case PKT_RX_TIMESTAMP: return "PKT_RX_TIMESTAMP";
 	case PKT_RX_SEC_OFFLOAD: return "PKT_RX_SEC_OFFLOAD";
 	case PKT_RX_SEC_OFFLOAD_FAILED: return "PKT_RX_SEC_OFFLOAD_FAILED";
+	case PKT_RX_EL4_CKSUM_BAD: return "PKT_RX_EL4_CKSUM_BAD";
 	default: return NULL;
 	}
 }
@@ -339,6 +340,7 @@ rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		{ PKT_RX_SEC_OFFLOAD, PKT_RX_SEC_OFFLOAD, NULL },
 		{ PKT_RX_SEC_OFFLOAD_FAILED, PKT_RX_SEC_OFFLOAD_FAILED, NULL },
 		{ PKT_RX_QINQ, PKT_RX_QINQ, NULL },
+		{ PKT_RX_EL4_CKSUM_BAD, PKT_RX_EL4_CKSUM_BAD, NULL },
 	};
 	const char *name;
 	unsigned int i;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index eb11779e7..5c03e98b3 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -177,6 +177,9 @@ extern "C" {
  */
 #define PKT_RX_QINQ          (1ULL << 20)
 
+/**< External/Outer Layer4 header checksum error. */
+#define PKT_RX_EL4_CKSUM_BAD (1ULL << 21)
+
 /* add new RX flags here */
 
 /* add new TX flags here */
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx offload outer UDP checksum definition
  2018-10-02 19:24 ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
@ 2018-10-02 19:24   ` Jerin Jacob
  2018-10-03  7:41     ` Andrew Rybchenko
  2018-10-03 10:52     ` Iremonger, Bernard
  2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
                     ` (4 subsequent siblings)
  5 siblings, 2 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-02 19:24 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz
  Cc: dev, shahafs, Jerin Jacob

Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and
PKT_TX_OUTER_TCP_CKSUM mbuf ol_flags to enable Tx outer UDP
checksum offload.

To use hardware Tx outer UDP checksum offload, the user needs to,

- enable following in mbuff:
a) fill outer_l2_len and outer_l3_len in mbuf
b) set the PKT_TX_OUTER_UDP_CKSUM flag
c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6

- configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---

v2:
- Removed DEV_TX_OFFLOAD_OUTER_TCP_CKSUM and DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM
as there is no realworld use case for it.
See: http://patches.dpdk.org/patch/44692/

This patch series is depended on http://patches.dpdk.org/patch/45840/

---
 app/test-pmd/config.c          | 10 ++++++++++
 doc/guides/nics/features.rst   |  6 ++++++
 lib/librte_ethdev/rte_ethdev.c |  1 +
 lib/librte_ethdev/rte_ethdev.h |  2 ++
 lib/librte_mbuf/rte_mbuf.c     |  1 +
 lib/librte_mbuf/rte_mbuf.h     |  6 +++++-
 6 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index d53c527e5..5d9745ae5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -773,6 +773,16 @@ port_offload_cap_display(portid_t port_id)
 		else
 			printf("off\n");
 	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
+		printf("TX Outer UDP checksum:               ");
+		if (ports[port_id].dev_conf.txmode.offloads &
+		    DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
 }
 
 int
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 2c2959e0b..1390e9668 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -640,8 +640,14 @@ Inner L4 checksum
 Supports inner packet L4 checksum.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM``.
+* **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_OUTER_IPV4`` | ``PKT_TX_OUTER_IPV6``.
+  ``mbuf.ol_flags:PKT_TX_OUTER_UDP_CKSUM``.
+* **[uses]     mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EL4_CKSUM_BAD``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``,
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM``.
+
 
 .. _nic_features_packet_type_parsing:
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index a630c4fda..bb48b5a0f 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -159,6 +159,7 @@ static const struct {
 	RTE_TX_OFFLOAD_BIT2STR(SECURITY),
 	RTE_TX_OFFLOAD_BIT2STR(UDP_TNL_TSO),
 	RTE_TX_OFFLOAD_BIT2STR(IP_TNL_TSO),
+	RTE_TX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 };
 
 #undef RTE_TX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 821d371c3..79d0bb1ed 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -944,6 +944,8 @@ struct rte_eth_conf {
  * for tunnel TSO.
  */
 #define DEV_TX_OFFLOAD_IP_TNL_TSO       0x00080000
+/** Device supports outer UDP checksum */
+#define DEV_TX_OFFLOAD_OUTER_UDP_CKSUM  0x00100000
 
 #define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001
 /**< Device supports Rx queue setup after device started*/
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 022e92b3c..9db4317ef 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -437,6 +437,7 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		  "PKT_TX_TUNNEL_NONE" },
 		{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
 		{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
+		{ PKT_TX_OUTER_UDP_CKSUM, PKT_TX_OUTER_UDP_CKSUM, NULL },
 	};
 	const char *name;
 	unsigned int i;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 5c03e98b3..0a2de50ca 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -184,6 +184,9 @@ extern "C" {
 
 /* add new TX flags here */
 
+/**< Outer UDP cksum of TX pkt. computed by NIC. */
+#define PKT_TX_OUTER_UDP_CKSUM     (1ULL << 41)
+
 /**
  * UDP Fragmentation Offload flag. This flag is used for enabling UDP
  * fragmentation in SW or in HW. When use UFO, mbuf->tso_segsz is used
@@ -351,7 +354,8 @@ extern "C" {
 		PKT_TX_TUNNEL_MASK |	 \
 		PKT_TX_MACSEC |		 \
 		PKT_TX_SEC_OFFLOAD |	\
-		PKT_TX_UDP_SEG)
+		PKT_TX_UDP_SEG |	\
+		PKT_TX_OUTER_UDP_CKSUM)
 
 /**
  * Mbuf having an external buffer attached. shinfo in mbuf must be filled.
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v2 3/4] app/testpmd: add outer UDP HW checksum support
  2018-10-02 19:24 ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
  2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx " Jerin Jacob
@ 2018-10-02 19:24   ` Jerin Jacob
  2018-10-03 13:23     ` Iremonger, Bernard
  2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
                     ` (3 subsequent siblings)
  5 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-02 19:24 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic
  Cc: dev, shahafs, Jerin Jacob

Added outer-udp Tx HW checksum support for csum forward engine
if device supports DEV_TX_OFFLOAD_OUTER_UDP_CKSUM.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---

v2:
- Added outer-udp support for csum engine

---
 app/test-pmd/cmdline.c                      | 24 ++++++++++++++++++---
 app/test-pmd/csumonly.c                     | 13 +++++++++--
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  8 +++++--
 3 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0c5399dc4..2fd007423 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -397,12 +397,13 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"    Disable hardware insertion of a VLAN header in"
 			" packets sent on a port.\n\n"
 
-			"csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)\n"
+			"csum set (ip|udp|tcp|sctp|outer-ip|outer-udp) (hw|sw) (port_id)\n"
 			"    Select hardware or software calculation of the"
 			" checksum when transmitting a packet using the"
 			" csum forward engine.\n"
 			"    ip|udp|tcp|sctp always concern the inner layer.\n"
 			"    outer-ip concerns the outer IP layer in"
+			"    outer-udp concerns the outer UDP layer in"
 			" case the packet is recognized as a tunnel packet by"
 			" the forward engine (vxlan, gre and ipip are supported)\n"
 			"    Please check the NIC datasheet for HW limits.\n\n"
@@ -4177,6 +4178,8 @@ csum_show(int port_id)
 		(tx_offloads & DEV_TX_OFFLOAD_SCTP_CKSUM) ? "hw" : "sw");
 	printf("Outer-Ip checksum offload is %s\n",
 		(tx_offloads & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ? "hw" : "sw");
+	printf("Outer-Udp checksum offload is %s\n",
+		(tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ? "hw" : "sw");
 
 	/* display warnings if configuration is not supported by the NIC */
 	rte_eth_dev_info_get(port_id, &dev_info);
@@ -4205,6 +4208,12 @@ csum_show(int port_id)
 		printf("Warning: hardware outer IP checksum enabled but not "
 			"supported by port %d\n", port_id);
 	}
+	if ((tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) &&
+		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
+			== 0) {
+		printf("Warning: hardware outer UDP checksum enabled but not "
+			"supported by port %d\n", port_id);
+	}
 }
 
 static void
@@ -4273,6 +4282,15 @@ cmd_csum_parsed(void *parsed_result,
 				printf("Outer IP checksum offload is not "
 				       "supported by port %u\n", res->port_id);
 			}
+		} else if (!strcmp(res->proto, "outer-udp")) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+					DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)) {
+				csum_offloads |=
+						DEV_TX_OFFLOAD_OUTER_UDP_CKSUM;
+			} else {
+				printf("Outer UDP checksum offload is not "
+				       "supported by port %u\n", res->port_id);
+			}
 		}
 
 		if (hw) {
@@ -4296,7 +4314,7 @@ cmdline_parse_token_string_t cmd_csum_mode =
 				mode, "set");
 cmdline_parse_token_string_t cmd_csum_proto =
 	TOKEN_STRING_INITIALIZER(struct cmd_csum_result,
-				proto, "ip#tcp#udp#sctp#outer-ip");
+				proto, "ip#tcp#udp#sctp#outer-ip#outer-udp");
 cmdline_parse_token_string_t cmd_csum_hwsw =
 	TOKEN_STRING_INITIALIZER(struct cmd_csum_result,
 				hwsw, "hw#sw");
@@ -4307,7 +4325,7 @@ cmdline_parse_token_num_t cmd_csum_portid =
 cmdline_parse_inst_t cmd_csum_set = {
 	.f = cmd_csum_parsed,
 	.data = NULL,
-	.help_str = "csum set ip|tcp|udp|sctp|outer-ip hw|sw <port_id>: "
+	.help_str = "csum set ip|tcp|udp|sctp|outer-ip|outer-udp hw|sw <port_id>: "
 		"Enable/Disable hardware calculation of L3/L4 checksum when "
 		"using csum forward engine",
 	.tokens = {
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 494829266..ea5b112d6 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -468,10 +468,15 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
 	if (info->outer_l4_proto != IPPROTO_UDP)
 		return ol_flags;
 
+	/* Skip SW outer UDP checksum generation if HW supports it */
+	if (tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
+		ol_flags |= PKT_TX_OUTER_UDP_CKSUM;
+		return ol_flags;
+	}
+
 	udp_hdr = (struct udp_hdr *)((char *)outer_l3_hdr + info->outer_l3_len);
 
-	/* outer UDP checksum is done in software as we have no hardware
-	 * supporting it today, and no API for it. In the other side, for
+	/* outer UDP checksum is done in software. In the other side, for
 	 * UDP tunneling, like VXLAN or Geneve, outer UDP checksum can be
 	 * set to zero.
 	 *
@@ -826,6 +831,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			if (info.tunnel_tso_segsz ||
 			    (tx_offloads &
 			     DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
+			    (tx_offloads &
+			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
 			    (tx_ol_flags & PKT_TX_OUTER_IPV6)) {
 				m->outer_l2_len = info.outer_l2_len;
 				m->outer_l3_len = info.outer_l3_len;
@@ -898,6 +905,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			if (info.is_tunnel == 1) {
 				if ((tx_offloads &
 				    DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
+				    (tx_offloads &
+				    DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
 				    (tx_ol_flags & PKT_TX_OUTER_IPV6))
 					printf("tx: m->outer_l2_len=%d "
 						"m->outer_l3_len=%d\n",
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 3a73000a6..cfcabf6f0 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -857,7 +857,7 @@ csum set
 Select hardware or software calculation of the checksum when
 transmitting a packet using the ``csum`` forwarding engine::
 
-   testpmd> csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)
+   testpmd> csum set (ip|udp|tcp|sctp|outer-ip|outer-udp) (hw|sw) (port_id)
 
 Where:
 
@@ -867,6 +867,10 @@ Where:
   as a tunnel packet by the forwarding engine (vxlan, gre and ipip are
   supported). See also the ``csum parse-tunnel`` command.
 
+* ``outer-udp`` relates to the outer UDP layer in the case where the packet is recognized
+  as a tunnel packet by the forwarding engine (vxlan, vxlan-gpe are
+  supported). See also the ``csum parse-tunnel`` command.
+
 .. note::
 
    Check the NIC Datasheet for hardware limits.
@@ -940,7 +944,7 @@ Consider a packet in packet like the following::
 
 * If parse-tunnel is enabled, the ``ip|udp|tcp|sctp`` parameters of ``csum set``
   command relate to the inner headers (here ``ipv4_in`` and ``tcp_in``), and the
-  ``outer-ip parameter`` relates to the outer headers (here ``ipv4_out``).
+  ``outer-ip|outer-udp`` parameter relates to the outer headers (here ``ipv4_out`` and ``udp_out``).
 
 * If parse-tunnel is disabled, the ``ip|udp|tcp|sctp`` parameters of ``csum  set``
    command relate to the outer headers, here ``ipv4_out`` and ``udp_out``.
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v2 4/4] app/testpmd: collect bad outer L4 checksum for csum engine
  2018-10-02 19:24 ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
  2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx " Jerin Jacob
  2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
@ 2018-10-02 19:24   ` Jerin Jacob
  2018-10-03  8:29     ` Andrew Rybchenko
  2018-10-03  7:34   ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Andrew Rybchenko
                     ` (2 subsequent siblings)
  5 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-02 19:24 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger; +Cc: dev, shahafs, Jerin Jacob

Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD
errors.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---

v2:
- added PKT_RX_EL4_CKSUM_BAD statistics

---
 app/test-pmd/csumonly.c |  6 ++++++
 app/test-pmd/testpmd.c  | 22 +++++++++++++++++-----
 app/test-pmd/testpmd.h  |  4 ++++
 3 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index ea5b112d6..eeda3e9d8 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -701,6 +701,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	uint32_t retry;
 	uint32_t rx_bad_ip_csum;
 	uint32_t rx_bad_l4_csum;
+	uint32_t rx_bad_outer_l4_csum;
 	struct testpmd_offload_info info;
 	uint16_t nb_segments = 0;
 	int ret;
@@ -726,6 +727,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	fs->rx_packets += nb_rx;
 	rx_bad_ip_csum = 0;
 	rx_bad_l4_csum = 0;
+	rx_bad_outer_l4_csum = 0;
 	gro_enable = gro_ports[fs->rx_port].enable;
 
 	txp = &ports[fs->tx_port];
@@ -753,6 +755,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			rx_bad_ip_csum += 1;
 		if ((rx_ol_flags & PKT_RX_L4_CKSUM_MASK) == PKT_RX_L4_CKSUM_BAD)
 			rx_bad_l4_csum += 1;
+		if (rx_ol_flags & PKT_RX_EL4_CKSUM_BAD)
+			rx_bad_outer_l4_csum += 1;
+
 
 		/* step 1: dissect packet, parsing optional vlan, ip4/ip6, vxlan
 		 * and inner headers */
@@ -991,6 +996,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	fs->tx_packets += nb_tx;
 	fs->rx_bad_ip_csum += rx_bad_ip_csum;
 	fs->rx_bad_l4_csum += rx_bad_l4_csum;
+	fs->rx_bad_outer_l4_csum += rx_bad_outer_l4_csum;
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 	fs->tx_burst_stats.pkt_burst_spread[nb_tx]++;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 001f0e552..7db839053 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1040,8 +1040,9 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
-			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64" \n",
-			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",
+			       port->rx_bad_ip_csum, port->rx_bad_l4_csum,
+			       port->rx_bad_outer_l4_csum);
 		if ((stats->ierrors + stats->rx_nombuf) > 0) {
 			printf("  RX-error: %-"PRIu64"\n",  stats->ierrors);
 			printf("  RX-nombufs: %-14"PRIu64"\n", stats->rx_nombuf);
@@ -1059,8 +1060,9 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
-			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"\n",
-			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"    Bad-outer-l4csum: %-14"PRIu64"\n",
+			       port->rx_bad_ip_csum, port->rx_bad_l4_csum,
+			       port->rx_bad_outer_l4_csum);
 		if ((stats->ierrors + stats->rx_nombuf) > 0) {
 			printf("  RX-error:%"PRIu64"\n", stats->ierrors);
 			printf("  RX-nombufs:             %14"PRIu64"\n",
@@ -1124,7 +1126,9 @@ fwd_stream_stats_display(streamid_t stream_id)
 	/* if checksum mode */
 	if (cur_fwd_eng == &csum_fwd_engine) {
 	       printf("  RX- bad IP checksum: %-14u  Rx- bad L4 checksum: "
-			"%-14u\n", fs->rx_bad_ip_csum, fs->rx_bad_l4_csum);
+			"%-14u Rx- bad outer L4 checksum: %-14u\n",
+			fs->rx_bad_ip_csum, fs->rx_bad_l4_csum,
+			fs->rx_bad_outer_l4_csum);
 	}
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
@@ -1378,6 +1382,7 @@ start_packet_forwarding(int with_tx_first)
 		fwd_streams[sm_id]->fwd_dropped = 0;
 		fwd_streams[sm_id]->rx_bad_ip_csum = 0;
 		fwd_streams[sm_id]->rx_bad_l4_csum = 0;
+		fwd_streams[sm_id]->rx_bad_outer_l4_csum = 0;
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 		memset(&fwd_streams[sm_id]->rx_burst_stats, 0,
@@ -1427,6 +1432,7 @@ stop_packet_forwarding(void)
 	uint64_t tx_dropped;
 	uint64_t rx_bad_ip_csum;
 	uint64_t rx_bad_l4_csum;
+	uint64_t rx_bad_outer_l4_csum;
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 	uint64_t fwd_cycles;
 #endif
@@ -1482,6 +1488,12 @@ stop_packet_forwarding(void)
 					 fwd_streams[sm_id]->rx_bad_l4_csum);
 		ports[fwd_streams[sm_id]->rx_port].rx_bad_l4_csum =
 							rx_bad_l4_csum;
+		rx_bad_outer_l4_csum =
+			ports[fwd_streams[sm_id]->rx_port].rx_bad_outer_l4_csum;
+		rx_bad_outer_l4_csum = (uint64_t) (rx_bad_outer_l4_csum +
+			fwd_streams[sm_id]->rx_bad_outer_l4_csum);
+		ports[fwd_streams[sm_id]->rx_port].rx_bad_outer_l4_csum =
+							rx_bad_outer_l4_csum;
 
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 		fwd_cycles = (uint64_t) (fwd_cycles +
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index a1f661472..106aeefc2 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -112,6 +112,8 @@ struct fwd_stream {
 	unsigned int fwd_dropped; /**< received packets not forwarded */
 	unsigned int rx_bad_ip_csum ; /**< received packets has bad ip checksum */
 	unsigned int rx_bad_l4_csum ; /**< received packets has bad l4 checksum */
+	unsigned int rx_bad_outer_l4_csum;
+	/**< received packets has bad outer l4 checksum */
 	unsigned int gro_times;	/**< GRO operation times */
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 	uint64_t     core_cycles; /**< used for RX and TX processing */
@@ -165,6 +167,8 @@ struct rte_port {
 	void                    *fwd_ctx;   /**< Forwarding mode context */
 	uint64_t                rx_bad_ip_csum; /**< rx pkts with bad ip checksum  */
 	uint64_t                rx_bad_l4_csum; /**< rx pkts with bad l4 checksum */
+	uint64_t                rx_bad_outer_l4_csum;
+	/**< rx pkts with bad outer l4 checksum */
 	uint8_t                 tx_queue_stats_mapping_enabled;
 	uint8_t                 rx_queue_stats_mapping_enabled;
 	volatile uint16_t        port_status;    /**< port started or not */
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-02 19:24 ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
                     ` (2 preceding siblings ...)
  2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
@ 2018-10-03  7:34   ` Andrew Rybchenko
  2018-10-03  7:57     ` Jerin Jacob
  2018-10-03  8:53   ` Ananyev, Konstantin
  2018-10-03 10:51   ` Iremonger, Bernard
  5 siblings, 1 reply; 87+ messages in thread
From: Andrew Rybchenko @ 2018-10-03  7:34 UTC (permalink / raw)
  To: Jerin Jacob, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	John McNamara, Marko Kovacevic, Thomas Monjalon, Ferruh Yigit,
	Olivier Matz
  Cc: dev, shahafs, Ananyev, Konstantin

On 10/2/18 10:24 PM, Jerin Jacob wrote:
> Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> failure.
>
> - To use hardware Rx outer UDP checksum offload, the user needs to
> configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
>
> - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

1. I'm not sure that it is OK that mbuf and ethdev changes go in one patch.
     It seems typically mbuf changes go separately and mbuf changes should
     be applied to main dpdk repo.

2. I'd like to see thought why single bit is used for outer L2 checksum when
     2 bits (UNKNOWN, BAD, GOOD, NONE) are used for PKT_RX_L4_CKSUM.
     May be it is OK, but it would be useful to state explicitly why it 
is decided
     to go this way.

3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
     May be it is not directly related to changeset, but I think it 
would be really
     useful to clarify it.


Plus one nit below.

> ---
>
> v2:
> - Removed DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM
> as there is no realworld use case for it.
> See: http://patches.dpdk.org/patch/44692/
>
> This patch series is depended on http://patches.dpdk.org/patch/45840/
>
> --
>   app/test-pmd/config.c          | 9 +++++++++
>   doc/guides/nics/features.rst   | 3 +++
>   lib/librte_ethdev/rte_ethdev.c | 1 +
>   lib/librte_ethdev/rte_ethdev.h | 1 +
>   lib/librte_mbuf/rte_mbuf.c     | 2 ++
>   lib/librte_mbuf/rte_mbuf.h     | 3 +++
>   6 files changed, 19 insertions(+)
>
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 1adc9b94b..d53c527e5 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -594,6 +594,15 @@ port_offload_cap_display(portid_t port_id)
>   			printf("off\n");
>   	}
>   
> +	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_UDP_CKSUM) {
> +		printf("RX Outer UDP checksum:               ");
> +		if (ports[port_id].dev_conf.rxmode.offloads &
> +		    DEV_RX_OFFLOAD_OUTER_UDP_CKSUM)
> +			printf("on\n");
> +		else
> +			printf("off\n");
> +	}
> +
>   	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {
>   		printf("Large receive offload:         ");
>   		if (ports[port_id].dev_conf.rxmode.offloads &
> diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
> index d42489b6d..2c2959e0b 100644
> --- a/doc/guides/nics/features.rst
> +++ b/doc/guides/nics/features.rst
> @@ -639,6 +639,9 @@ Inner L4 checksum
>   
>   Supports inner packet L4 checksum.
>   
> +* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``.
> +* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EL4_CKSUM_BAD``.
> +* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``,
>   

One more empty line should be added here to have two empty lines between 
features.

Andrew.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx offload outer UDP checksum definition
  2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx " Jerin Jacob
@ 2018-10-03  7:41     ` Andrew Rybchenko
  2018-10-03  7:58       ` Jerin Jacob
  2018-10-03 10:52     ` Iremonger, Bernard
  1 sibling, 1 reply; 87+ messages in thread
From: Andrew Rybchenko @ 2018-10-03  7:41 UTC (permalink / raw)
  To: Jerin Jacob, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	John McNamara, Marko Kovacevic, Thomas Monjalon, Ferruh Yigit,
	Olivier Matz
  Cc: dev, shahafs

On 10/2/18 10:24 PM, Jerin Jacob wrote:
> Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and
> PKT_TX_OUTER_TCP_CKSUM mbuf ol_flags to enable Tx outer UDP
> checksum offload.

PKT_TX_OUTER_UDP_CKSUM, not TCP

>
> To use hardware Tx outer UDP checksum offload, the user needs to,
>
> - enable following in mbuff:


mbuf

> a) fill outer_l2_len and outer_l3_len in mbuf
> b) set the PKT_TX_OUTER_UDP_CKSUM flag
> c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6
>
> - configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path
>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

The question about mbuf and ethdev changes separation is applicable here as
well. I have no strong opinion, but I think it would be good to follow.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03  7:34   ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Andrew Rybchenko
@ 2018-10-03  7:57     ` Jerin Jacob
  2018-10-03  8:35       ` Thomas Monjalon
  2018-10-03 17:12       ` Jerin Jacob
  0 siblings, 2 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-03  7:57 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Olivier Matz,
	dev, shahafs, Ananyev, Konstantin

-----Original Message-----
> Date: Wed, 3 Oct 2018 10:34:52 +0300
> From: Andrew Rybchenko <arybchenko@solarflare.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>  Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>  <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>
> CC: dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>  <konstantin.ananyev@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum definition
> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
>  Thunderbird/60.0
> 
> 
> On 10/2/18 10:24 PM, Jerin Jacob wrote:
> 
> Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> failure.
> 
> - To use hardware Rx outer UDP checksum offload, the user needs to
> configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> 
> - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com><mailto:jerin.jacob@caviumnetworks.com>
> 
> 1. I'm not sure that it is OK that mbuf and ethdev changes go in one patch.
>    It seems typically mbuf changes go separately and mbuf changes should
>    be applied to main dpdk repo.


I don't have strong opinion on this. If there are no other objection, I
will split the patch further as mbuf and ethdev as you pointed out.

> 
> 2. I'd like to see thought why single bit is used for outer L2 checksum when
>    2 bits (UNKNOWN, BAD, GOOD, NONE) are used for PKT_RX_L4_CKSUM.
>    May be it is OK, but it would be useful to state explicitly why it is decided
>    to go this way.

I am following the scheme similar to OUTER IP checksum where we have only
one bit filed(PKT_RX_EIP_CKSUM_BAD). I will mention in the git commit.


> 
> 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
>    May be it is not directly related to changeset, but I think it would be really
>    useful to clarify it.

I will update the comment.

> 
> 
> Plus one nit below.
> 
> 
> 
> ---
> 
> v2:
> - Removed DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM
> as there is no realworld use case for it.
> See: http://patches.dpdk.org/patch/44692/
> 
> This patch series is depended on http://patches.dpdk.org/patch/45840/
> 
> --
> app/test-pmd/config.c          | 9 +++++++++
> doc/guides/nics/features.rst   | 3 +++
> lib/librte_ethdev/rte_ethdev.c | 1 +
> lib/librte_ethdev/rte_ethdev.h | 1 +
> lib/librte_mbuf/rte_mbuf.c     | 2 ++
> lib/librte_mbuf/rte_mbuf.h     | 3 +++
> 6 files changed, 19 insertions(+)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 1adc9b94b..d53c527e5 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -594,6 +594,15 @@ port_offload_cap_display(portid_t port_id)
>                        printf("off\n");
>        }
> 
> +       if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_UDP_CKSUM) {
> +               printf("RX Outer UDP checksum:               ");
> +               if (ports[port_id].dev_conf.rxmode.offloads &
> +                   DEV_RX_OFFLOAD_OUTER_UDP_CKSUM)
> +                       printf("on\n");
> +               else
> +                       printf("off\n");
> +       }
> +
>        if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {
>                printf("Large receive offload:         ");
>                if (ports[port_id].dev_conf.rxmode.offloads &
> diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
> index d42489b6d..2c2959e0b 100644
> --- a/doc/guides/nics/features.rst
> +++ b/doc/guides/nics/features.rst
> @@ -639,6 +639,9 @@ Inner L4 checksum
> 
> Supports inner packet L4 checksum.
> 
> +* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``.
> +* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EL4_CKSUM_BAD``.
> +* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``,
> 
> 
> One more empty line should be added here to have two empty lines between features.

OK.

Thanks for the review.

> 
> Andrew.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx offload outer UDP checksum definition
  2018-10-03  7:41     ` Andrew Rybchenko
@ 2018-10-03  7:58       ` Jerin Jacob
  2018-10-03  8:02         ` Ferruh Yigit
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-03  7:58 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Olivier Matz,
	dev, shahafs

-----Original Message-----
> Date: Wed, 3 Oct 2018 10:41:33 +0300
> From: Andrew Rybchenko <arybchenko@solarflare.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>  Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>  <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>
> CC: dev@dpdk.org, shahafs@mellanox.com
> Subject: Re: [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx offload outer UDP
>  checksum definition
> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
>  Thunderbird/60.0
> 
> External Email
> 
> On 10/2/18 10:24 PM, Jerin Jacob wrote:
> 
> Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and
> PKT_TX_OUTER_TCP_CKSUM mbuf ol_flags to enable Tx outer UDP
> checksum offload.
> 
> PKT_TX_OUTER_UDP_CKSUM, not TCP

OK

> 
> 
> 
> 
> To use hardware Tx outer UDP checksum offload, the user needs to,
> 
> - enable following in mbuff:
> 
> 
> mbuf


OK
 
> 
> 
> a) fill outer_l2_len and outer_l3_len in mbuf
> b) set the PKT_TX_OUTER_UDP_CKSUM flag
> c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6
> 
> - configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com><mailto:jerin.jacob@caviumnetworks.com>
> 
> The question about mbuf and ethdev changes separation is applicable here as
> well. I have no strong opinion, but I think it would be good to follow.

I don't have strong opinion on this. If there are no other objection, I
will split the patch further as mbuf and ethdev as you pointed out.

 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx offload outer UDP checksum definition
  2018-10-03  7:58       ` Jerin Jacob
@ 2018-10-03  8:02         ` Ferruh Yigit
  2018-10-03  8:36           ` Thomas Monjalon
  0 siblings, 1 reply; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-03  8:02 UTC (permalink / raw)
  To: Jerin Jacob, Andrew Rybchenko
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Olivier Matz, dev, shahafs

On 10/3/2018 8:58 AM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Wed, 3 Oct 2018 10:41:33 +0300
>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>>  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>>  Iremonger <bernard.iremonger@intel.com>, John McNamara
>>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>  Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>  <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>
>> CC: dev@dpdk.org, shahafs@mellanox.com
>> Subject: Re: [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx offload outer UDP
>>  checksum definition
>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
>>  Thunderbird/60.0
>>
>> External Email
>>
>> On 10/2/18 10:24 PM, Jerin Jacob wrote:
>>
>> Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and
>> PKT_TX_OUTER_TCP_CKSUM mbuf ol_flags to enable Tx outer UDP
>> checksum offload.
>>
>> PKT_TX_OUTER_UDP_CKSUM, not TCP
> 
> OK
> 
>>
>>
>>
>>
>> To use hardware Tx outer UDP checksum offload, the user needs to,
>>
>> - enable following in mbuff:
>>
>>
>> mbuf
> 
> 
> OK
>  
>>
>>
>> a) fill outer_l2_len and outer_l3_len in mbuf
>> b) set the PKT_TX_OUTER_UDP_CKSUM flag
>> c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6
>>
>> - configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path
>>
>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com><mailto:jerin.jacob@caviumnetworks.com>
>>
>> The question about mbuf and ethdev changes separation is applicable here as
>> well. I have no strong opinion, but I think it would be good to follow.
> 
> I don't have strong opinion on this. If there are no other objection, I
> will split the patch further as mbuf and ethdev as you pointed out.

Since they are logically related, it make sense to have them together to me.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 4/4] app/testpmd: collect bad outer L4 checksum for csum engine
  2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
@ 2018-10-03  8:29     ` Andrew Rybchenko
  0 siblings, 0 replies; 87+ messages in thread
From: Andrew Rybchenko @ 2018-10-03  8:29 UTC (permalink / raw)
  To: Jerin Jacob, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger; +Cc: dev, shahafs

On 10/2/18 10:24 PM, Jerin Jacob wrote:
> Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD
> errors.
>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

except two nits below

<...>

> @@ -753,6 +755,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
>   			rx_bad_ip_csum += 1;
>   		if ((rx_ol_flags & PKT_RX_L4_CKSUM_MASK) == PKT_RX_L4_CKSUM_BAD)
>   			rx_bad_l4_csum += 1;
> +		if (rx_ol_flags & PKT_RX_EL4_CKSUM_BAD)
> +			rx_bad_outer_l4_csum += 1;
> +

Unnecessary extra empty line.

<...>

> @@ -1482,6 +1488,12 @@ stop_packet_forwarding(void)
>   					 fwd_streams[sm_id]->rx_bad_l4_csum);
>   		ports[fwd_streams[sm_id]->rx_port].rx_bad_l4_csum =
>   							rx_bad_l4_csum;
> +		rx_bad_outer_l4_csum =
> +			ports[fwd_streams[sm_id]->rx_port].rx_bad_outer_l4_csum;
> +		rx_bad_outer_l4_csum = (uint64_t) (rx_bad_outer_l4_csum +
> +			fwd_streams[sm_id]->rx_bad_outer_l4_csum);
> +		ports[fwd_streams[sm_id]->rx_port].rx_bad_outer_l4_csum =
> +							rx_bad_outer_l4_csum;

I guess it is copied from about and modified, but I think that so long magic
is not required and the following simple version should do the job:

ports[fwd_streams[sm_id]->rx_port].rx_bad_outer_l4_csum +=
      fwd_streams[sm_id]->rx_bad_outer_l4_csum;


rx_bad_outer_l4_csum is uint64_t and usual arithmetic conversions
should guarantee the correct result.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03  7:57     ` Jerin Jacob
@ 2018-10-03  8:35       ` Thomas Monjalon
  2018-10-03  8:36         ` Andrew Rybchenko
  2018-10-03 17:12       ` Jerin Jacob
  1 sibling, 1 reply; 87+ messages in thread
From: Thomas Monjalon @ 2018-10-03  8:35 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Andrew Rybchenko, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	John McNamara, Marko Kovacevic, Ferruh Yigit, Olivier Matz, dev,
	shahafs, Ananyev, Konstantin

03/10/2018 09:57, Jerin Jacob:
> From: Andrew Rybchenko <arybchenko@solarflare.com>
> > 1. I'm not sure that it is OK that mbuf and ethdev changes go in one patch.
> >    It seems typically mbuf changes go separately and mbuf changes should
> >    be applied to main dpdk repo.
> 
> I don't have strong opinion on this. If there are no other objection, I
> will split the patch further as mbuf and ethdev as you pointed out.

Those flags are handled in mbuf and ethdev.
As it is closely related, I think it is better to get the changes
in one patch, as you did.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03  8:35       ` Thomas Monjalon
@ 2018-10-03  8:36         ` Andrew Rybchenko
  0 siblings, 0 replies; 87+ messages in thread
From: Andrew Rybchenko @ 2018-10-03  8:36 UTC (permalink / raw)
  To: Thomas Monjalon, Jerin Jacob
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Ferruh Yigit, Olivier Matz, dev, shahafs,
	Ananyev, Konstantin

On 10/3/18 11:35 AM, Thomas Monjalon wrote:
> 03/10/2018 09:57, Jerin Jacob:
>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>>> 1. I'm not sure that it is OK that mbuf and ethdev changes go in one patch.
>>>     It seems typically mbuf changes go separately and mbuf changes should
>>>     be applied to main dpdk repo.
>> I don't have strong opinion on this. If there are no other objection, I
>> will split the patch further as mbuf and ethdev as you pointed out.
> Those flags are handled in mbuf and ethdev.
> As it is closely related, I think it is better to get the changes
> in one patch, as you did.

OK, thanks for clarification.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx offload outer UDP checksum definition
  2018-10-03  8:02         ` Ferruh Yigit
@ 2018-10-03  8:36           ` Thomas Monjalon
  0 siblings, 0 replies; 87+ messages in thread
From: Thomas Monjalon @ 2018-10-03  8:36 UTC (permalink / raw)
  To: Ferruh Yigit, Jerin Jacob
  Cc: Andrew Rybchenko, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	John McNamara, Marko Kovacevic, Olivier Matz, dev, shahafs

03/10/2018 10:02, Ferruh Yigit:
> On 10/3/2018 8:58 AM, Jerin Jacob wrote:
> > From: Andrew Rybchenko <arybchenko@solarflare.com>
> >> The question about mbuf and ethdev changes separation is applicable here as
> >> well. I have no strong opinion, but I think it would be good to follow.
> > 
> > I don't have strong opinion on this. If there are no other objection, I
> > will split the patch further as mbuf and ethdev as you pointed out.
> 
> Since they are logically related, it make sense to have them together to me.

+1 for keeping ethdev/mbuf together.
No problem applying such mbuf change in dpdk-next-net.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-02 19:24 ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
                     ` (3 preceding siblings ...)
  2018-10-03  7:34   ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Andrew Rybchenko
@ 2018-10-03  8:53   ` Ananyev, Konstantin
  2018-10-03  8:59     ` Jerin Jacob
  2018-10-03 10:51   ` Iremonger, Bernard
  5 siblings, 1 reply; 87+ messages in thread
From: Ananyev, Konstantin @ 2018-10-03  8:53 UTC (permalink / raw)
  To: Jerin Jacob, Lu, Wenzhuo, Wu, Jingjing, Iremonger, Bernard,
	Mcnamara, John, Kovacevic, Marko, Thomas Monjalon, Yigit, Ferruh,
	Andrew Rybchenko, Olivier Matz
  Cc: dev, shahafs

Hi Jerin,

> 
> Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> failure.
> 
> - To use hardware Rx outer UDP checksum offload, the user needs to
> configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> 
> - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Looks ok to me in general.
Just wonder is there any PMD that supports all these new features?
Konstantin 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03  8:53   ` Ananyev, Konstantin
@ 2018-10-03  8:59     ` Jerin Jacob
  2018-10-03  9:17       ` Ananyev, Konstantin
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-03  8:59 UTC (permalink / raw)
  To: Ananyev, Konstantin
  Cc: Lu, Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Mcnamara, John,
	Kovacevic, Marko, Thomas Monjalon, Yigit, Ferruh,
	Andrew Rybchenko, Olivier Matz, dev, shahafs

-----Original Message-----
> Date: Wed, 3 Oct 2018 08:53:22 +0000
> From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, "Lu, Wenzhuo"
>  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
>  "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Mcnamara, John"
>  <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, "Yigit, Ferruh"
>  <ferruh.yigit@intel.com>, Andrew Rybchenko <arybchenko@solarflare.com>,
>  Olivier Matz <olivier.matz@6wind.com>
> CC: "dev@dpdk.org" <dev@dpdk.org>, "shahafs@mellanox.com"
>  <shahafs@mellanox.com>
> Subject: RE: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum	definition
> 
> 
> Hi Jerin,

Hi Konstantin,

> 
> >
> > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> > PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> > failure.
> >
> > - To use hardware Rx outer UDP checksum offload, the user needs to
> > configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> >
> > - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> > similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> 
> Looks ok to me in general.
> Just wonder is there any PMD that supports all these new features?

octeontx2 PMD has this feature. I am planning to push the PMD for v19.02.
Before that I adding all the common code change to avoid the dependency.

> Konstantin

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03  8:59     ` Jerin Jacob
@ 2018-10-03  9:17       ` Ananyev, Konstantin
  2018-10-03  9:22         ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Ananyev, Konstantin @ 2018-10-03  9:17 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Lu, Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Mcnamara, John,
	Kovacevic, Marko, Thomas Monjalon, Yigit, Ferruh,
	Andrew Rybchenko, Olivier Matz, dev, shahafs



> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Wednesday, October 3, 2018 9:59 AM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>;
> Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com>; Thomas Monjalon
> <thomas@monjalon.net>; Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>; Olivier Matz
> <olivier.matz@6wind.com>; dev@dpdk.org; shahafs@mellanox.com
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
> 
> -----Original Message-----
> > Date: Wed, 3 Oct 2018 08:53:22 +0000
> > From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
> > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, "Lu, Wenzhuo"
> >  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
> >  "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Mcnamara, John"
> >  <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>,
> >  Thomas Monjalon <thomas@monjalon.net>, "Yigit, Ferruh"
> >  <ferruh.yigit@intel.com>, Andrew Rybchenko <arybchenko@solarflare.com>,
> >  Olivier Matz <olivier.matz@6wind.com>
> > CC: "dev@dpdk.org" <dev@dpdk.org>, "shahafs@mellanox.com"
> >  <shahafs@mellanox.com>
> > Subject: RE: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> >  checksum	definition
> >
> >
> > Hi Jerin,
> 
> Hi Konstantin,
> 
> >
> > >
> > > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> > > PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> > > failure.
> > >
> > > - To use hardware Rx outer UDP checksum offload, the user needs to
> > > configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> > >
> > > - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> > > similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> > >
> > > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> >
> > Looks ok to me in general.
> > Just wonder is there any PMD that supports all these new features?
> 
> octeontx2 PMD has this feature. I am planning to push the PMD for v19.02.
> Before that I adding all the common code change to avoid the dependency.

Ok, but why then ethdev/mbuf changes has to go into 18.11?
Do you plan your new PMD backward compatible with 18.11 LTS?
Konstantin

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03  9:17       ` Ananyev, Konstantin
@ 2018-10-03  9:22         ` Jerin Jacob
  2018-10-03 10:16           ` Ananyev, Konstantin
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-03  9:22 UTC (permalink / raw)
  To: Ananyev, Konstantin
  Cc: Lu, Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Mcnamara, John,
	Kovacevic, Marko, Thomas Monjalon, Yigit, Ferruh,
	Andrew Rybchenko, Olivier Matz, dev, shahafs

-----Original Message-----
> Date: Wed, 3 Oct 2018 09:17:18 +0000
> From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> CC: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Wu, Jingjing"
>  <jingjing.wu@intel.com>, "Iremonger, Bernard"
>  <bernard.iremonger@intel.com>, "Mcnamara, John" <john.mcnamara@intel.com>,
>  "Kovacevic, Marko" <marko.kovacevic@intel.com>, Thomas Monjalon
>  <thomas@monjalon.net>, "Yigit, Ferruh" <ferruh.yigit@intel.com>, Andrew
>  Rybchenko <arybchenko@solarflare.com>, Olivier Matz
>  <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
>  "shahafs@mellanox.com" <shahafs@mellanox.com>
> Subject: RE: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum	definition
> 
> 
> > -----Original Message-----
> > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > Sent: Wednesday, October 3, 2018 9:59 AM
> > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>;
> > Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com>; Thomas Monjalon
> > <thomas@monjalon.net>; Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>; Olivier Matz
> > <olivier.matz@6wind.com>; dev@dpdk.org; shahafs@mellanox.com
> > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
> >
> > -----Original Message-----
> > > Date: Wed, 3 Oct 2018 08:53:22 +0000
> > > From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
> > > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, "Lu, Wenzhuo"
> > >  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
> > >  "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Mcnamara, John"
> > >  <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>,
> > >  Thomas Monjalon <thomas@monjalon.net>, "Yigit, Ferruh"
> > >  <ferruh.yigit@intel.com>, Andrew Rybchenko <arybchenko@solarflare.com>,
> > >  Olivier Matz <olivier.matz@6wind.com>
> > > CC: "dev@dpdk.org" <dev@dpdk.org>, "shahafs@mellanox.com"
> > >  <shahafs@mellanox.com>
> > > Subject: RE: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> > >  checksum   definition
> > >
> > >
> > > Hi Jerin,
> >
> > Hi Konstantin,
> >
> > >
> > > >
> > > > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> > > > PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> > > > failure.
> > > >
> > > > - To use hardware Rx outer UDP checksum offload, the user needs to
> > > > configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> > > >
> > > > - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> > > > similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> > > >
> > > > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > >
> > > Looks ok to me in general.
> > > Just wonder is there any PMD that supports all these new features?
> >
> > octeontx2 PMD has this feature. I am planning to push the PMD for v19.02.
> > Before that I adding all the common code change to avoid the dependency.
> 
> Ok, but why then ethdev/mbuf changes has to go into 18.11?

It it is a generic change then why not? What is the real concern here?

> Do you plan your new PMD backward compatible with 18.11 LTS?

Yes.

> Konstantin

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03  9:22         ` Jerin Jacob
@ 2018-10-03 10:16           ` Ananyev, Konstantin
  2018-10-03 11:15             ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Ananyev, Konstantin @ 2018-10-03 10:16 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Lu, Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Mcnamara, John,
	Kovacevic, Marko, Thomas Monjalon, Yigit, Ferruh,
	Andrew Rybchenko, Olivier Matz, dev, shahafs



> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Wednesday, October 3, 2018 10:22 AM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>;
> Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com>; Thomas Monjalon
> <thomas@monjalon.net>; Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>; Olivier Matz
> <olivier.matz@6wind.com>; dev@dpdk.org; shahafs@mellanox.com
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
> 
> -----Original Message-----
> > Date: Wed, 3 Oct 2018 09:17:18 +0000
> > From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
> > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > CC: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Wu, Jingjing"
> >  <jingjing.wu@intel.com>, "Iremonger, Bernard"
> >  <bernard.iremonger@intel.com>, "Mcnamara, John" <john.mcnamara@intel.com>,
> >  "Kovacevic, Marko" <marko.kovacevic@intel.com>, Thomas Monjalon
> >  <thomas@monjalon.net>, "Yigit, Ferruh" <ferruh.yigit@intel.com>, Andrew
> >  Rybchenko <arybchenko@solarflare.com>, Olivier Matz
> >  <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
> >  "shahafs@mellanox.com" <shahafs@mellanox.com>
> > Subject: RE: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> >  checksum	definition
> >
> >
> > > -----Original Message-----
> > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > > Sent: Wednesday, October 3, 2018 9:59 AM
> > > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> > > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>;
> > > Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com>; Thomas Monjalon
> > > <thomas@monjalon.net>; Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>; Olivier Matz
> > > <olivier.matz@6wind.com>; dev@dpdk.org; shahafs@mellanox.com
> > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
> > >
> > > -----Original Message-----
> > > > Date: Wed, 3 Oct 2018 08:53:22 +0000
> > > > From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
> > > > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, "Lu, Wenzhuo"
> > > >  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
> > > >  "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Mcnamara, John"
> > > >  <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>,
> > > >  Thomas Monjalon <thomas@monjalon.net>, "Yigit, Ferruh"
> > > >  <ferruh.yigit@intel.com>, Andrew Rybchenko <arybchenko@solarflare.com>,
> > > >  Olivier Matz <olivier.matz@6wind.com>
> > > > CC: "dev@dpdk.org" <dev@dpdk.org>, "shahafs@mellanox.com"
> > > >  <shahafs@mellanox.com>
> > > > Subject: RE: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> > > >  checksum   definition
> > > >
> > > >
> > > > Hi Jerin,
> > >
> > > Hi Konstantin,
> > >
> > > >
> > > > >
> > > > > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> > > > > PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> > > > > failure.
> > > > >
> > > > > - To use hardware Rx outer UDP checksum offload, the user needs to
> > > > > configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> > > > >
> > > > > - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> > > > > similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> > > > >
> > > > > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > > >
> > > > Looks ok to me in general.
> > > > Just wonder is there any PMD that supports all these new features?
> > >
> > > octeontx2 PMD has this feature. I am planning to push the PMD for v19.02.
> > > Before that I adding all the common code change to avoid the dependency.
> >
> > Ok, but why then ethdev/mbuf changes has to go into 18.11?
> 
> It it is a generic change then why not? What is the real concern here?

If there is no implementation for it, how we can conclude that it is really 'generic' one? :)
My main concern is that we already have several features in rte_ethdev and rte_security
that supposed to be 'generic' but right now no-one support them. 
I wouldn't to object about these particular features, they look reasonable to me.
But in general I think we need some better defined policy -
about what is allowed to propagate without real evidence (particular implementation)
and what is not.

> 
> > Do you plan your new PMD backward compatible with 18.11 LTS?
> 
> Yes.

I see.
Konstantin

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-02 19:24 ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
                     ` (4 preceding siblings ...)
  2018-10-03  8:53   ` Ananyev, Konstantin
@ 2018-10-03 10:51   ` Iremonger, Bernard
  2018-10-03 11:19     ` Jerin Jacob
  5 siblings, 1 reply; 87+ messages in thread
From: Iremonger, Bernard @ 2018-10-03 10:51 UTC (permalink / raw)
  To: Jerin Jacob, Lu, Wenzhuo, Wu, Jingjing, Mcnamara, John,
	Kovacevic, Marko, Thomas Monjalon, Yigit, Ferruh,
	Andrew Rybchenko, Olivier Matz
  Cc: dev, shahafs

Hi Jerin,

> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Tuesday, October 2, 2018 8:25 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>;
> Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>; Thomas Monjalon <thomas@monjalon.net>;
> Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko
> <arybchenko@solarflare.com>; Olivier Matz <olivier.matz@6wind.com>
> Cc: dev@dpdk.org; shahafs@mellanox.com; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum
> definition
> 
> Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum failure.
> 
> - To use hardware Rx outer UDP checksum offload, the user needs to configure
> DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> 
> - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
> 
> v2:
> - Removed DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and
> DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM as there is no realworld use case for
> it.
> See: http://patches.dpdk.org/patch/44692/
> 
> This patch series is depended on http://patches.dpdk.org/patch/45840/
> 
> --
>  app/test-pmd/config.c          | 9 +++++++++
>  doc/guides/nics/features.rst   | 3 +++
>  lib/librte_ethdev/rte_ethdev.c | 1 +
>  lib/librte_ethdev/rte_ethdev.h | 1 +
>  lib/librte_mbuf/rte_mbuf.c     | 2 ++
>  lib/librte_mbuf/rte_mbuf.h     | 3 +++
>  6 files changed, 19 insertions(+)
> 

<snip>

This patch fails to apply to the latest master branch, a rebase may be needed.

Regards,

Bernard.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx offload outer UDP checksum definition
  2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx " Jerin Jacob
  2018-10-03  7:41     ` Andrew Rybchenko
@ 2018-10-03 10:52     ` Iremonger, Bernard
  1 sibling, 0 replies; 87+ messages in thread
From: Iremonger, Bernard @ 2018-10-03 10:52 UTC (permalink / raw)
  To: Jerin Jacob, Lu, Wenzhuo, Wu, Jingjing, Mcnamara, John,
	Kovacevic, Marko, Thomas Monjalon, Yigit, Ferruh,
	Andrew Rybchenko, Olivier Matz
  Cc: dev, shahafs

Hi Jerin,

> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Tuesday, October 2, 2018 8:25 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>;
> Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>; Thomas Monjalon <thomas@monjalon.net>;
> Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko
> <arybchenko@solarflare.com>; Olivier Matz <olivier.matz@6wind.com>
> Cc: dev@dpdk.org; shahafs@mellanox.com; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx offload outer UDP checksum
> definition
> 
> Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and
> PKT_TX_OUTER_TCP_CKSUM mbuf ol_flags to enable Tx outer UDP checksum
> offload.
> 
> To use hardware Tx outer UDP checksum offload, the user needs to,
> 
> - enable following in mbuff:
> a) fill outer_l2_len and outer_l3_len in mbuf
> b) set the PKT_TX_OUTER_UDP_CKSUM flag
> c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6
> 
> - configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
> 
> v2:
> - Removed DEV_TX_OFFLOAD_OUTER_TCP_CKSUM and
> DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM as there is no realworld use case for
> it.
> See: http://patches.dpdk.org/patch/44692/
> 
> This patch series is depended on http://patches.dpdk.org/patch/45840/
> 
> ---
>  app/test-pmd/config.c          | 10 ++++++++++
>  doc/guides/nics/features.rst   |  6 ++++++
>  lib/librte_ethdev/rte_ethdev.c |  1 +
>  lib/librte_ethdev/rte_ethdev.h |  2 ++
>  lib/librte_mbuf/rte_mbuf.c     |  1 +
>  lib/librte_mbuf/rte_mbuf.h     |  6 +++++-
>  6 files changed, 25 insertions(+), 1 deletion(-)
> 
<snip>
This patch fails to apply to the latest master branch, a rebase may be needed.

Regards,

Bernard.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03 10:16           ` Ananyev, Konstantin
@ 2018-10-03 11:15             ` Jerin Jacob
  0 siblings, 0 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-03 11:15 UTC (permalink / raw)
  To: Ananyev, Konstantin
  Cc: Lu, Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Mcnamara, John,
	Kovacevic, Marko, Thomas Monjalon, Yigit, Ferruh,
	Andrew Rybchenko, Olivier Matz, dev, shahafs

-----Original Message-----
> Date: Wed, 3 Oct 2018 10:16:31 +0000
> From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> CC: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Wu, Jingjing"
>  <jingjing.wu@intel.com>, "Iremonger, Bernard"
>  <bernard.iremonger@intel.com>, "Mcnamara, John" <john.mcnamara@intel.com>,
>  "Kovacevic, Marko" <marko.kovacevic@intel.com>, Thomas Monjalon
>  <thomas@monjalon.net>, "Yigit, Ferruh" <ferruh.yigit@intel.com>, Andrew
>  Rybchenko <arybchenko@solarflare.com>, Olivier Matz
>  <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
>  "shahafs@mellanox.com" <shahafs@mellanox.com>
> Subject: RE: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum	definition
> 
> > -----Original Message-----
> > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > Sent: Wednesday, October 3, 2018 10:22 AM
> > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>;
> > Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com>; Thomas Monjalon
> > <thomas@monjalon.net>; Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>; Olivier Matz
> > <olivier.matz@6wind.com>; dev@dpdk.org; shahafs@mellanox.com
> > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
> >
> > -----Original Message-----
> > > Date: Wed, 3 Oct 2018 09:17:18 +0000
> > > From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
> > > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > > CC: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Wu, Jingjing"
> > >  <jingjing.wu@intel.com>, "Iremonger, Bernard"
> > >  <bernard.iremonger@intel.com>, "Mcnamara, John" <john.mcnamara@intel.com>,
> > >  "Kovacevic, Marko" <marko.kovacevic@intel.com>, Thomas Monjalon
> > >  <thomas@monjalon.net>, "Yigit, Ferruh" <ferruh.yigit@intel.com>, Andrew
> > >  Rybchenko <arybchenko@solarflare.com>, Olivier Matz
> > >  <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
> > >  "shahafs@mellanox.com" <shahafs@mellanox.com>
> > > Subject: RE: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> > >  checksum   definition
> > >
> > >
> > > > -----Original Message-----
> > > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > > > Sent: Wednesday, October 3, 2018 9:59 AM
> > > > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> > > > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard
> > <bernard.iremonger@intel.com>;
> > > > Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com>; Thomas Monjalon
> > > > <thomas@monjalon.net>; Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>; Olivier Matz
> > > > <olivier.matz@6wind.com>; dev@dpdk.org; shahafs@mellanox.com
> > > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
> > > >
> > > > -----Original Message-----
> > > > > Date: Wed, 3 Oct 2018 08:53:22 +0000
> > > > > From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
> > > > > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, "Lu, Wenzhuo"
> > > > >  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
> > > > >  "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Mcnamara, John"
> > > > >  <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>,
> > > > >  Thomas Monjalon <thomas@monjalon.net>, "Yigit, Ferruh"
> > > > >  <ferruh.yigit@intel.com>, Andrew Rybchenko <arybchenko@solarflare.com>,
> > > > >  Olivier Matz <olivier.matz@6wind.com>
> > > > > CC: "dev@dpdk.org" <dev@dpdk.org>, "shahafs@mellanox.com"
> > > > >  <shahafs@mellanox.com>
> > > > > Subject: RE: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> > > > >  checksum   definition
> > > > >
> > > > >
> > > > > Hi Jerin,
> > > >
> > > > Hi Konstantin,
> > > >
> > > > >
> > > > > >
> > > > > > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> > > > > > PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> > > > > > failure.
> > > > > >
> > > > > > - To use hardware Rx outer UDP checksum offload, the user needs to
> > > > > > configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> > > > > >
> > > > > > - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> > > > > > similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> > > > > >
> > > > > > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > > > >
> > > > > Looks ok to me in general.
> > > > > Just wonder is there any PMD that supports all these new features?
> > > >
> > > > octeontx2 PMD has this feature. I am planning to push the PMD for v19.02.
> > > > Before that I adding all the common code change to avoid the dependency.
> > >
> > > Ok, but why then ethdev/mbuf changes has to go into 18.11?
> >
> > It it is a generic change then why not? What is the real concern here?
> 
> If there is no implementation for it, how we can conclude that it is really 'generic' one? :)
> My main concern is that we already have several features in rte_ethdev and rte_security
> that supposed to be 'generic' but right now no-one support them.

I think, this case is pretty straight forward changes.

> I wouldn't to object about these particular features, they look reasonable to me.

OK.

> But in general I think we need some better defined policy -
> about what is allowed to propagate without real evidence (particular implementation)
> and what is not.

I am open for the policy definition.

> 
> >
> > > Do you plan your new PMD backward compatible with 18.11 LTS?
> >
> > Yes.
> 
> I see.
> Konstantin
> 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03 10:51   ` Iremonger, Bernard
@ 2018-10-03 11:19     ` Jerin Jacob
  2018-10-03 13:00       ` Iremonger, Bernard
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-03 11:19 UTC (permalink / raw)
  To: Iremonger, Bernard
  Cc: Lu, Wenzhuo, Wu, Jingjing, Mcnamara, John, Kovacevic, Marko,
	Thomas Monjalon, Yigit, Ferruh, Andrew Rybchenko, Olivier Matz,
	dev, shahafs

-----Original Message-----
> Date: Wed, 3 Oct 2018 10:51:36 +0000
> From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, "Lu, Wenzhuo"
>  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>, "Mcnamara,
>  John" <john.mcnamara@intel.com>, "Kovacevic, Marko"
>  <marko.kovacevic@intel.com>, Thomas Monjalon <thomas@monjalon.net>,
>  "Yigit, Ferruh" <ferruh.yigit@intel.com>, Andrew Rybchenko
>  <arybchenko@solarflare.com>, Olivier Matz <olivier.matz@6wind.com>
> CC: "dev@dpdk.org" <dev@dpdk.org>, "shahafs@mellanox.com"
>  <shahafs@mellanox.com>
> Subject: RE: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum definition
> 
> 
> Hi Jerin,

Hi Iremonger,

> 
> > -----Original Message-----
> > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > Sent: Tuesday, October 2, 2018 8:25 PM
> > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>;
> > Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko
> > <marko.kovacevic@intel.com>; Thomas Monjalon <thomas@monjalon.net>;
> > Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko
> > <arybchenko@solarflare.com>; Olivier Matz <olivier.matz@6wind.com>
> > Cc: dev@dpdk.org; shahafs@mellanox.com; Jerin Jacob
> > <jerin.jacob@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum
> > definition
> >
> > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> > PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum failure.
> >
> > - To use hardware Rx outer UDP checksum offload, the user needs to configure
> > DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> >
> > - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> > similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > ---
> >
> > v2:
> > - Removed DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and
> > DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM as there is no realworld use case for
> > it.
> > See: http://patches.dpdk.org/patch/44692/
> >
> > This patch series is depended on http://patches.dpdk.org/patch/45840/
> >
> > --
> >  app/test-pmd/config.c          | 9 +++++++++
> >  doc/guides/nics/features.rst   | 3 +++
> >  lib/librte_ethdev/rte_ethdev.c | 1 +
> >  lib/librte_ethdev/rte_ethdev.h | 1 +
> >  lib/librte_mbuf/rte_mbuf.c     | 2 ++
> >  lib/librte_mbuf/rte_mbuf.h     | 3 +++
> >  6 files changed, 19 insertions(+)
> >
> 
> <snip>
> 
> This patch fails to apply to the latest master branch, a rebase may be needed.


Have you applies the depended series http://patches.dpdk.org/patch/45840/
as mentioned above? If yes and then still has issue then let me know.




> Regards,
> 
> Bernard.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03 11:19     ` Jerin Jacob
@ 2018-10-03 13:00       ` Iremonger, Bernard
  0 siblings, 0 replies; 87+ messages in thread
From: Iremonger, Bernard @ 2018-10-03 13:00 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Lu, Wenzhuo, Wu, Jingjing, Mcnamara, John, Kovacevic, Marko,
	Thomas Monjalon, Yigit, Ferruh, Andrew Rybchenko, Olivier Matz,
	dev, shahafs


Hi Jerin,

<snip>

> > > Subject: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> > > checksum definition
> > >
> > > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> > > PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> failure.
> > >
> > > - To use hardware Rx outer UDP checksum offload, the user needs to
> > > configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in
> slowpath.
> > >
> > > - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum
> > > failure similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> > >
> > > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > > ---
> > >
> > > v2:
> > > - Removed DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and
> > > DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM as there is no realworld use case
> > > for it.
> > > See: http://patches.dpdk.org/patch/44692/
> > >
> > > This patch series is depended on
> > > http://patches.dpdk.org/patch/45840/
> > >
> > > --
> > >  app/test-pmd/config.c          | 9 +++++++++
> > >  doc/guides/nics/features.rst   | 3 +++
> > >  lib/librte_ethdev/rte_ethdev.c | 1 +
> > > lib/librte_ethdev/rte_ethdev.h | 1 +
> > >  lib/librte_mbuf/rte_mbuf.c     | 2 ++
> > >  lib/librte_mbuf/rte_mbuf.h     | 3 +++
> > >  6 files changed, 19 insertions(+)
> > >
> >
> > <snip>
> >
> > This patch fails to apply to the latest master branch, a rebase may be needed.
> 
> 
> Have you applies the depended series http://patches.dpdk.org/patch/45840/
> as mentioned above? If yes and then still has issue then let me know.
> 

The  patches apply and build fine with the above patch applied first.

Regards,

Bernard.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 3/4] app/testpmd: add outer UDP HW checksum support
  2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
@ 2018-10-03 13:23     ` Iremonger, Bernard
  0 siblings, 0 replies; 87+ messages in thread
From: Iremonger, Bernard @ 2018-10-03 13:23 UTC (permalink / raw)
  To: Jerin Jacob, Lu, Wenzhuo, Wu, Jingjing, Mcnamara, John, Kovacevic, Marko
  Cc: dev, shahafs


> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Tuesday, October 2, 2018 8:25 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>;
> Mcnamara, John <john.mcnamara@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>
> Cc: dev@dpdk.org; shahafs@mellanox.com; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v2 3/4] app/testpmd: add outer UDP HW checksum
> support
> 
> Added outer-udp Tx HW checksum support for csum forward engine if device
> supports DEV_TX_OFFLOAD_OUTER_UDP_CKSUM.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03  7:57     ` Jerin Jacob
  2018-10-03  8:35       ` Thomas Monjalon
@ 2018-10-03 17:12       ` Jerin Jacob
  2018-10-03 18:00         ` Andrew Rybchenko
  1 sibling, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-03 17:12 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Olivier Matz,
	dev, shahafs, Ananyev, Konstantin

-----Original Message-----
> Date: Wed, 3 Oct 2018 13:27:13 +0530
> From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> To: Andrew Rybchenko <arybchenko@solarflare.com>
> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>  Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>  <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
>  dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>  <konstantin.ananyev@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum definition
> User-Agent: Mutt/1.10.1 (2018-07-13)
> 
> External Email
> 
> -----Original Message-----
> > Date: Wed, 3 Oct 2018 10:34:52 +0300
> > From: Andrew Rybchenko <arybchenko@solarflare.com>
> > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
> >  <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
> >  Iremonger <bernard.iremonger@intel.com>, John McNamara
> >  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
> >  Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
> >  <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>
> > CC: dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
> >  <konstantin.ananyev@intel.com>
> > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> >  checksum definition
> > User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
> >  Thunderbird/60.0
> >
> >
> > On 10/2/18 10:24 PM, Jerin Jacob wrote:
> >
> > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> > PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> > failure.
> >
> > - To use hardware Rx outer UDP checksum offload, the user needs to
> > configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> >
> > - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> > similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com><mailto:jerin.jacob@caviumnetworks.com>
> >
> > 1. I'm not sure that it is OK that mbuf and ethdev changes go in one patch.
> >    It seems typically mbuf changes go separately and mbuf changes should
> >    be applied to main dpdk repo.
> 
> 
> I don't have strong opinion on this. If there are no other objection, I
> will split the patch further as mbuf and ethdev as you pointed out.
> 
> >
> > 2. I'd like to see thought why single bit is used for outer L2 checksum when
> >    2 bits (UNKNOWN, BAD, GOOD, NONE) are used for PKT_RX_L4_CKSUM.
> >    May be it is OK, but it would be useful to state explicitly why it is decided
> >    to go this way.
> 
> I am following the scheme similar to OUTER IP checksum where we have only
> one bit filed(PKT_RX_EIP_CKSUM_BAD). I will mention in the git commit.
> 
> 
> >
> > 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
> >    May be it is not directly related to changeset, but I think it would be really
> >    useful to clarify it.
> 
> I will update the comment.

Hi Andrew,

I looked at the other definitions in mbuf.h, according the documentation,
If nothing is mentioned it is treated as inner if the packet is
tunneled else it is outer most. So I would like avoid confusion by
adding "inner" in the exiting PKT_RX_L4_CKSUM_MASK comment.
Technically it is not correct to say "inner" if the packet is not
tunneled. So I am untouching the exiting comment.


> 
> >
> >
> > Plus one nit below.
> >
> >
> >
> > ---
> >
> > v2:
> > - Removed DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM
> > as there is no realworld use case for it.
> > See: http://patches.dpdk.org/patch/44692/
> >
> > This patch series is depended on http://patches.dpdk.org/patch/45840/
> >
> > --
> > app/test-pmd/config.c          | 9 +++++++++
> > doc/guides/nics/features.rst   | 3 +++
> > lib/librte_ethdev/rte_ethdev.c | 1 +
> > lib/librte_ethdev/rte_ethdev.h | 1 +
> > lib/librte_mbuf/rte_mbuf.c     | 2 ++
> > lib/librte_mbuf/rte_mbuf.h     | 3 +++
> > 6 files changed, 19 insertions(+)
> >
> > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> > index 1adc9b94b..d53c527e5 100644
> > --- a/app/test-pmd/config.c
> > +++ b/app/test-pmd/config.c
> > @@ -594,6 +594,15 @@ port_offload_cap_display(portid_t port_id)
> >                        printf("off\n");
> >        }
> >
> > +       if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_UDP_CKSUM) {
> > +               printf("RX Outer UDP checksum:               ");
> > +               if (ports[port_id].dev_conf.rxmode.offloads &
> > +                   DEV_RX_OFFLOAD_OUTER_UDP_CKSUM)
> > +                       printf("on\n");
> > +               else
> > +                       printf("off\n");
> > +       }
> > +
> >        if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {
> >                printf("Large receive offload:         ");
> >                if (ports[port_id].dev_conf.rxmode.offloads &
> > diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
> > index d42489b6d..2c2959e0b 100644
> > --- a/doc/guides/nics/features.rst
> > +++ b/doc/guides/nics/features.rst
> > @@ -639,6 +639,9 @@ Inner L4 checksum
> >
> > Supports inner packet L4 checksum.
> >
> > +* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``.
> > +* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EL4_CKSUM_BAD``.
> > +* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``,
> >
> >
> > One more empty line should be added here to have two empty lines between features.
> 
> OK.
> 
> Thanks for the review.
> 
> >
> > Andrew.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03 17:12       ` Jerin Jacob
@ 2018-10-03 18:00         ` Andrew Rybchenko
  2018-10-03 18:14           ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Andrew Rybchenko @ 2018-10-03 18:00 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Olivier Matz,
	dev, shahafs, Ananyev, Konstantin


On 03.10.2018 20:12, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Wed, 3 Oct 2018 13:27:13 +0530
>> From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>> To: Andrew Rybchenko <arybchenko@solarflare.com>
>> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>>   Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>>   <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>   Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>   <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
>>   dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>   <konstantin.ananyev@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>   checksum definition
>> User-Agent: Mutt/1.10.1 (2018-07-13)
>>
>> External Email
>>
>> -----Original Message-----
>>> Date: Wed, 3 Oct 2018 10:34:52 +0300
>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>>>   <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>>>   Iremonger <bernard.iremonger@intel.com>, John McNamara
>>>   <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>>   Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>>   <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>
>>> CC: dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>>   <konstantin.ananyev@intel.com>
>>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>>   checksum definition
>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
>>>   Thunderbird/60.0
>>>
>>>
>>> On 10/2/18 10:24 PM, Jerin Jacob wrote:
>>>
>>> Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
>>> PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
>>> failure.
>>>
>>> - To use hardware Rx outer UDP checksum offload, the user needs to
>>> configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
>>>
>>> - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
>>> similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
>>>
>>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com><mailto:jerin.jacob@caviumnetworks.com>
>>>
>>> 1. I'm not sure that it is OK that mbuf and ethdev changes go in one patch.
>>>     It seems typically mbuf changes go separately and mbuf changes should
>>>     be applied to main dpdk repo.
>>
>> I don't have strong opinion on this. If there are no other objection, I
>> will split the patch further as mbuf and ethdev as you pointed out.
>>
>>> 2. I'd like to see thought why single bit is used for outer L2 checksum when
>>>     2 bits (UNKNOWN, BAD, GOOD, NONE) are used for PKT_RX_L4_CKSUM.
>>>     May be it is OK, but it would be useful to state explicitly why it is decided
>>>     to go this way.
>> I am following the scheme similar to OUTER IP checksum where we have only
>> one bit filed(PKT_RX_EIP_CKSUM_BAD). I will mention in the git commit.
>>
>>
>>> 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
>>>     May be it is not directly related to changeset, but I think it would be really
>>>     useful to clarify it.
>> I will update the comment.
> Hi Andrew,
>
> I looked at the other definitions in mbuf.h, according the documentation,
> If nothing is mentioned it is treated as inner if the packet is
> tunneled else it is outer most. So I would like avoid confusion by
> adding "inner" in the exiting PKT_RX_L4_CKSUM_MASK comment.
> Technically it is not correct to say "inner" if the packet is not
> tunneled. So I am untouching the exiting comment.
>

Yes, it is incorrect to say that it is inner. How does application find
how to treat PKT_RX_L4_CKSUM (inner or outer)?
Should it rely on packet type provided in mbuf?
Is it specified/mentioned somewhere?

Andrew.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03 18:00         ` Andrew Rybchenko
@ 2018-10-03 18:14           ` Jerin Jacob
  2018-10-03 19:47             ` Andrew Rybchenko
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-03 18:14 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Olivier Matz,
	dev, shahafs, Ananyev, Konstantin

-----Original Message-----
> Date: Wed, 3 Oct 2018 21:00:37 +0300
> From: Andrew Rybchenko <arybchenko@solarflare.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>  Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>  <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
>  dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>  <konstantin.ananyev@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum definition
> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
>  Thunderbird/52.9.1
> 
> On 03.10.2018 20:12, Jerin Jacob wrote:
> > -----Original Message-----
> > > Date: Wed, 3 Oct 2018 13:27:13 +0530
> > > From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > > To: Andrew Rybchenko <arybchenko@solarflare.com>
> > > CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
> > >   Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
> > >   <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
> > >   Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
> > >   <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
> > >   dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
> > >   <konstantin.ananyev@intel.com>
> > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> > >   checksum definition
> > > User-Agent: Mutt/1.10.1 (2018-07-13)
> > > 
> > > External Email
> > > 
> > > -----Original Message-----
> > > > Date: Wed, 3 Oct 2018 10:34:52 +0300
> > > > From: Andrew Rybchenko <arybchenko@solarflare.com>
> > > > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
> > > >   <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
> > > >   Iremonger <bernard.iremonger@intel.com>, John McNamara
> > > >   <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
> > > >   Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
> > > >   <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>
> > > > CC: dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
> > > >   <konstantin.ananyev@intel.com>
> > > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> > > >   checksum definition
> > > > User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
> > > >   Thunderbird/60.0
> > > > 
> > > > 
> > > > On 10/2/18 10:24 PM, Jerin Jacob wrote:
> > > > 
> > > > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> > > > PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> > > > failure.
> > > > 
> > > > - To use hardware Rx outer UDP checksum offload, the user needs to
> > > > configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> > > > 
> > > > - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> > > > similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> > > > 
> > > > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com><mailto:jerin.jacob@caviumnetworks.com>
> > > > 
> > > > 1. I'm not sure that it is OK that mbuf and ethdev changes go in one patch.
> > > >     It seems typically mbuf changes go separately and mbuf changes should
> > > >     be applied to main dpdk repo.
> > > 
> > > I don't have strong opinion on this. If there are no other objection, I
> > > will split the patch further as mbuf and ethdev as you pointed out.
> > > 
> > > > 2. I'd like to see thought why single bit is used for outer L2 checksum when
> > > >     2 bits (UNKNOWN, BAD, GOOD, NONE) are used for PKT_RX_L4_CKSUM.
> > > >     May be it is OK, but it would be useful to state explicitly why it is decided
> > > >     to go this way.
> > > I am following the scheme similar to OUTER IP checksum where we have only
> > > one bit filed(PKT_RX_EIP_CKSUM_BAD). I will mention in the git commit.
> > > 
> > > 
> > > > 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
> > > >     May be it is not directly related to changeset, but I think it would be really
> > > >     useful to clarify it.
> > > I will update the comment.
> > Hi Andrew,
> > 
> > I looked at the other definitions in mbuf.h, according the documentation,
> > If nothing is mentioned it is treated as inner if the packet is
> > tunneled else it is outer most. So I would like avoid confusion by
> > adding "inner" in the exiting PKT_RX_L4_CKSUM_MASK comment.
> > Technically it is not correct to say "inner" if the packet is not
> > tunneled. So I am untouching the exiting comment.
> > 
> 
> Yes, it is incorrect to say that it is inner. How does application find
> how to treat PKT_RX_L4_CKSUM (inner or outer)?
> Should it rely on packet type provided in mbuf?

AFAIK, Finding is it a tunneled packet or not is through ptype or SW has
to parse the packet. For example, testpmd chooses later method using
"csum parse-tunnel on <port>" to detect the presence of the tunnel.

> Is it specified/mentioned somewhere?

I don't know. It it not directly related to this change set, Olivier may know
additional details.

> 
> Andrew.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v3 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-09-13 13:47 [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support Jerin Jacob
                   ` (6 preceding siblings ...)
  2018-10-02 19:24 ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
@ 2018-10-03 18:16 ` Jerin Jacob
  2018-10-03 18:16   ` [dpdk-dev] [PATCH v3 2/4] ethdev: add Tx " Jerin Jacob
                     ` (3 more replies)
  7 siblings, 4 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-03 18:16 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz
  Cc: dev, shahafs, Jerin Jacob

Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
failure.

- To use hardware Rx outer UDP checksum offload, the user needs to
configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.

- Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---

This patch series is depended on http://patches.dpdk.org/patch/45840/

v3:
- Mention in git commit log that PKT_RX_EL4_CKSUM_BAD based one bit scheme
selected based on exiting outer L3 PKT_RX_EIP_CKSUM_BAD one bit flag scheme.

- Removed extra empty line in features.rst (Andrew Rybchenko)

v2:
- Removed DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM
as there is no realworld use case for it.
See: http://patches.dpdk.org/patch/44692/

--
 app/test-pmd/config.c          | 9 +++++++++
 doc/guides/nics/features.rst   | 4 ++++
 lib/librte_ethdev/rte_ethdev.c | 1 +
 lib/librte_ethdev/rte_ethdev.h | 1 +
 lib/librte_mbuf/rte_mbuf.c     | 2 ++
 lib/librte_mbuf/rte_mbuf.h     | 3 +++
 6 files changed, 20 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1adc9b94b..d53c527e5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -594,6 +594,15 @@ port_offload_cap_display(portid_t port_id)
 			printf("off\n");
 	}
 
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_UDP_CKSUM) {
+		printf("RX Outer UDP checksum:               ");
+		if (ports[port_id].dev_conf.rxmode.offloads &
+		    DEV_RX_OFFLOAD_OUTER_UDP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
 	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {
 		printf("Large receive offload:         ");
 		if (ports[port_id].dev_conf.rxmode.offloads &
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index d42489b6d..266c9f14b 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -639,6 +639,10 @@ Inner L4 checksum
 
 Supports inner packet L4 checksum.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EL4_CKSUM_BAD``.
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``,
+
 
 .. _nic_features_packet_type_parsing:
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index e9a82fe7f..a630c4fda 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -127,6 +127,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d02db14ad..821d371c3 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -889,6 +889,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SECURITY         0x00008000
 #define DEV_RX_OFFLOAD_KEEP_CRC		0x00010000
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
+#define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index e714c5a59..022e92b3c 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -301,6 +301,7 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask)
 	case PKT_RX_TIMESTAMP: return "PKT_RX_TIMESTAMP";
 	case PKT_RX_SEC_OFFLOAD: return "PKT_RX_SEC_OFFLOAD";
 	case PKT_RX_SEC_OFFLOAD_FAILED: return "PKT_RX_SEC_OFFLOAD_FAILED";
+	case PKT_RX_EL4_CKSUM_BAD: return "PKT_RX_EL4_CKSUM_BAD";
 	default: return NULL;
 	}
 }
@@ -339,6 +340,7 @@ rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		{ PKT_RX_SEC_OFFLOAD, PKT_RX_SEC_OFFLOAD, NULL },
 		{ PKT_RX_SEC_OFFLOAD_FAILED, PKT_RX_SEC_OFFLOAD_FAILED, NULL },
 		{ PKT_RX_QINQ, PKT_RX_QINQ, NULL },
+		{ PKT_RX_EL4_CKSUM_BAD, PKT_RX_EL4_CKSUM_BAD, NULL },
 	};
 	const char *name;
 	unsigned int i;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index eb11779e7..5c03e98b3 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -177,6 +177,9 @@ extern "C" {
  */
 #define PKT_RX_QINQ          (1ULL << 20)
 
+/**< External/Outer Layer4 header checksum error. */
+#define PKT_RX_EL4_CKSUM_BAD (1ULL << 21)
+
 /* add new RX flags here */
 
 /* add new TX flags here */
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v3 2/4] ethdev: add Tx offload outer UDP checksum definition
  2018-10-03 18:16 ` [dpdk-dev] [PATCH v3 " Jerin Jacob
@ 2018-10-03 18:16   ` Jerin Jacob
  2018-10-03 18:16   ` [dpdk-dev] [PATCH v3 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-03 18:16 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz
  Cc: dev, shahafs, Jerin Jacob

Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and
PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer UDP
checksum offload.

To use hardware Tx outer UDP checksum offload, the user needs to,

- enable following in mbuf:
a) fill outer_l2_len and outer_l3_len in mbuf
b) set the PKT_TX_OUTER_UDP_CKSUM flag
c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6

- configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---

v3:

- Git comment corrections (Andrew Rybchenko)
s/PKT_TX_OUTER_TCP_CKSUM/PKT_TX_OUTER_UDP_CKSUM/g
s/mbuff/mbuf/g

v2:
- Removed DEV_TX_OFFLOAD_OUTER_TCP_CKSUM and DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM
as there is no realworld use case for it.
See: http://patches.dpdk.org/patch/44692/

This patch series is depended on http://patches.dpdk.org/patch/45840/

---
 app/test-pmd/config.c          | 10 ++++++++++
 doc/guides/nics/features.rst   |  5 +++++
 lib/librte_ethdev/rte_ethdev.c |  1 +
 lib/librte_ethdev/rte_ethdev.h |  2 ++
 lib/librte_mbuf/rte_mbuf.c     |  1 +
 lib/librte_mbuf/rte_mbuf.h     |  6 +++++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index d53c527e5..5d9745ae5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -773,6 +773,16 @@ port_offload_cap_display(portid_t port_id)
 		else
 			printf("off\n");
 	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
+		printf("TX Outer UDP checksum:               ");
+		if (ports[port_id].dev_conf.txmode.offloads &
+		    DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
 }
 
 int
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 266c9f14b..1390e9668 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -640,8 +640,13 @@ Inner L4 checksum
 Supports inner packet L4 checksum.
 
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM``.
+* **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_OUTER_IPV4`` | ``PKT_TX_OUTER_IPV6``.
+  ``mbuf.ol_flags:PKT_TX_OUTER_UDP_CKSUM``.
+* **[uses]     mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EL4_CKSUM_BAD``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``,
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM``.
 
 
 .. _nic_features_packet_type_parsing:
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index a630c4fda..bb48b5a0f 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -159,6 +159,7 @@ static const struct {
 	RTE_TX_OFFLOAD_BIT2STR(SECURITY),
 	RTE_TX_OFFLOAD_BIT2STR(UDP_TNL_TSO),
 	RTE_TX_OFFLOAD_BIT2STR(IP_TNL_TSO),
+	RTE_TX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 };
 
 #undef RTE_TX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 821d371c3..79d0bb1ed 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -944,6 +944,8 @@ struct rte_eth_conf {
  * for tunnel TSO.
  */
 #define DEV_TX_OFFLOAD_IP_TNL_TSO       0x00080000
+/** Device supports outer UDP checksum */
+#define DEV_TX_OFFLOAD_OUTER_UDP_CKSUM  0x00100000
 
 #define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001
 /**< Device supports Rx queue setup after device started*/
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 022e92b3c..9db4317ef 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -437,6 +437,7 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		  "PKT_TX_TUNNEL_NONE" },
 		{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
 		{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
+		{ PKT_TX_OUTER_UDP_CKSUM, PKT_TX_OUTER_UDP_CKSUM, NULL },
 	};
 	const char *name;
 	unsigned int i;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 5c03e98b3..0a2de50ca 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -184,6 +184,9 @@ extern "C" {
 
 /* add new TX flags here */
 
+/**< Outer UDP cksum of TX pkt. computed by NIC. */
+#define PKT_TX_OUTER_UDP_CKSUM     (1ULL << 41)
+
 /**
  * UDP Fragmentation Offload flag. This flag is used for enabling UDP
  * fragmentation in SW or in HW. When use UFO, mbuf->tso_segsz is used
@@ -351,7 +354,8 @@ extern "C" {
 		PKT_TX_TUNNEL_MASK |	 \
 		PKT_TX_MACSEC |		 \
 		PKT_TX_SEC_OFFLOAD |	\
-		PKT_TX_UDP_SEG)
+		PKT_TX_UDP_SEG |	\
+		PKT_TX_OUTER_UDP_CKSUM)
 
 /**
  * Mbuf having an external buffer attached. shinfo in mbuf must be filled.
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v3 3/4] app/testpmd: add outer UDP HW checksum support
  2018-10-03 18:16 ` [dpdk-dev] [PATCH v3 " Jerin Jacob
  2018-10-03 18:16   ` [dpdk-dev] [PATCH v3 2/4] ethdev: add Tx " Jerin Jacob
@ 2018-10-03 18:16   ` Jerin Jacob
  2018-10-03 18:16   ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
  2018-10-08 16:09   ` [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
  3 siblings, 0 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-03 18:16 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic
  Cc: dev, shahafs, Jerin Jacob

Added outer-udp Tx HW checksum support for csum forward engine
if device supports DEV_TX_OFFLOAD_OUTER_UDP_CKSUM.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---

v3:
- Added Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

v2:
- Added outer-udp support for csum engine
---
 app/test-pmd/cmdline.c                      | 24 ++++++++++++++++++---
 app/test-pmd/csumonly.c                     | 13 +++++++++--
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  8 +++++--
 3 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0c5399dc4..2fd007423 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -397,12 +397,13 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"    Disable hardware insertion of a VLAN header in"
 			" packets sent on a port.\n\n"
 
-			"csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)\n"
+			"csum set (ip|udp|tcp|sctp|outer-ip|outer-udp) (hw|sw) (port_id)\n"
 			"    Select hardware or software calculation of the"
 			" checksum when transmitting a packet using the"
 			" csum forward engine.\n"
 			"    ip|udp|tcp|sctp always concern the inner layer.\n"
 			"    outer-ip concerns the outer IP layer in"
+			"    outer-udp concerns the outer UDP layer in"
 			" case the packet is recognized as a tunnel packet by"
 			" the forward engine (vxlan, gre and ipip are supported)\n"
 			"    Please check the NIC datasheet for HW limits.\n\n"
@@ -4177,6 +4178,8 @@ csum_show(int port_id)
 		(tx_offloads & DEV_TX_OFFLOAD_SCTP_CKSUM) ? "hw" : "sw");
 	printf("Outer-Ip checksum offload is %s\n",
 		(tx_offloads & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ? "hw" : "sw");
+	printf("Outer-Udp checksum offload is %s\n",
+		(tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ? "hw" : "sw");
 
 	/* display warnings if configuration is not supported by the NIC */
 	rte_eth_dev_info_get(port_id, &dev_info);
@@ -4205,6 +4208,12 @@ csum_show(int port_id)
 		printf("Warning: hardware outer IP checksum enabled but not "
 			"supported by port %d\n", port_id);
 	}
+	if ((tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) &&
+		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
+			== 0) {
+		printf("Warning: hardware outer UDP checksum enabled but not "
+			"supported by port %d\n", port_id);
+	}
 }
 
 static void
@@ -4273,6 +4282,15 @@ cmd_csum_parsed(void *parsed_result,
 				printf("Outer IP checksum offload is not "
 				       "supported by port %u\n", res->port_id);
 			}
+		} else if (!strcmp(res->proto, "outer-udp")) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+					DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)) {
+				csum_offloads |=
+						DEV_TX_OFFLOAD_OUTER_UDP_CKSUM;
+			} else {
+				printf("Outer UDP checksum offload is not "
+				       "supported by port %u\n", res->port_id);
+			}
 		}
 
 		if (hw) {
@@ -4296,7 +4314,7 @@ cmdline_parse_token_string_t cmd_csum_mode =
 				mode, "set");
 cmdline_parse_token_string_t cmd_csum_proto =
 	TOKEN_STRING_INITIALIZER(struct cmd_csum_result,
-				proto, "ip#tcp#udp#sctp#outer-ip");
+				proto, "ip#tcp#udp#sctp#outer-ip#outer-udp");
 cmdline_parse_token_string_t cmd_csum_hwsw =
 	TOKEN_STRING_INITIALIZER(struct cmd_csum_result,
 				hwsw, "hw#sw");
@@ -4307,7 +4325,7 @@ cmdline_parse_token_num_t cmd_csum_portid =
 cmdline_parse_inst_t cmd_csum_set = {
 	.f = cmd_csum_parsed,
 	.data = NULL,
-	.help_str = "csum set ip|tcp|udp|sctp|outer-ip hw|sw <port_id>: "
+	.help_str = "csum set ip|tcp|udp|sctp|outer-ip|outer-udp hw|sw <port_id>: "
 		"Enable/Disable hardware calculation of L3/L4 checksum when "
 		"using csum forward engine",
 	.tokens = {
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 494829266..ea5b112d6 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -468,10 +468,15 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
 	if (info->outer_l4_proto != IPPROTO_UDP)
 		return ol_flags;
 
+	/* Skip SW outer UDP checksum generation if HW supports it */
+	if (tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
+		ol_flags |= PKT_TX_OUTER_UDP_CKSUM;
+		return ol_flags;
+	}
+
 	udp_hdr = (struct udp_hdr *)((char *)outer_l3_hdr + info->outer_l3_len);
 
-	/* outer UDP checksum is done in software as we have no hardware
-	 * supporting it today, and no API for it. In the other side, for
+	/* outer UDP checksum is done in software. In the other side, for
 	 * UDP tunneling, like VXLAN or Geneve, outer UDP checksum can be
 	 * set to zero.
 	 *
@@ -826,6 +831,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			if (info.tunnel_tso_segsz ||
 			    (tx_offloads &
 			     DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
+			    (tx_offloads &
+			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
 			    (tx_ol_flags & PKT_TX_OUTER_IPV6)) {
 				m->outer_l2_len = info.outer_l2_len;
 				m->outer_l3_len = info.outer_l3_len;
@@ -898,6 +905,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			if (info.is_tunnel == 1) {
 				if ((tx_offloads &
 				    DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
+				    (tx_offloads &
+				    DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
 				    (tx_ol_flags & PKT_TX_OUTER_IPV6))
 					printf("tx: m->outer_l2_len=%d "
 						"m->outer_l3_len=%d\n",
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 3a73000a6..cfcabf6f0 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -857,7 +857,7 @@ csum set
 Select hardware or software calculation of the checksum when
 transmitting a packet using the ``csum`` forwarding engine::
 
-   testpmd> csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)
+   testpmd> csum set (ip|udp|tcp|sctp|outer-ip|outer-udp) (hw|sw) (port_id)
 
 Where:
 
@@ -867,6 +867,10 @@ Where:
   as a tunnel packet by the forwarding engine (vxlan, gre and ipip are
   supported). See also the ``csum parse-tunnel`` command.
 
+* ``outer-udp`` relates to the outer UDP layer in the case where the packet is recognized
+  as a tunnel packet by the forwarding engine (vxlan, vxlan-gpe are
+  supported). See also the ``csum parse-tunnel`` command.
+
 .. note::
 
    Check the NIC Datasheet for hardware limits.
@@ -940,7 +944,7 @@ Consider a packet in packet like the following::
 
 * If parse-tunnel is enabled, the ``ip|udp|tcp|sctp`` parameters of ``csum set``
   command relate to the inner headers (here ``ipv4_in`` and ``tcp_in``), and the
-  ``outer-ip parameter`` relates to the outer headers (here ``ipv4_out``).
+  ``outer-ip|outer-udp`` parameter relates to the outer headers (here ``ipv4_out`` and ``udp_out``).
 
 * If parse-tunnel is disabled, the ``ip|udp|tcp|sctp`` parameters of ``csum  set``
    command relate to the outer headers, here ``ipv4_out`` and ``udp_out``.
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4 checksum for csum engine
  2018-10-03 18:16 ` [dpdk-dev] [PATCH v3 " Jerin Jacob
  2018-10-03 18:16   ` [dpdk-dev] [PATCH v3 2/4] ethdev: add Tx " Jerin Jacob
  2018-10-03 18:16   ` [dpdk-dev] [PATCH v3 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
@ 2018-10-03 18:16   ` Jerin Jacob
  2018-10-04 13:45     ` Iremonger, Bernard
  2018-10-08 16:09   ` [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
  3 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-03 18:16 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger; +Cc: dev, shahafs, Jerin Jacob

Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD
errors.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
v3:
- Added Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
- Removed unnecessary extra empty line(Andrew Rybchenko)
- Simplify calculation rx_bad_outer_l4_csum logic(Andrew Rybchenko)

v2:
- Added PKT_RX_EL4_CKSUM_BAD statistics

---
 app/test-pmd/csumonly.c |  5 +++++
 app/test-pmd/testpmd.c  | 18 +++++++++++++-----
 app/test-pmd/testpmd.h  |  4 ++++
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index ea5b112d6..312b7e1e3 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -701,6 +701,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	uint32_t retry;
 	uint32_t rx_bad_ip_csum;
 	uint32_t rx_bad_l4_csum;
+	uint32_t rx_bad_outer_l4_csum;
 	struct testpmd_offload_info info;
 	uint16_t nb_segments = 0;
 	int ret;
@@ -726,6 +727,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	fs->rx_packets += nb_rx;
 	rx_bad_ip_csum = 0;
 	rx_bad_l4_csum = 0;
+	rx_bad_outer_l4_csum = 0;
 	gro_enable = gro_ports[fs->rx_port].enable;
 
 	txp = &ports[fs->tx_port];
@@ -753,6 +755,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			rx_bad_ip_csum += 1;
 		if ((rx_ol_flags & PKT_RX_L4_CKSUM_MASK) == PKT_RX_L4_CKSUM_BAD)
 			rx_bad_l4_csum += 1;
+		if (rx_ol_flags & PKT_RX_EL4_CKSUM_BAD)
+			rx_bad_outer_l4_csum += 1;
 
 		/* step 1: dissect packet, parsing optional vlan, ip4/ip6, vxlan
 		 * and inner headers */
@@ -991,6 +995,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	fs->tx_packets += nb_tx;
 	fs->rx_bad_ip_csum += rx_bad_ip_csum;
 	fs->rx_bad_l4_csum += rx_bad_l4_csum;
+	fs->rx_bad_outer_l4_csum += rx_bad_outer_l4_csum;
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 	fs->tx_burst_stats.pkt_burst_spread[nb_tx]++;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 001f0e552..2a641fcfe 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1040,8 +1040,9 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
-			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64" \n",
-			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",
+			       port->rx_bad_ip_csum, port->rx_bad_l4_csum,
+			       port->rx_bad_outer_l4_csum);
 		if ((stats->ierrors + stats->rx_nombuf) > 0) {
 			printf("  RX-error: %-"PRIu64"\n",  stats->ierrors);
 			printf("  RX-nombufs: %-14"PRIu64"\n", stats->rx_nombuf);
@@ -1059,8 +1060,9 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
-			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"\n",
-			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"    Bad-outer-l4csum: %-14"PRIu64"\n",
+			       port->rx_bad_ip_csum, port->rx_bad_l4_csum,
+			       port->rx_bad_outer_l4_csum);
 		if ((stats->ierrors + stats->rx_nombuf) > 0) {
 			printf("  RX-error:%"PRIu64"\n", stats->ierrors);
 			printf("  RX-nombufs:             %14"PRIu64"\n",
@@ -1124,7 +1126,9 @@ fwd_stream_stats_display(streamid_t stream_id)
 	/* if checksum mode */
 	if (cur_fwd_eng == &csum_fwd_engine) {
 	       printf("  RX- bad IP checksum: %-14u  Rx- bad L4 checksum: "
-			"%-14u\n", fs->rx_bad_ip_csum, fs->rx_bad_l4_csum);
+			"%-14u Rx- bad outer L4 checksum: %-14u\n",
+			fs->rx_bad_ip_csum, fs->rx_bad_l4_csum,
+			fs->rx_bad_outer_l4_csum);
 	}
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
@@ -1378,6 +1382,7 @@ start_packet_forwarding(int with_tx_first)
 		fwd_streams[sm_id]->fwd_dropped = 0;
 		fwd_streams[sm_id]->rx_bad_ip_csum = 0;
 		fwd_streams[sm_id]->rx_bad_l4_csum = 0;
+		fwd_streams[sm_id]->rx_bad_outer_l4_csum = 0;
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 		memset(&fwd_streams[sm_id]->rx_burst_stats, 0,
@@ -1483,6 +1488,9 @@ stop_packet_forwarding(void)
 		ports[fwd_streams[sm_id]->rx_port].rx_bad_l4_csum =
 							rx_bad_l4_csum;
 
+		ports[fwd_streams[sm_id]->rx_port].rx_bad_outer_l4_csum +=
+				fwd_streams[sm_id]->rx_bad_outer_l4_csum;
+
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 		fwd_cycles = (uint64_t) (fwd_cycles +
 					 fwd_streams[sm_id]->core_cycles);
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index a1f661472..106aeefc2 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -112,6 +112,8 @@ struct fwd_stream {
 	unsigned int fwd_dropped; /**< received packets not forwarded */
 	unsigned int rx_bad_ip_csum ; /**< received packets has bad ip checksum */
 	unsigned int rx_bad_l4_csum ; /**< received packets has bad l4 checksum */
+	unsigned int rx_bad_outer_l4_csum;
+	/**< received packets has bad outer l4 checksum */
 	unsigned int gro_times;	/**< GRO operation times */
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 	uint64_t     core_cycles; /**< used for RX and TX processing */
@@ -165,6 +167,8 @@ struct rte_port {
 	void                    *fwd_ctx;   /**< Forwarding mode context */
 	uint64_t                rx_bad_ip_csum; /**< rx pkts with bad ip checksum  */
 	uint64_t                rx_bad_l4_csum; /**< rx pkts with bad l4 checksum */
+	uint64_t                rx_bad_outer_l4_csum;
+	/**< rx pkts with bad outer l4 checksum */
 	uint8_t                 tx_queue_stats_mapping_enabled;
 	uint8_t                 rx_queue_stats_mapping_enabled;
 	volatile uint16_t        port_status;    /**< port started or not */
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] ethdev: add SCTP Rx checksum offload support
  2018-10-02 10:51 ` [dpdk-dev] [PATCH v2 1/2] " Jerin Jacob
  2018-10-02 10:51   ` [dpdk-dev] [PATCH v2 2/2] mbuf: fix Tx offload mask Jerin Jacob
@ 2018-10-03 18:52   ` Ferruh Yigit
  1 sibling, 0 replies; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-03 18:52 UTC (permalink / raw)
  To: Jerin Jacob, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	John McNamara, Marko Kovacevic, Thomas Monjalon,
	Andrew Rybchenko
  Cc: dev

On 10/2/2018 11:51 AM, Jerin Jacob wrote:
> Added SCTP Rx checksum offload support
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03 18:14           ` Jerin Jacob
@ 2018-10-03 19:47             ` Andrew Rybchenko
  2018-10-03 20:08               ` Thomas Monjalon
  2018-10-04  5:59               ` Jerin Jacob
  0 siblings, 2 replies; 87+ messages in thread
From: Andrew Rybchenko @ 2018-10-03 19:47 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Olivier Matz,
	dev, shahafs, Ananyev, Konstantin

Hi Jerin,

On 03.10.2018 21:14, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Wed, 3 Oct 2018 21:00:37 +0300
>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>>   Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>>   <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>   Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>   <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
>>   dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>   <konstantin.ananyev@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>   checksum definition
>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
>>   Thunderbird/52.9.1
>>
>> On 03.10.2018 20:12, Jerin Jacob wrote:
>>> -----Original Message-----
>>>> Date: Wed, 3 Oct 2018 13:27:13 +0530
>>>> From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>>>> To: Andrew Rybchenko <arybchenko@solarflare.com>
>>>> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>>>>    Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>>>>    <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>>>    Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>>>    <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
>>>>    dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>>>    <konstantin.ananyev@intel.com>
>>>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>>>    checksum definition
>>>> User-Agent: Mutt/1.10.1 (2018-07-13)
>>>>
>>>> External Email
>>>>
>>>> -----Original Message-----
>>>>> Date: Wed, 3 Oct 2018 10:34:52 +0300
>>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>>>>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>>>>>    <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>>>>>    Iremonger <bernard.iremonger@intel.com>, John McNamara
>>>>>    <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>>>>    Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>>>>    <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>
>>>>> CC: dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>>>>    <konstantin.ananyev@intel.com>
>>>>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>>>>    checksum definition
>>>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
>>>>>    Thunderbird/60.0
>>>>>
>>>>>
>>>>> On 10/2/18 10:24 PM, Jerin Jacob wrote:
>>>>>
>>>>> Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
>>>>> PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
>>>>> failure.
>>>>>
>>>>> - To use hardware Rx outer UDP checksum offload, the user needs to
>>>>> configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
>>>>>
>>>>> - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
>>>>> similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
>>>>>
>>>>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com><mailto:jerin.jacob@caviumnetworks.com>
>>>>>
>>>>> 1. I'm not sure that it is OK that mbuf and ethdev changes go in one patch.
>>>>>      It seems typically mbuf changes go separately and mbuf changes should
>>>>>      be applied to main dpdk repo.
>>>> I don't have strong opinion on this. If there are no other objection, I
>>>> will split the patch further as mbuf and ethdev as you pointed out.
>>>>
>>>>> 2. I'd like to see thought why single bit is used for outer L2 checksum when
>>>>>      2 bits (UNKNOWN, BAD, GOOD, NONE) are used for PKT_RX_L4_CKSUM.
>>>>>      May be it is OK, but it would be useful to state explicitly why it is decided
>>>>>      to go this way.
>>>> I am following the scheme similar to OUTER IP checksum where we have only
>>>> one bit filed(PKT_RX_EIP_CKSUM_BAD). I will mention in the git commit.
>>>>
>>>>
>>>>> 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
>>>>>      May be it is not directly related to changeset, but I think it would be really
>>>>>      useful to clarify it.
>>>> I will update the comment.
>>> Hi Andrew,
>>>
>>> I looked at the other definitions in mbuf.h, according the documentation,
>>> If nothing is mentioned it is treated as inner if the packet is
>>> tunneled else it is outer most. So I would like avoid confusion by
>>> adding "inner" in the exiting PKT_RX_L4_CKSUM_MASK comment.
>>> Technically it is not correct to say "inner" if the packet is not
>>> tunneled. So I am untouching the exiting comment.
>>>
>> Yes, it is incorrect to say that it is inner. How does application find
>> how to treat PKT_RX_L4_CKSUM (inner or outer)?
>> Should it rely on packet type provided in mbuf?
> AFAIK, Finding is it a tunneled packet or not is through ptype or SW has
> to parse the packet. For example, testpmd chooses later method using
> "csum parse-tunnel on <port>" to detect the presence of the tunnel.

SW parsing of the packet cannot help, since app should be sure
that HW has classified the packet as tunneled and provided information
about inner and outer checksum checks.

>> Is it specified/mentioned somewhere?
> I don't know. It it not directly related to this change set, Olivier may know
> additional details.

I disagree. You're adding one more offload flag. Yes, it simply follows
existing RX_EIP_CKSUM_BAD pattern. But, IMHO, RX_EIP_CKSUM_BAD
has many open questions. Why should these open questions be preserved
here? It is similar to the code with a bug which is cloned once again with
the bug :)

If everyone else is fine with the description of Rx checksum offloads and
it is only me who is unhappy with it - no problem.

Thanks for your patience and I'm sorry that I'm really boring with it.
My goal is just to make it clear and as the result have less bugs in
networking PMDs and applications.

Andrew.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03 19:47             ` Andrew Rybchenko
@ 2018-10-03 20:08               ` Thomas Monjalon
  2018-10-04  5:59               ` Jerin Jacob
  1 sibling, 0 replies; 87+ messages in thread
From: Thomas Monjalon @ 2018-10-03 20:08 UTC (permalink / raw)
  To: Andrew Rybchenko, Jerin Jacob
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Ferruh Yigit, Olivier Matz, dev, shahafs,
	Ananyev, Konstantin

03/10/2018 21:47, Andrew Rybchenko:
> On 03.10.2018 21:14, Jerin Jacob wrote:
> > From: Andrew Rybchenko <arybchenko@solarflare.com>
> >>> From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> >>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
> >>>>> On 10/2/18 10:24 PM, Jerin Jacob wrote:
> >>>>>
> >>>>> Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> >>>>> PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> >>>>> failure.
> >>>>>
> >>>>> - To use hardware Rx outer UDP checksum offload, the user needs to
> >>>>> configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> >>>>>
> >>>>> - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> >>>>> similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> >>>>>
> >>>>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com><mailto:jerin.jacob@caviumnetworks.com>
> >>>>>
> >>>>> 1. I'm not sure that it is OK that mbuf and ethdev changes go in one patch.
> >>>>>      It seems typically mbuf changes go separately and mbuf changes should
> >>>>>      be applied to main dpdk repo.
> >>>> I don't have strong opinion on this. If there are no other objection, I
> >>>> will split the patch further as mbuf and ethdev as you pointed out.
> >>>>
> >>>>> 2. I'd like to see thought why single bit is used for outer L2 checksum when
> >>>>>      2 bits (UNKNOWN, BAD, GOOD, NONE) are used for PKT_RX_L4_CKSUM.
> >>>>>      May be it is OK, but it would be useful to state explicitly why it is decided
> >>>>>      to go this way.
> >>>> I am following the scheme similar to OUTER IP checksum where we have only
> >>>> one bit filed(PKT_RX_EIP_CKSUM_BAD). I will mention in the git commit.
> >>>>
> >>>>
> >>>>> 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
> >>>>>      May be it is not directly related to changeset, but I think it would be really
> >>>>>      useful to clarify it.
> >>>> I will update the comment.
> >>> Hi Andrew,
> >>>
> >>> I looked at the other definitions in mbuf.h, according the documentation,
> >>> If nothing is mentioned it is treated as inner if the packet is
> >>> tunneled else it is outer most. So I would like avoid confusion by
> >>> adding "inner" in the exiting PKT_RX_L4_CKSUM_MASK comment.
> >>> Technically it is not correct to say "inner" if the packet is not
> >>> tunneled. So I am untouching the exiting comment.
> >>>
> >> Yes, it is incorrect to say that it is inner. How does application find
> >> how to treat PKT_RX_L4_CKSUM (inner or outer)?
> >> Should it rely on packet type provided in mbuf?
> > AFAIK, Finding is it a tunneled packet or not is through ptype or SW has
> > to parse the packet. For example, testpmd chooses later method using
> > "csum parse-tunnel on <port>" to detect the presence of the tunnel.
> 
> SW parsing of the packet cannot help, since app should be sure
> that HW has classified the packet as tunneled and provided information
> about inner and outer checksum checks.
> 
> >> Is it specified/mentioned somewhere?
> > I don't know. It it not directly related to this change set, Olivier may know
> > additional details.
> 
> I disagree. You're adding one more offload flag. Yes, it simply follows
> existing RX_EIP_CKSUM_BAD pattern. But, IMHO, RX_EIP_CKSUM_BAD
> has many open questions. Why should these open questions be preserved
> here? It is similar to the code with a bug which is cloned once again with
> the bug :)
> 
> If everyone else is fine with the description of Rx checksum offloads and
> it is only me who is unhappy with it - no problem.

I agree we must better define these checksum flags.

Olivier, please could you give your opinion here?

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/2] mbuf: fix Tx offload mask
  2018-10-02 10:51   ` [dpdk-dev] [PATCH v2 2/2] mbuf: fix Tx offload mask Jerin Jacob
@ 2018-10-04  2:31     ` Hu, Jiayu
  2018-10-04 16:05       ` Ferruh Yigit
  0 siblings, 1 reply; 87+ messages in thread
From: Hu, Jiayu @ 2018-10-04  2:31 UTC (permalink / raw)
  To: Jerin Jacob, Olivier Matz; +Cc: dev, stable



> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Tuesday, October 2, 2018 6:52 PM
> To: Olivier Matz <olivier.matz@6wind.com>
> Cc: dev@dpdk.org; Jerin Jacob <jerin.jacob@caviumnetworks.com>;
> stable@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>
> Subject: [dpdk-dev] [PATCH v2 2/2] mbuf: fix Tx offload mask
> 
> Fixes missing PKT_TX_UDP_SEG,
> PKT_TX_OUTER_IPV6,PKT_TX_OUTER_IPV4,
> PKT_TX_IPV6 and  PKT_TX_IPV4 values in PKT_TX_OFFLOAD_MASK.
> 
> Also sort them in bit wise order to recognize missing items later.
> 
> Fixes: 6d18505efaa6 ("vhost: support UDP Fragmentation Offload")
> Fixes: 1c3b7c33e977 ("mbuf: add Tx offloading flags for tunnels")
> Fixes: 711ba9e23e68 ("mbuf: remove aliasing of Tx offloading flags with Rx
> ones")
> Cc: stable@dpdk.org
> Cc: jiayu.hu@intel.com
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Acked-by: Jiayu Hu <jiayu.hu@intel.com>

Thanks,
Jiayu
> ---
> v2:
> - Add all missing PKT_TX_ types
> - Sort them in bit mask order(Ferruh Yigit)
> ---
>  lib/librte_mbuf/rte_mbuf.h | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index a50b05c64..c8ebc3230 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -334,16 +334,21 @@ extern "C" {
>   * which can be set for packet.
>   */
>  #define PKT_TX_OFFLOAD_MASK (    \
> +		PKT_TX_OUTER_IPV6 |	 \
> +		PKT_TX_OUTER_IPV4 |	 \
> +		PKT_TX_OUTER_IP_CKSUM |  \
> +		PKT_TX_VLAN_PKT |        \
> +		PKT_TX_IPV6 |		 \
> +		PKT_TX_IPV4 |		 \
>  		PKT_TX_IP_CKSUM |        \
>  		PKT_TX_L4_MASK |         \
> -		PKT_TX_OUTER_IP_CKSUM |  \
> -		PKT_TX_TCP_SEG |         \
>  		PKT_TX_IEEE1588_TMST |	 \
> +		PKT_TX_TCP_SEG |         \
>  		PKT_TX_QINQ_PKT |        \
> -		PKT_TX_VLAN_PKT |        \
>  		PKT_TX_TUNNEL_MASK |	 \
>  		PKT_TX_MACSEC |		 \
> -		PKT_TX_SEC_OFFLOAD)
> +		PKT_TX_SEC_OFFLOAD |	\
> +		PKT_TX_UDP_SEG)
> 
>  /**
>   * Mbuf having an external buffer attached. shinfo in mbuf must be filled.
> --
> 2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03 19:47             ` Andrew Rybchenko
  2018-10-03 20:08               ` Thomas Monjalon
@ 2018-10-04  5:59               ` Jerin Jacob
  2018-10-05 19:48                 ` Ferruh Yigit
  2018-10-05 20:04                 ` Ferruh Yigit
  1 sibling, 2 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-04  5:59 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Olivier Matz,
	dev, shahafs, Ananyev, Konstantin

-----Original Message-----
> Date: Wed, 3 Oct 2018 22:47:15 +0300
> From: Andrew Rybchenko <arybchenko@solarflare.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>  Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>  <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
>  dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>  <konstantin.ananyev@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum definition
> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
>  Thunderbird/52.9.1
> 
> 
> Hi Jerin,

Hi Andrew,

> 
> On 03.10.2018 21:14, Jerin Jacob wrote:
> > -----Original Message-----
> > > Date: Wed, 3 Oct 2018 21:00:37 +0300
> > > From: Andrew Rybchenko <arybchenko@solarflare.com>
> > > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > > CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
> > >   Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
> > >   <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
> > >   Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
> > >   <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
> > >   dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
> > >   <konstantin.ananyev@intel.com>
> > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> > >   checksum definition
> > > User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
> > >   Thunderbird/52.9.1
> > > 
> > > On 03.10.2018 20:12, Jerin Jacob wrote:
> > > > -----Original Message-----
> > > > > Date: Wed, 3 Oct 2018 13:27:13 +0530
> > > > > From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > > > > To: Andrew Rybchenko <arybchenko@solarflare.com>
> > > > > CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
> > > > >    Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
> > > > >    <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
> > > > >    Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
> > > > >    <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
> > > > >    dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
> > > > >    <konstantin.ananyev@intel.com>
> > > > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> > > > >    checksum definition
> > > > > User-Agent: Mutt/1.10.1 (2018-07-13)
> > > > > 
> > > > > External Email
> > > > > 
> > > > > -----Original Message-----
> > > > > > Date: Wed, 3 Oct 2018 10:34:52 +0300
> > > > > > From: Andrew Rybchenko <arybchenko@solarflare.com>
> > > > > > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
> > > > > >    <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
> > > > > >    Iremonger <bernard.iremonger@intel.com>, John McNamara
> > > > > >    <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
> > > > > >    Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
> > > > > >    <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>
> > > > > > CC: dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
> > > > > >    <konstantin.ananyev@intel.com>
> > > > > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> > > > > >    checksum definition
> > > > > > User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
> > > > > >    Thunderbird/60.0
> > > > > > 
> > > > > > 
> > > > > > On 10/2/18 10:24 PM, Jerin Jacob wrote:
> > > > > > 
> > > > > > Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> > > > > > PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
> > > > > > failure.
> > > > > > 
> > > > > > - To use hardware Rx outer UDP checksum offload, the user needs to
> > > > > > configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> > > > > > 
> > > > > > - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
> > > > > > similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
> > > > > > 
> > > > > > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com><mailto:jerin.jacob@caviumnetworks.com>
> > > > > > 
> > > > > > 1. I'm not sure that it is OK that mbuf and ethdev changes go in one patch.
> > > > > >      It seems typically mbuf changes go separately and mbuf changes should
> > > > > >      be applied to main dpdk repo.
> > > > > I don't have strong opinion on this. If there are no other objection, I
> > > > > will split the patch further as mbuf and ethdev as you pointed out.
> > > > > 
> > > > > > 2. I'd like to see thought why single bit is used for outer L2 checksum when
> > > > > >      2 bits (UNKNOWN, BAD, GOOD, NONE) are used for PKT_RX_L4_CKSUM.
> > > > > >      May be it is OK, but it would be useful to state explicitly why it is decided
> > > > > >      to go this way.
> > > > > I am following the scheme similar to OUTER IP checksum where we have only
> > > > > one bit filed(PKT_RX_EIP_CKSUM_BAD). I will mention in the git commit.
> > > > > 
> > > > > 
> > > > > > 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
> > > > > >      May be it is not directly related to changeset, but I think it would be really
> > > > > >      useful to clarify it.
> > > > > I will update the comment.
> > > > Hi Andrew,
> > > > 
> > > > I looked at the other definitions in mbuf.h, according the documentation,
> > > > If nothing is mentioned it is treated as inner if the packet is
> > > > tunneled else it is outer most. So I would like avoid confusion by
> > > > adding "inner" in the exiting PKT_RX_L4_CKSUM_MASK comment.
> > > > Technically it is not correct to say "inner" if the packet is not
> > > > tunneled. So I am untouching the exiting comment.
> > > > 
> > > Yes, it is incorrect to say that it is inner. How does application find
> > > how to treat PKT_RX_L4_CKSUM (inner or outer)?
> > > Should it rely on packet type provided in mbuf?
> > AFAIK, Finding is it a tunneled packet or not is through ptype or SW has
> > to parse the packet. For example, testpmd chooses later method using
> > "csum parse-tunnel on <port>" to detect the presence of the tunnel.
> 
> SW parsing of the packet cannot help, since app should be sure
> that HW has classified the packet as tunneled and provided information
> about inner and outer checksum checks.


I thought the question was, How does the application find how to treat
PKT_RX_L4_CKSUM (inner or outer)?
Obviously, ptype will help here
Not sure why SW parsing won't help here if SW parses and find it is an
inner packet or it is not a tunneled packet. PKT_RX_L4_CKSUM treat as
inner checksum for former case and PKT_RX_L4_CKSUM treated as plain l4
checksum in the latter case.

> 
> > > Is it specified/mentioned somewhere?
> > I don't know. It it not directly related to this change set, Olivier may know
> > additional details.
> 
> I disagree. You're adding one more offload flag. Yes, it simply follows
> existing RX_EIP_CKSUM_BAD pattern. But, IMHO, RX_EIP_CKSUM_BAD
> has many open questions. Why should these open questions be preserved
> here? It is similar to the code with a bug which is cloned once again with
> the bug :)


No disagreement here. I choose to follow the existing scheme, because if I
do another way around, still I will get the question on why it is different
than the outer IPV4 checksum scheme.

Looking at the history, the mbuf DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM change
went part of ixgbe change
d909af8f72ca ("ixgbe: offload VxLAN and NVGRE Rx checksum on X550").

Al east in the HW I know, We can support "two bit" fields for Outer IP
checksum and Outer L4 checksum.

So I think, the decision was made based on ixgbe capability or probably
no one noticed the change as the subject was ixgbe:

Anyway, i don't have strong preferences on 1 bit vs 2 bits. I think, 1
bit can be supported by all the HW if supports this feature. Leaving the
decision to ethdev and mbuf maintainers.

> 
> If everyone else is fine with the description of Rx checksum offloads and
> it is only me who is unhappy with it - no problem.
> 
> Thanks for your patience and I'm sorry that I'm really boring with it.
> My goal is just to make it clear and as the result have less bugs in
> networking PMDs and applications.

No problem. :-)


> 
> Andrew.
> 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4 checksum for csum engine
  2018-10-03 18:16   ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
@ 2018-10-04 13:45     ` Iremonger, Bernard
  2018-10-04 14:16       ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Iremonger, Bernard @ 2018-10-04 13:45 UTC (permalink / raw)
  To: Jerin Jacob, Lu, Wenzhuo, Wu, Jingjing; +Cc: dev, shahafs

Hi Jerin,

> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Wednesday, October 3, 2018 7:17 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org; shahafs@mellanox.com; Jerin Jacob
> <jerin.jacob@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4
> checksum for csum engine
> 
> Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD errors.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---

<snip>

The following checkpatch warnings should probably be fixed

WARNING:LONG_LINE: line over 80 characters
#86: FILE: app/test-pmd/testpmd.c:1043:
+                       printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",

WARNING:LONG_LINE: line over 80 characters
#98: FILE: app/test-pmd/testpmd.c:1063:
+                       printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"    Bad-outer-l4csum: %-14"PRIu64"\n",

Regards,

Bernard.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4 checksum for csum engine
  2018-10-04 13:45     ` Iremonger, Bernard
@ 2018-10-04 14:16       ` Jerin Jacob
  2018-10-04 15:06         ` Iremonger, Bernard
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-04 14:16 UTC (permalink / raw)
  To: Iremonger, Bernard; +Cc: Lu, Wenzhuo, Wu, Jingjing, dev, shahafs

-----Original Message-----
> Date: Thu, 4 Oct 2018 13:45:42 +0000
> From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, "Lu, Wenzhuo"
>  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>
> CC: "dev@dpdk.org" <dev@dpdk.org>, "shahafs@mellanox.com"
>  <shahafs@mellanox.com>
> Subject: RE: [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4
>  checksum for csum engine
> 
> Hi Jerin,

Hi Iremonger,

> 
> > -----Original Message-----
> > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > Sent: Wednesday, October 3, 2018 7:17 PM
> > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Iremonger, Bernard
> > <bernard.iremonger@intel.com>
> > Cc: dev@dpdk.org; shahafs@mellanox.com; Jerin Jacob
> > <jerin.jacob@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4
> > checksum for csum engine
> >
> > Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD errors.
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > ---
> 
> <snip>
> 
> The following checkpatch warnings should probably be fixed
> 
> WARNING:LONG_LINE: line over 80 characters
> #86: FILE: app/test-pmd/testpmd.c:1043:
> +                       printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",
> 
> WARNING:LONG_LINE: line over 80 characters
> #98: FILE: app/test-pmd/testpmd.c:1063:
> +                       printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"    Bad-outer-l4csum: %-14"PRIu64"\n",
>

AFAIK, printf's string can be >80 to allow string strip


 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4 checksum for csum engine
  2018-10-04 14:16       ` Jerin Jacob
@ 2018-10-04 15:06         ` Iremonger, Bernard
  0 siblings, 0 replies; 87+ messages in thread
From: Iremonger, Bernard @ 2018-10-04 15:06 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: Lu, Wenzhuo, Wu, Jingjing, dev, shahafs

Hi Jerin,

<snip>

> > > Subject: [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4
> > > checksum for csum engine
> > >
> > > Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD errors.
> > >
> > > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > > Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > > ---
> >
> > <snip>
> >
> > The following checkpatch warnings should probably be fixed
> >
> > WARNING:LONG_LINE: line over 80 characters
> > #86: FILE: app/test-pmd/testpmd.c:1043:
> > +                       printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum:
> > + %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",
> >
> > WARNING:LONG_LINE: line over 80 characters
> > #98: FILE: app/test-pmd/testpmd.c:1063:
> > +                       printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"
> Bad-outer-l4csum: %-14"PRIu64"\n",
> >
> 
> AFAIK, printf's string can be >80 to allow string strip

Yes, there is flexibility, not sure how much, the above lines are > 100 chars.

Otherwise

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>  

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/2] mbuf: fix Tx offload mask
  2018-10-04  2:31     ` Hu, Jiayu
@ 2018-10-04 16:05       ` Ferruh Yigit
  0 siblings, 0 replies; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-04 16:05 UTC (permalink / raw)
  To: Hu, Jiayu, Jerin Jacob, Olivier Matz; +Cc: dev, stable

On 10/4/2018 3:31 AM, Hu, Jiayu wrote:
> 
> 
>> -----Original Message-----
>> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
>> Sent: Tuesday, October 2, 2018 6:52 PM
>> To: Olivier Matz <olivier.matz@6wind.com>
>> Cc: dev@dpdk.org; Jerin Jacob <jerin.jacob@caviumnetworks.com>;
>> stable@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>
>> Subject: [dpdk-dev] [PATCH v2 2/2] mbuf: fix Tx offload mask
>>
>> Fixes missing PKT_TX_UDP_SEG,
>> PKT_TX_OUTER_IPV6,PKT_TX_OUTER_IPV4,
>> PKT_TX_IPV6 and  PKT_TX_IPV4 values in PKT_TX_OFFLOAD_MASK.
>>
>> Also sort them in bit wise order to recognize missing items later.
>>
>> Fixes: 6d18505efaa6 ("vhost: support UDP Fragmentation Offload")
>> Fixes: 1c3b7c33e977 ("mbuf: add Tx offloading flags for tunnels")
>> Fixes: 711ba9e23e68 ("mbuf: remove aliasing of Tx offloading flags with Rx
>> ones")
>> Cc: stable@dpdk.org
>> Cc: jiayu.hu@intel.com
>>
>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> 
> Acked-by: Jiayu Hu <jiayu.hu@intel.com>

Series applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-04  5:59               ` Jerin Jacob
@ 2018-10-05 19:48                 ` Ferruh Yigit
  2018-10-05 20:04                 ` Ferruh Yigit
  1 sibling, 0 replies; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-05 19:48 UTC (permalink / raw)
  To: Jerin Jacob, Andrew Rybchenko
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Olivier Matz, dev, shahafs,
	Ananyev, Konstantin

On 10/4/2018 6:59 AM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Wed, 3 Oct 2018 22:47:15 +0300
>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>>  Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>  Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>  <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
>>  dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>  <konstantin.ananyev@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>  checksum definition
>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
>>  Thunderbird/52.9.1
>>
>>
>> Hi Jerin,
> 
> Hi Andrew,
> 
>>
>> On 03.10.2018 21:14, Jerin Jacob wrote:
>>> -----Original Message-----
>>>> Date: Wed, 3 Oct 2018 21:00:37 +0300
>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>>>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>>>> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>>>>   Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>>>>   <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>>>   Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>>>   <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
>>>>   dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>>>   <konstantin.ananyev@intel.com>
>>>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>>>   checksum definition
>>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
>>>>   Thunderbird/52.9.1
>>>>
>>>> On 03.10.2018 20:12, Jerin Jacob wrote:
>>>>> -----Original Message-----
>>>>>> Date: Wed, 3 Oct 2018 13:27:13 +0530
>>>>>> From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>>>>>> To: Andrew Rybchenko <arybchenko@solarflare.com>
>>>>>> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>>>>>>    Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>>>>>>    <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>>>>>    Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>>>>>    <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
>>>>>>    dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>>>>>    <konstantin.ananyev@intel.com>
>>>>>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>>>>>    checksum definition
>>>>>> User-Agent: Mutt/1.10.1 (2018-07-13)
>>>>>>
>>>>>> External Email
>>>>>>
>>>>>> -----Original Message-----
>>>>>>> Date: Wed, 3 Oct 2018 10:34:52 +0300
>>>>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>>>>>>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>>>>>>>    <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>>>>>>>    Iremonger <bernard.iremonger@intel.com>, John McNamara
>>>>>>>    <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>>>>>>    Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>>>>>>    <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>
>>>>>>> CC: dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>>>>>>    <konstantin.ananyev@intel.com>
>>>>>>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>>>>>>    checksum definition
>>>>>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
>>>>>>>    Thunderbird/60.0
>>>>>>>
>>>>>>>
>>>>>>> On 10/2/18 10:24 PM, Jerin Jacob wrote:
>>>>>>>
>>>>>>> Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
>>>>>>> PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
>>>>>>> failure.
>>>>>>>
>>>>>>> - To use hardware Rx outer UDP checksum offload, the user needs to
>>>>>>> configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
>>>>>>>
>>>>>>> - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
>>>>>>> similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
>>>>>>>
>>>>>>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com><mailto:jerin.jacob@caviumnetworks.com>
>>>>>>>
>>>>>>> 1. I'm not sure that it is OK that mbuf and ethdev changes go in one patch.
>>>>>>>      It seems typically mbuf changes go separately and mbuf changes should
>>>>>>>      be applied to main dpdk repo.
>>>>>> I don't have strong opinion on this. If there are no other objection, I
>>>>>> will split the patch further as mbuf and ethdev as you pointed out.
>>>>>>
>>>>>>> 2. I'd like to see thought why single bit is used for outer L2 checksum when
>>>>>>>      2 bits (UNKNOWN, BAD, GOOD, NONE) are used for PKT_RX_L4_CKSUM.
>>>>>>>      May be it is OK, but it would be useful to state explicitly why it is decided
>>>>>>>      to go this way.
>>>>>> I am following the scheme similar to OUTER IP checksum where we have only
>>>>>> one bit filed(PKT_RX_EIP_CKSUM_BAD). I will mention in the git commit.
>>>>>>
>>>>>>
>>>>>>> 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
>>>>>>>      May be it is not directly related to changeset, but I think it would be really
>>>>>>>      useful to clarify it.
>>>>>> I will update the comment.
>>>>> Hi Andrew,
>>>>>
>>>>> I looked at the other definitions in mbuf.h, according the documentation,
>>>>> If nothing is mentioned it is treated as inner if the packet is
>>>>> tunneled else it is outer most. So I would like avoid confusion by
>>>>> adding "inner" in the exiting PKT_RX_L4_CKSUM_MASK comment.
>>>>> Technically it is not correct to say "inner" if the packet is not
>>>>> tunneled. So I am untouching the exiting comment.
>>>>>
>>>> Yes, it is incorrect to say that it is inner. How does application find
>>>> how to treat PKT_RX_L4_CKSUM (inner or outer)?
>>>> Should it rely on packet type provided in mbuf?
>>> AFAIK, Finding is it a tunneled packet or not is through ptype or SW has
>>> to parse the packet. For example, testpmd chooses later method using
>>> "csum parse-tunnel on <port>" to detect the presence of the tunnel.
>>
>> SW parsing of the packet cannot help, since app should be sure
>> that HW has classified the packet as tunneled and provided information
>> about inner and outer checksum checks.
> 
> 
> I thought the question was, How does the application find how to treat
> PKT_RX_L4_CKSUM (inner or outer)?
> Obviously, ptype will help here
> Not sure why SW parsing won't help here if SW parses and find it is an
> inner packet or it is not a tunneled packet. PKT_RX_L4_CKSUM treat as
> inner checksum for former case and PKT_RX_L4_CKSUM treated as plain l4
> checksum in the latter case.
> 
>>
>>>> Is it specified/mentioned somewhere?
>>> I don't know. It it not directly related to this change set, Olivier may know
>>> additional details.
>>
>> I disagree. You're adding one more offload flag. Yes, it simply follows
>> existing RX_EIP_CKSUM_BAD pattern. But, IMHO, RX_EIP_CKSUM_BAD
>> has many open questions. Why should these open questions be preserved
>> here? It is similar to the code with a bug which is cloned once again with
>> the bug :)
> 
> 
> No disagreement here. I choose to follow the existing scheme, because if I
> do another way around, still I will get the question on why it is different
> than the outer IPV4 checksum scheme.
> 
> Looking at the history, the mbuf DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM change
> went part of ixgbe change
> d909af8f72ca ("ixgbe: offload VxLAN and NVGRE Rx checksum on X550").
> 
> Al east in the HW I know, We can support "two bit" fields for Outer IP
> checksum and Outer L4 checksum.
> 
> So I think, the decision was made based on ixgbe capability or probably
> no one noticed the change as the subject was ixgbe:
> 
> Anyway, i don't have strong preferences on 1 bit vs 2 bits. I think, 1
> bit can be supported by all the HW if supports this feature. Leaving the
> decision to ethdev and mbuf maintainers.

+1 to Andrew, only PKT_RX_EL4_CKSUM_BAD bit is not clear when it is not set.
PKT_RX_IP_CKSUM_* approach looks better.

And agreed PKT_RX_EIP_CKSUM_BAD has same problem.

> 
>>
>> If everyone else is fine with the description of Rx checksum offloads and
>> it is only me who is unhappy with it - no problem.
>>
>> Thanks for your patience and I'm sorry that I'm really boring with it.
>> My goal is just to make it clear and as the result have less bugs in
>> networking PMDs and applications.
> 
> No problem. :-)
> 
> 
>>
>> Andrew.
>>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-04  5:59               ` Jerin Jacob
  2018-10-05 19:48                 ` Ferruh Yigit
@ 2018-10-05 20:04                 ` Ferruh Yigit
  2018-10-05 22:44                   ` Thomas Monjalon
  1 sibling, 1 reply; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-05 20:04 UTC (permalink / raw)
  To: Jerin Jacob, Andrew Rybchenko
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Olivier Matz, dev, shahafs,
	Ananyev, Konstantin

On 10/4/2018 6:59 AM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Wed, 3 Oct 2018 22:47:15 +0300
>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>>  Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>  Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>  <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
>>  dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>  <konstantin.ananyev@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>  checksum definition
>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
>>  Thunderbird/52.9.1
>>
>>
>> Hi Jerin,
> 
> Hi Andrew,
> 
>>
>> On 03.10.2018 21:14, Jerin Jacob wrote:
>>> -----Original Message-----
>>>> Date: Wed, 3 Oct 2018 21:00:37 +0300
>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>>>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>>>> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>>>>   Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>>>>   <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>>>   Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>>>   <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
>>>>   dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>>>   <konstantin.ananyev@intel.com>
>>>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>>>   checksum definition
>>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
>>>>   Thunderbird/52.9.1
>>>>
>>>> On 03.10.2018 20:12, Jerin Jacob wrote:
>>>>> -----Original Message-----
>>>>>> Date: Wed, 3 Oct 2018 13:27:13 +0530
>>>>>> From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>>>>>> To: Andrew Rybchenko <arybchenko@solarflare.com>
>>>>>> CC: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>>>>>>    Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>>>>>>    <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>>>>>    Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>>>>>    <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>,
>>>>>>    dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>>>>>    <konstantin.ananyev@intel.com>
>>>>>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>>>>>    checksum definition
>>>>>> User-Agent: Mutt/1.10.1 (2018-07-13)
>>>>>>
>>>>>> External Email
>>>>>>
>>>>>> -----Original Message-----
>>>>>>> Date: Wed, 3 Oct 2018 10:34:52 +0300
>>>>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>>>>>>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Wenzhuo Lu
>>>>>>>    <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, Bernard
>>>>>>>    Iremonger <bernard.iremonger@intel.com>, John McNamara
>>>>>>>    <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>>>>>>    Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit
>>>>>>>    <ferruh.yigit@intel.com>, Olivier Matz <olivier.matz@6wind.com>
>>>>>>> CC: dev@dpdk.org, shahafs@mellanox.com, "Ananyev, Konstantin"
>>>>>>>    <konstantin.ananyev@intel.com>
>>>>>>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>>>>>>    checksum definition
>>>>>>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
>>>>>>>    Thunderbird/60.0
>>>>>>>
>>>>>>>
>>>>>>> On 10/2/18 10:24 PM, Jerin Jacob wrote:
>>>>>>>
>>>>>>> Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
>>>>>>> PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum
>>>>>>> failure.
>>>>>>>
>>>>>>> - To use hardware Rx outer UDP checksum offload, the user needs to
>>>>>>> configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
>>>>>>>
>>>>>>> - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure
>>>>>>> similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag.
>>>>>>>
>>>>>>> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com><mailto:jerin.jacob@caviumnetworks.com>
>>>>>>>
>>>>>>> 1. I'm not sure that it is OK that mbuf and ethdev changes go in one patch.
>>>>>>>      It seems typically mbuf changes go separately and mbuf changes should
>>>>>>>      be applied to main dpdk repo.
>>>>>> I don't have strong opinion on this. If there are no other objection, I
>>>>>> will split the patch further as mbuf and ethdev as you pointed out.
>>>>>>
>>>>>>> 2. I'd like to see thought why single bit is used for outer L2 checksum when
>>>>>>>      2 bits (UNKNOWN, BAD, GOOD, NONE) are used for PKT_RX_L4_CKSUM.
>>>>>>>      May be it is OK, but it would be useful to state explicitly why it is decided
>>>>>>>      to go this way.
>>>>>> I am following the scheme similar to OUTER IP checksum where we have only
>>>>>> one bit filed(PKT_RX_EIP_CKSUM_BAD). I will mention in the git commit.
>>>>>>
>>>>>>
>>>>>>> 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
>>>>>>>      May be it is not directly related to changeset, but I think it would be really
>>>>>>>      useful to clarify it.
>>>>>> I will update the comment.
>>>>> Hi Andrew,
>>>>>
>>>>> I looked at the other definitions in mbuf.h, according the documentation,
>>>>> If nothing is mentioned it is treated as inner if the packet is
>>>>> tunneled else it is outer most. So I would like avoid confusion by
>>>>> adding "inner" in the exiting PKT_RX_L4_CKSUM_MASK comment.
>>>>> Technically it is not correct to say "inner" if the packet is not
>>>>> tunneled. So I am untouching the exiting comment.
>>>>>
>>>> Yes, it is incorrect to say that it is inner. How does application find
>>>> how to treat PKT_RX_L4_CKSUM (inner or outer)?
>>>> Should it rely on packet type provided in mbuf?
>>> AFAIK, Finding is it a tunneled packet or not is through ptype or SW has
>>> to parse the packet. For example, testpmd chooses later method using
>>> "csum parse-tunnel on <port>" to detect the presence of the tunnel.
>>
>> SW parsing of the packet cannot help, since app should be sure
>> that HW has classified the packet as tunneled and provided information
>> about inner and outer checksum checks.
> 
> 
> I thought the question was, How does the application find how to treat
> PKT_RX_L4_CKSUM (inner or outer)?
> Obviously, ptype will help here
> Not sure why SW parsing won't help here if SW parses and find it is an
> inner packet or it is not a tunneled packet. PKT_RX_L4_CKSUM treat as
> inner checksum for former case and PKT_RX_L4_CKSUM treated as plain l4
> checksum in the latter case.

I don't know if PKT_RX_L4_CKSUM is inner or outer with current design,
but wouldn't be easier if PKT_RX_L4_CKSUM always refer to outer and if tunneled
use something like PKT_RX_INNER_L4_CKSUM, same for IP and TX.

> 
>>
>>>> Is it specified/mentioned somewhere?
>>> I don't know. It it not directly related to this change set, Olivier may know
>>> additional details.
>>
>> I disagree. You're adding one more offload flag. Yes, it simply follows
>> existing RX_EIP_CKSUM_BAD pattern. But, IMHO, RX_EIP_CKSUM_BAD
>> has many open questions. Why should these open questions be preserved
>> here? It is similar to the code with a bug which is cloned once again with
>> the bug :)
> 
> 
> No disagreement here. I choose to follow the existing scheme, because if I
> do another way around, still I will get the question on why it is different
> than the outer IPV4 checksum scheme.
> 
> Looking at the history, the mbuf DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM change
> went part of ixgbe change
> d909af8f72ca ("ixgbe: offload VxLAN and NVGRE Rx checksum on X550").
> 
> Al east in the HW I know, We can support "two bit" fields for Outer IP
> checksum and Outer L4 checksum.
> 
> So I think, the decision was made based on ixgbe capability or probably
> no one noticed the change as the subject was ixgbe:
> 
> Anyway, i don't have strong preferences on 1 bit vs 2 bits. I think, 1
> bit can be supported by all the HW if supports this feature. Leaving the
> decision to ethdev and mbuf maintainers.
> 
>>
>> If everyone else is fine with the description of Rx checksum offloads and
>> it is only me who is unhappy with it - no problem.
>>
>> Thanks for your patience and I'm sorry that I'm really boring with it.
>> My goal is just to make it clear and as the result have less bugs in
>> networking PMDs and applications.
> 
> No problem. :-)
> 
> 
>>
>> Andrew.
>>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-05 20:04                 ` Ferruh Yigit
@ 2018-10-05 22:44                   ` Thomas Monjalon
  2018-10-06  8:15                     ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Thomas Monjalon @ 2018-10-05 22:44 UTC (permalink / raw)
  To: Ferruh Yigit, Jerin Jacob, Andrew Rybchenko
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Olivier Matz, dev, shahafs, Ananyev, Konstantin,
	didier.pallard

05/10/2018 22:04, Ferruh Yigit:
> On 10/4/2018 6:59 AM, Jerin Jacob wrote:
> > From: Andrew Rybchenko <arybchenko@solarflare.com>
> >> On 03.10.2018 21:14, Jerin Jacob wrote:
> >>> From: Andrew Rybchenko <arybchenko@solarflare.com>
> >>>> On 03.10.2018 20:12, Jerin Jacob wrote:
> >>>>> From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> >>>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
> >>>>>>> 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
> >>>>>>>      May be it is not directly related to changeset, but I think it would be really
> >>>>>>>      useful to clarify it.
> >>>>>> I will update the comment.
> >>>>> Hi Andrew,
> >>>>>
> >>>>> I looked at the other definitions in mbuf.h, according the documentation,
> >>>>> If nothing is mentioned it is treated as inner if the packet is
> >>>>> tunneled else it is outer most. So I would like avoid confusion by
> >>>>> adding "inner" in the exiting PKT_RX_L4_CKSUM_MASK comment.
> >>>>> Technically it is not correct to say "inner" if the packet is not
> >>>>> tunneled. So I am untouching the exiting comment.
> >>>>>
> >>>> Yes, it is incorrect to say that it is inner. How does application find
> >>>> how to treat PKT_RX_L4_CKSUM (inner or outer)?
> >>>> Should it rely on packet type provided in mbuf?
> >>> AFAIK, Finding is it a tunneled packet or not is through ptype or SW has
> >>> to parse the packet. For example, testpmd chooses later method using
> >>> "csum parse-tunnel on <port>" to detect the presence of the tunnel.
> >>
> >> SW parsing of the packet cannot help, since app should be sure
> >> that HW has classified the packet as tunneled and provided information
> >> about inner and outer checksum checks.
> > 
> > 
> > I thought the question was, How does the application find how to treat
> > PKT_RX_L4_CKSUM (inner or outer)?
> > Obviously, ptype will help here
> > Not sure why SW parsing won't help here if SW parses and find it is an
> > inner packet or it is not a tunneled packet. PKT_RX_L4_CKSUM treat as
> > inner checksum for former case and PKT_RX_L4_CKSUM treated as plain l4
> > checksum in the latter case.
> 
> I don't know if PKT_RX_L4_CKSUM is inner or outer with current design,
> but wouldn't be easier if PKT_RX_L4_CKSUM always refer to outer and if tunneled
> use something like PKT_RX_INNER_L4_CKSUM, same for IP and TX.

The return of the come back of the "inner vs outer" discussion :-)
There were some thoughts about what is the most convenient for apps doing
decapsulation of tunnels.
I think the decision was to choose inner as the default, while outer
must be explicited.

Honestly, we should not try to change again the meaning of symbols
having no outer/inner word in their name, except if we have a
very very good reason and arguments.

And for new symbols, we must follow the community decision.

However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-05 22:44                   ` Thomas Monjalon
@ 2018-10-06  8:15                     ` Jerin Jacob
  2018-10-06 12:18                       ` Ananyev, Konstantin
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-06  8:15 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Ferruh Yigit, Andrew Rybchenko, Wenzhuo Lu, Jingjing Wu,
	Bernard Iremonger, John McNamara, Marko Kovacevic, Olivier Matz,
	dev, shahafs, Ananyev, Konstantin, didier.pallard

-----Original Message-----
> Date: Sat, 06 Oct 2018 00:44:52 +0200
> From: Thomas Monjalon <thomas@monjalon.net>
> To: Ferruh Yigit <ferruh.yigit@intel.com>, Jerin Jacob
>  <jerin.jacob@caviumnetworks.com>, Andrew Rybchenko
>  <arybchenko@solarflare.com>
> Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>  Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>  Olivier Matz <olivier.matz@6wind.com>, dev@dpdk.org, shahafs@mellanox.com,
>  "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
>  didier.pallard@6wind.com
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum definition
> 
> 
> 05/10/2018 22:04, Ferruh Yigit:
> > On 10/4/2018 6:59 AM, Jerin Jacob wrote:
> > > From: Andrew Rybchenko <arybchenko@solarflare.com>
> > >> On 03.10.2018 21:14, Jerin Jacob wrote:
> > >>> From: Andrew Rybchenko <arybchenko@solarflare.com>
> > >>>> On 03.10.2018 20:12, Jerin Jacob wrote:
> > >>>>> From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > >>>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
> > >>>>>>> 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
> > >>>>>>>      May be it is not directly related to changeset, but I think it would be really
> > >>>>>>>      useful to clarify it.
> > >>>>>> I will update the comment.
> > >>>>> Hi Andrew,
> > >>>>>
> 
> However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.

Do we need to block this patch due to the exiting PKT_RX_EIP_CKSUM_BAD
definition?

I already added the author of the PKT_RX_EIP_CKSUM_BAD flag and ethdev and mbuf
maintainers in this list. So what else I need make forward progress
on this patch?

I think, the definition of PKT_RX_EIP_CKSUM_BAD based on HW capability. It
is safe to assume that ALL HW can support CKSUM BAD if the feature is
available and hence it is more portable.

> 
> 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-06  8:15                     ` Jerin Jacob
@ 2018-10-06 12:18                       ` Ananyev, Konstantin
  2018-10-08  8:12                         ` Ferruh Yigit
  0 siblings, 1 reply; 87+ messages in thread
From: Ananyev, Konstantin @ 2018-10-06 12:18 UTC (permalink / raw)
  To: Jerin Jacob, Thomas Monjalon
  Cc: Yigit, Ferruh, Andrew Rybchenko, Lu, Wenzhuo, Wu, Jingjing,
	Iremonger, Bernard, Mcnamara, John, Kovacevic, Marko,
	Olivier Matz, dev, shahafs, didier.pallard



> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Saturday, October 6, 2018 9:16 AM
> To: Thomas Monjalon <thomas@monjalon.net>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>; Mcnamara, John <john.mcnamara@intel.com>;
> Kovacevic, Marko <marko.kovacevic@intel.com>; Olivier Matz <olivier.matz@6wind.com>; dev@dpdk.org; shahafs@mellanox.com;
> Ananyev, Konstantin <konstantin.ananyev@intel.com>; didier.pallard@6wind.com
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
> 
> -----Original Message-----
> > Date: Sat, 06 Oct 2018 00:44:52 +0200
> > From: Thomas Monjalon <thomas@monjalon.net>
> > To: Ferruh Yigit <ferruh.yigit@intel.com>, Jerin Jacob
> >  <jerin.jacob@caviumnetworks.com>, Andrew Rybchenko
> >  <arybchenko@solarflare.com>
> > Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
> >  Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
> >  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
> >  Olivier Matz <olivier.matz@6wind.com>, dev@dpdk.org, shahafs@mellanox.com,
> >  "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
> >  didier.pallard@6wind.com
> > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> >  checksum definition
> >
> >
> > 05/10/2018 22:04, Ferruh Yigit:
> > > On 10/4/2018 6:59 AM, Jerin Jacob wrote:
> > > > From: Andrew Rybchenko <arybchenko@solarflare.com>
> > > >> On 03.10.2018 21:14, Jerin Jacob wrote:
> > > >>> From: Andrew Rybchenko <arybchenko@solarflare.com>
> > > >>>> On 03.10.2018 20:12, Jerin Jacob wrote:
> > > >>>>> From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > > >>>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
> > > >>>>>>> 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
> > > >>>>>>>      May be it is not directly related to changeset, but I think it would be really
> > > >>>>>>>      useful to clarify it.
> > > >>>>>> I will update the comment.
> > > >>>>> Hi Andrew,
> > > >>>>>
> >
> > However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.
> 
> Do we need to block this patch due to the exiting PKT_RX_EIP_CKSUM_BAD
> definition?
> 
> I already added the author of the PKT_RX_EIP_CKSUM_BAD flag and ethdev and mbuf
> maintainers in this list. So what else I need make forward progress
> on this patch?
> 
> I think, the definition of PKT_RX_EIP_CKSUM_BAD based on HW capability. It
> is safe to assume that ALL HW can support CKSUM BAD if the feature is
> available and hence it is more portable.

Yes, as I remember PKT_RX_EIP_CKSUM_BAD is based on DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM.
Konstantin

> 
> >
> >

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-06 12:18                       ` Ananyev, Konstantin
@ 2018-10-08  8:12                         ` Ferruh Yigit
  2018-10-08  8:24                           ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-08  8:12 UTC (permalink / raw)
  To: Ananyev, Konstantin, Jerin Jacob, Thomas Monjalon
  Cc: Andrew Rybchenko, Lu, Wenzhuo, Wu, Jingjing, Iremonger, Bernard,
	Mcnamara, John, Kovacevic, Marko, Olivier Matz, dev, shahafs,
	didier.pallard

On 10/6/2018 1:18 PM, Ananyev, Konstantin wrote:
> 
> 
>> -----Original Message-----
>> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
>> Sent: Saturday, October 6, 2018 9:16 AM
>> To: Thomas Monjalon <thomas@monjalon.net>
>> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu,
>> Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>; Mcnamara, John <john.mcnamara@intel.com>;
>> Kovacevic, Marko <marko.kovacevic@intel.com>; Olivier Matz <olivier.matz@6wind.com>; dev@dpdk.org; shahafs@mellanox.com;
>> Ananyev, Konstantin <konstantin.ananyev@intel.com>; didier.pallard@6wind.com
>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
>>
>> -----Original Message-----
>>> Date: Sat, 06 Oct 2018 00:44:52 +0200
>>> From: Thomas Monjalon <thomas@monjalon.net>
>>> To: Ferruh Yigit <ferruh.yigit@intel.com>, Jerin Jacob
>>>  <jerin.jacob@caviumnetworks.com>, Andrew Rybchenko
>>>  <arybchenko@solarflare.com>
>>> Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
>>>  Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
>>>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
>>>  Olivier Matz <olivier.matz@6wind.com>, dev@dpdk.org, shahafs@mellanox.com,
>>>  "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
>>>  didier.pallard@6wind.com
>>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>>  checksum definition
>>>
>>>
>>> 05/10/2018 22:04, Ferruh Yigit:
>>>> On 10/4/2018 6:59 AM, Jerin Jacob wrote:
>>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>>>>>> On 03.10.2018 21:14, Jerin Jacob wrote:
>>>>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>>>>>>>> On 03.10.2018 20:12, Jerin Jacob wrote:
>>>>>>>>> From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
>>>>>>>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
>>>>>>>>>>> 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
>>>>>>>>>>>      May be it is not directly related to changeset, but I think it would be really
>>>>>>>>>>>      useful to clarify it.
>>>>>>>>>> I will update the comment.
>>>>>>>>> Hi Andrew,
>>>>>>>>>
>>>
>>> However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.
>>
>> Do we need to block this patch due to the exiting PKT_RX_EIP_CKSUM_BAD
>> definition?
>>
>> I already added the author of the PKT_RX_EIP_CKSUM_BAD flag and ethdev and mbuf
>> maintainers in this list. So what else I need make forward progress
>> on this patch?
>>
>> I think, the definition of PKT_RX_EIP_CKSUM_BAD based on HW capability. It
>> is safe to assume that ALL HW can support CKSUM BAD if the feature is
>> available and hence it is more portable.
> 
> Yes, as I remember PKT_RX_EIP_CKSUM_BAD is based on DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM.

Switching to two bit won't reduce the portability, HW supports only reporting
CKSUM_BAD can set BAD || UNKNOWN.

And I think patch is not blocked by PKT_RX_EIP_CKSUM_BAD, it can be changed
separately, for this patch question is can we represent PKT_RX_EL4_CKSUM_* with
two bits, to have BAD/GOOD/UNKNOWN?

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-08  8:12                         ` Ferruh Yigit
@ 2018-10-08  8:24                           ` Jerin Jacob
  2018-10-08  9:04                             ` Thomas Monjalon
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-08  8:24 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Ananyev, Konstantin, Thomas Monjalon, Andrew Rybchenko, Lu,
	Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Mcnamara, John,
	Kovacevic, Marko, Olivier Matz, dev, shahafs, didier.pallard

-----Original Message-----
> Date: Mon, 8 Oct 2018 09:12:34 +0100
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>, Jerin Jacob
>  <jerin.jacob@caviumnetworks.com>, Thomas Monjalon <thomas@monjalon.net>
> CC: Andrew Rybchenko <arybchenko@solarflare.com>, "Lu, Wenzhuo"
>  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
>  "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Mcnamara, John"
>  <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>,
>  Olivier Matz <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
>  "shahafs@mellanox.com" <shahafs@mellanox.com>, "didier.pallard@6wind.com"
>  <didier.pallard@6wind.com>
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum definition
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>  Thunderbird/52.9.1
> 
> 
> On 10/6/2018 1:18 PM, Ananyev, Konstantin wrote:
> >
> >
> >> -----Original Message-----
> >> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> >> Sent: Saturday, October 6, 2018 9:16 AM
> >> To: Thomas Monjalon <thomas@monjalon.net>
> >> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu,
> >> Jingjing <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>; Mcnamara, John <john.mcnamara@intel.com>;
> >> Kovacevic, Marko <marko.kovacevic@intel.com>; Olivier Matz <olivier.matz@6wind.com>; dev@dpdk.org; shahafs@mellanox.com;
> >> Ananyev, Konstantin <konstantin.ananyev@intel.com>; didier.pallard@6wind.com
> >> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
> >>
> >> -----Original Message-----
> >>> Date: Sat, 06 Oct 2018 00:44:52 +0200
> >>> From: Thomas Monjalon <thomas@monjalon.net>
> >>> To: Ferruh Yigit <ferruh.yigit@intel.com>, Jerin Jacob
> >>>  <jerin.jacob@caviumnetworks.com>, Andrew Rybchenko
> >>>  <arybchenko@solarflare.com>
> >>> Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,
> >>>  Bernard Iremonger <bernard.iremonger@intel.com>, John McNamara
> >>>  <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,
> >>>  Olivier Matz <olivier.matz@6wind.com>, dev@dpdk.org, shahafs@mellanox.com,
> >>>  "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
> >>>  didier.pallard@6wind.com
> >>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> >>>  checksum definition
> >>>
> >>>
> >>> 05/10/2018 22:04, Ferruh Yigit:
> >>>> On 10/4/2018 6:59 AM, Jerin Jacob wrote:
> >>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
> >>>>>> On 03.10.2018 21:14, Jerin Jacob wrote:
> >>>>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
> >>>>>>>> On 03.10.2018 20:12, Jerin Jacob wrote:
> >>>>>>>>> From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> >>>>>>>>>> From: Andrew Rybchenko <arybchenko@solarflare.com>
> >>>>>>>>>>> 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
> >>>>>>>>>>>      May be it is not directly related to changeset, but I think it would be really
> >>>>>>>>>>>      useful to clarify it.
> >>>>>>>>>> I will update the comment.
> >>>>>>>>> Hi Andrew,
> >>>>>>>>>
> >>>
> >>> However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.
> >>
> >> Do we need to block this patch due to the exiting PKT_RX_EIP_CKSUM_BAD
> >> definition?
> >>
> >> I already added the author of the PKT_RX_EIP_CKSUM_BAD flag and ethdev and mbuf
> >> maintainers in this list. So what else I need make forward progress
> >> on this patch?
> >>
> >> I think, the definition of PKT_RX_EIP_CKSUM_BAD based on HW capability. It
> >> is safe to assume that ALL HW can support CKSUM BAD if the feature is
> >> available and hence it is more portable.
> >
> > Yes, as I remember PKT_RX_EIP_CKSUM_BAD is based on DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM.
> 
> Switching to two bit won't reduce the portability, HW supports only reporting
> CKSUM_BAD can set BAD || UNKNOWN.

UNKNOWN is not a bit. It is represented as 0. It spec has 2 bit, then
driver need to report GOOD as well.

Same applies for PKT_RX_EL4_CKSUM as well.

> 
> And I think patch is not blocked by PKT_RX_EIP_CKSUM_BAD, it can be changed
> separately, for this patch question is can we represent PKT_RX_EL4_CKSUM_* with
> two bits, to have BAD/GOOD/UNKNOWN?

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-08  8:24                           ` Jerin Jacob
@ 2018-10-08  9:04                             ` Thomas Monjalon
  2018-10-08  9:37                               ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Thomas Monjalon @ 2018-10-08  9:04 UTC (permalink / raw)
  To: Jerin Jacob, Ferruh Yigit, Ananyev, Konstantin
  Cc: Andrew Rybchenko, Lu, Wenzhuo, Wu, Jingjing, Iremonger, Bernard,
	Mcnamara, John, Kovacevic, Marko, Olivier Matz, dev, shahafs,
	didier.pallard

08/10/2018 10:24, Jerin Jacob:
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> > On 10/6/2018 1:18 PM, Ananyev, Konstantin wrote:
> > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > >> From: Thomas Monjalon <thomas@monjalon.net>
> > >>> However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.
> > >>
> > >> Do we need to block this patch due to the exiting PKT_RX_EIP_CKSUM_BAD
> > >> definition?
> > >>
> > >> I already added the author of the PKT_RX_EIP_CKSUM_BAD flag and ethdev and mbuf
> > >> maintainers in this list. So what else I need make forward progress
> > >> on this patch?
> > >>
> > >> I think, the definition of PKT_RX_EIP_CKSUM_BAD based on HW capability. It
> > >> is safe to assume that ALL HW can support CKSUM BAD if the feature is
> > >> available and hence it is more portable.
> > >
> > > Yes, as I remember PKT_RX_EIP_CKSUM_BAD is based on DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM.
> > 
> > Switching to two bit won't reduce the portability, HW supports only reporting
> > CKSUM_BAD can set BAD || UNKNOWN.
> 
> UNKNOWN is not a bit. It is represented as 0. It spec has 2 bit, then
> driver need to report GOOD as well.
> 
> Same applies for PKT_RX_EL4_CKSUM as well.
> 
> > 
> > And I think patch is not blocked by PKT_RX_EIP_CKSUM_BAD, it can be changed
> > separately, for this patch question is can we represent PKT_RX_EL4_CKSUM_* with
> > two bits, to have BAD/GOOD/UNKNOWN?

Yes, exact.

PKT_RX_EIP_CKSUM_BAD must be left aside.
We should just avoid taking it as a reference.
And we can reconsider its definition later.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-08  9:04                             ` Thomas Monjalon
@ 2018-10-08  9:37                               ` Jerin Jacob
  2018-10-08 10:53                                 ` Ferruh Yigit
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-08  9:37 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Ferruh Yigit, Ananyev, Konstantin, Andrew Rybchenko, Lu, Wenzhuo,
	Wu, Jingjing, Iremonger, Bernard, Mcnamara, John, Kovacevic,
	Marko, Olivier Matz, dev, shahafs, didier.pallard

-----Original Message-----
> Date: Mon, 08 Oct 2018 11:04:51 +0200
> From: Thomas Monjalon <thomas@monjalon.net>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Ferruh Yigit
>  <ferruh.yigit@intel.com>, "Ananyev, Konstantin"
>  <konstantin.ananyev@intel.com>
> Cc: Andrew Rybchenko <arybchenko@solarflare.com>, "Lu, Wenzhuo"
>  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
>  "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Mcnamara, John"
>  <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>,
>  Olivier Matz <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
>  "shahafs@mellanox.com" <shahafs@mellanox.com>, "didier.pallard@6wind.com"
>  <didier.pallard@6wind.com>
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum definition
> 
> 08/10/2018 10:24, Jerin Jacob:
> > From: Ferruh Yigit <ferruh.yigit@intel.com>
> > > On 10/6/2018 1:18 PM, Ananyev, Konstantin wrote:
> > > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > > >> From: Thomas Monjalon <thomas@monjalon.net>
> > > >>> However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.
> > > >>
> > > >> Do we need to block this patch due to the exiting PKT_RX_EIP_CKSUM_BAD
> > > >> definition?
> > > >>
> > > >> I already added the author of the PKT_RX_EIP_CKSUM_BAD flag and ethdev and mbuf
> > > >> maintainers in this list. So what else I need make forward progress
> > > >> on this patch?
> > > >>
> > > >> I think, the definition of PKT_RX_EIP_CKSUM_BAD based on HW capability. It
> > > >> is safe to assume that ALL HW can support CKSUM BAD if the feature is
> > > >> available and hence it is more portable.
> > > >
> > > > Yes, as I remember PKT_RX_EIP_CKSUM_BAD is based on DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM.
> > >
> > > Switching to two bit won't reduce the portability, HW supports only reporting
> > > CKSUM_BAD can set BAD || UNKNOWN.
> >
> > UNKNOWN is not a bit. It is represented as 0. It spec has 2 bit, then
> > driver need to report GOOD as well.
> >
> > Same applies for PKT_RX_EL4_CKSUM as well.
> >
> > >
> > > And I think patch is not blocked by PKT_RX_EIP_CKSUM_BAD, it can be changed
> > > separately, for this patch question is can we represent PKT_RX_EL4_CKSUM_* with
> > > two bits, to have BAD/GOOD/UNKNOWN?
> 
> Yes, exact.
> 
> PKT_RX_EIP_CKSUM_BAD must be left aside.
> We should just avoid taking it as a reference.
> And we can reconsider its definition later.

OK.

IMO, Using 2 bit scheme for tunneled checksum has following performance
issue from driver side.

Driver need to mark the packet as GOOD. All the HW can support
detection of BAD. That not necessary mean GOOD in case of tunnel packet,
so driver has to detect the packet is tunneled and packet is not BAD
then mark GOOD.



> 
> 
> 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-08  9:37                               ` Jerin Jacob
@ 2018-10-08 10:53                                 ` Ferruh Yigit
  2018-10-08 11:55                                   ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-08 10:53 UTC (permalink / raw)
  To: Jerin Jacob, Thomas Monjalon
  Cc: Ananyev, Konstantin, Andrew Rybchenko, Lu, Wenzhuo, Wu, Jingjing,
	Iremonger, Bernard, Mcnamara, John, Kovacevic, Marko,
	Olivier Matz, dev, shahafs, didier.pallard

On 10/8/2018 10:37 AM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Mon, 08 Oct 2018 11:04:51 +0200
>> From: Thomas Monjalon <thomas@monjalon.net>
>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Ferruh Yigit
>>  <ferruh.yigit@intel.com>, "Ananyev, Konstantin"
>>  <konstantin.ananyev@intel.com>
>> Cc: Andrew Rybchenko <arybchenko@solarflare.com>, "Lu, Wenzhuo"
>>  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
>>  "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Mcnamara, John"
>>  <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>,
>>  Olivier Matz <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
>>  "shahafs@mellanox.com" <shahafs@mellanox.com>, "didier.pallard@6wind.com"
>>  <didier.pallard@6wind.com>
>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>  checksum definition
>>
>> 08/10/2018 10:24, Jerin Jacob:
>>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>>>> On 10/6/2018 1:18 PM, Ananyev, Konstantin wrote:
>>>>> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
>>>>>> From: Thomas Monjalon <thomas@monjalon.net>
>>>>>>> However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.
>>>>>>
>>>>>> Do we need to block this patch due to the exiting PKT_RX_EIP_CKSUM_BAD
>>>>>> definition?
>>>>>>
>>>>>> I already added the author of the PKT_RX_EIP_CKSUM_BAD flag and ethdev and mbuf
>>>>>> maintainers in this list. So what else I need make forward progress
>>>>>> on this patch?
>>>>>>
>>>>>> I think, the definition of PKT_RX_EIP_CKSUM_BAD based on HW capability. It
>>>>>> is safe to assume that ALL HW can support CKSUM BAD if the feature is
>>>>>> available and hence it is more portable.
>>>>>
>>>>> Yes, as I remember PKT_RX_EIP_CKSUM_BAD is based on DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM.
>>>>
>>>> Switching to two bit won't reduce the portability, HW supports only reporting
>>>> CKSUM_BAD can set BAD || UNKNOWN.
>>>
>>> UNKNOWN is not a bit. It is represented as 0. It spec has 2 bit, then
>>> driver need to report GOOD as well.
>>>
>>> Same applies for PKT_RX_EL4_CKSUM as well.
>>>
>>>>
>>>> And I think patch is not blocked by PKT_RX_EIP_CKSUM_BAD, it can be changed
>>>> separately, for this patch question is can we represent PKT_RX_EL4_CKSUM_* with
>>>> two bits, to have BAD/GOOD/UNKNOWN?
>>
>> Yes, exact.
>>
>> PKT_RX_EIP_CKSUM_BAD must be left aside.
>> We should just avoid taking it as a reference.
>> And we can reconsider its definition later.
> 
> OK.
> 
> IMO, Using 2 bit scheme for tunneled checksum has following performance
> issue from driver side.
> 
> Driver need to mark the packet as GOOD. All the HW can support
> detection of BAD. That not necessary mean GOOD in case of tunnel packet,
> so driver has to detect the packet is tunneled and packet is not BAD
> then mark GOOD.

Yes UNKNOWN is not a bit, but a state, why don't use it? Why driver has to check
it is GOOD?

0x0 => UNKNOWN
0x1 => BAD
0x2 => GOOD
0x3 => ? (invalid perhaps)

HW that supports detecting good packets can set BAD || GOOD state, HW can detect
only BAD packet can set BAD || UNKNOWN state.

If BAD is not set, there is an ambiguity of state, lets clarify it in lower
level, if it is UNKNOWN, let application know it is UNKNOWN.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-08 10:53                                 ` Ferruh Yigit
@ 2018-10-08 11:55                                   ` Jerin Jacob
  2018-10-08 12:13                                     ` Ferruh Yigit
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-08 11:55 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Thomas Monjalon, Ananyev, Konstantin, Andrew Rybchenko, Lu,
	Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Mcnamara, John,
	Kovacevic, Marko, Olivier Matz, dev, shahafs, didier.pallard

-----Original Message-----
> Date: Mon, 8 Oct 2018 11:53:01 +0100
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Thomas Monjalon
>  <thomas@monjalon.net>
> CC: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>, Andrew Rybchenko
>  <arybchenko@solarflare.com>, "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Wu,
>  Jingjing" <jingjing.wu@intel.com>, "Iremonger, Bernard"
>  <bernard.iremonger@intel.com>, "Mcnamara, John" <john.mcnamara@intel.com>,
>  "Kovacevic, Marko" <marko.kovacevic@intel.com>, Olivier Matz
>  <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
>  "shahafs@mellanox.com" <shahafs@mellanox.com>, "didier.pallard@6wind.com"
>  <didier.pallard@6wind.com>
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum definition
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>  Thunderbird/52.9.1
> 
> On 10/8/2018 10:37 AM, Jerin Jacob wrote:
> > -----Original Message-----
> >> Date: Mon, 08 Oct 2018 11:04:51 +0200
> >> From: Thomas Monjalon <thomas@monjalon.net>
> >> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Ferruh Yigit
> >>  <ferruh.yigit@intel.com>, "Ananyev, Konstantin"
> >>  <konstantin.ananyev@intel.com>
> >> Cc: Andrew Rybchenko <arybchenko@solarflare.com>, "Lu, Wenzhuo"
> >>  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
> >>  "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Mcnamara, John"
> >>  <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>,
> >>  Olivier Matz <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
> >>  "shahafs@mellanox.com" <shahafs@mellanox.com>, "didier.pallard@6wind.com"
> >>  <didier.pallard@6wind.com>
> >> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> >>  checksum definition
> >>
> >> 08/10/2018 10:24, Jerin Jacob:
> >>> From: Ferruh Yigit <ferruh.yigit@intel.com>
> >>>> On 10/6/2018 1:18 PM, Ananyev, Konstantin wrote:
> >>>>> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> >>>>>> From: Thomas Monjalon <thomas@monjalon.net>
> >>>>>>> However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.
> >>>>>>
> >>>>>> Do we need to block this patch due to the exiting PKT_RX_EIP_CKSUM_BAD
> >>>>>> definition?
> >>>>>>
> >>>>>> I already added the author of the PKT_RX_EIP_CKSUM_BAD flag and ethdev and mbuf
> >>>>>> maintainers in this list. So what else I need make forward progress
> >>>>>> on this patch?
> >>>>>>
> >>>>>> I think, the definition of PKT_RX_EIP_CKSUM_BAD based on HW capability. It
> >>>>>> is safe to assume that ALL HW can support CKSUM BAD if the feature is
> >>>>>> available and hence it is more portable.
> >>>>>
> >>>>> Yes, as I remember PKT_RX_EIP_CKSUM_BAD is based on DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM.
> >>>>
> >>>> Switching to two bit won't reduce the portability, HW supports only reporting
> >>>> CKSUM_BAD can set BAD || UNKNOWN.
> >>>
> >>> UNKNOWN is not a bit. It is represented as 0. It spec has 2 bit, then
> >>> driver need to report GOOD as well.
> >>>
> >>> Same applies for PKT_RX_EL4_CKSUM as well.
> >>>
> >>>>
> >>>> And I think patch is not blocked by PKT_RX_EIP_CKSUM_BAD, it can be changed
> >>>> separately, for this patch question is can we represent PKT_RX_EL4_CKSUM_* with
> >>>> two bits, to have BAD/GOOD/UNKNOWN?
> >>
> >> Yes, exact.
> >>
> >> PKT_RX_EIP_CKSUM_BAD must be left aside.
> >> We should just avoid taking it as a reference.
> >> And we can reconsider its definition later.
> >
> > OK.
> >
> > IMO, Using 2 bit scheme for tunneled checksum has following performance
> > issue from driver side.
> >
> > Driver need to mark the packet as GOOD. All the HW can support
> > detection of BAD. That not necessary mean GOOD in case of tunnel packet,
> > so driver has to detect the packet is tunneled and packet is not BAD
> > then mark GOOD.
> 
> Yes UNKNOWN is not a bit, but a state, why don't use it? Why driver has to check
> it is GOOD?

The application is going to check is it GOOD or not. Not the driver,
Right? My concern was, If application starts dropping the packet instead checking the BAD, if
it checks == !GOOD.

> 
> 0x0 => UNKNOWN
> 0x1 => BAD
> 0x2 => GOOD
> 0x3 => ? (invalid perhaps)
> 
> HW that supports detecting good packets can set BAD || GOOD state, HW can detect
> only BAD packet can set BAD || UNKNOWN state.
> 
> If BAD is not set, there is an ambiguity of state, lets clarify it in lower
> level, if it is UNKNOWN, let application know it is UNKNOWN.

OK.

How about the following then?

/**
 * Mask of bits used to determine the status of outer RX L4 checksum.
 * - PKT_RX_EL4_CKSUM_UNKNOWN: no information about the outer RX L4 checksum
 * - PKT_RX_EL4_CKSUM_BAD: the outer L4 checksum in the packet is wrong
 * - PKT_RX_EL4_CKSUM_GOOD: the outer L4 checksum in the packet is valid
 * - PKT_RX_EL4_CKSUM_INVALID: invalid outer L4 checksum state.
 *
 * The detection of PKT_RX_EL4_CKSUM_GOOD shall be based on the given
 * HW capability, At minimum, the PMD should support
 * PKT_RX_EL4_CKSUM_UNKNOWN  and PKT_RX_EL4_CKSUM_BAD states
 * if the offload is available.
 */
#define PKT_RX_EL4_CKSUM_MASK   ((1ULL << 21) | (1ULL << 22))

#define PKT_RX_IP_CKSUM_UNKNOWN 0
#define PKT_RX_IP_CKSUM_BAD     (1ULL << 21)
#define PKT_RX_IP_CKSUM_GOOD    (1ULL << 22)
#define PKT_RX_IP_CKSUM_INVALID ((1ULL << 21) | (1ULL << 22))

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-08 11:55                                   ` Jerin Jacob
@ 2018-10-08 12:13                                     ` Ferruh Yigit
  2018-10-08 12:25                                       ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-08 12:13 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Thomas Monjalon, Ananyev, Konstantin, Andrew Rybchenko, Lu,
	Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Mcnamara, John,
	Kovacevic, Marko, Olivier Matz, dev, shahafs, didier.pallard

On 10/8/2018 12:55 PM, Jerin Jacob wrote:
> -----Original Message-----
>> Date: Mon, 8 Oct 2018 11:53:01 +0100
>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Thomas Monjalon
>>  <thomas@monjalon.net>
>> CC: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>, Andrew Rybchenko
>>  <arybchenko@solarflare.com>, "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Wu,
>>  Jingjing" <jingjing.wu@intel.com>, "Iremonger, Bernard"
>>  <bernard.iremonger@intel.com>, "Mcnamara, John" <john.mcnamara@intel.com>,
>>  "Kovacevic, Marko" <marko.kovacevic@intel.com>, Olivier Matz
>>  <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
>>  "shahafs@mellanox.com" <shahafs@mellanox.com>, "didier.pallard@6wind.com"
>>  <didier.pallard@6wind.com>
>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>  checksum definition
>> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>>  Thunderbird/52.9.1
>>
>> On 10/8/2018 10:37 AM, Jerin Jacob wrote:
>>> -----Original Message-----
>>>> Date: Mon, 08 Oct 2018 11:04:51 +0200
>>>> From: Thomas Monjalon <thomas@monjalon.net>
>>>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Ferruh Yigit
>>>>  <ferruh.yigit@intel.com>, "Ananyev, Konstantin"
>>>>  <konstantin.ananyev@intel.com>
>>>> Cc: Andrew Rybchenko <arybchenko@solarflare.com>, "Lu, Wenzhuo"
>>>>  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
>>>>  "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Mcnamara, John"
>>>>  <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>,
>>>>  Olivier Matz <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
>>>>  "shahafs@mellanox.com" <shahafs@mellanox.com>, "didier.pallard@6wind.com"
>>>>  <didier.pallard@6wind.com>
>>>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>>>>  checksum definition
>>>>
>>>> 08/10/2018 10:24, Jerin Jacob:
>>>>> From: Ferruh Yigit <ferruh.yigit@intel.com>
>>>>>> On 10/6/2018 1:18 PM, Ananyev, Konstantin wrote:
>>>>>>> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
>>>>>>>> From: Thomas Monjalon <thomas@monjalon.net>
>>>>>>>>> However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.
>>>>>>>>
>>>>>>>> Do we need to block this patch due to the exiting PKT_RX_EIP_CKSUM_BAD
>>>>>>>> definition?
>>>>>>>>
>>>>>>>> I already added the author of the PKT_RX_EIP_CKSUM_BAD flag and ethdev and mbuf
>>>>>>>> maintainers in this list. So what else I need make forward progress
>>>>>>>> on this patch?
>>>>>>>>
>>>>>>>> I think, the definition of PKT_RX_EIP_CKSUM_BAD based on HW capability. It
>>>>>>>> is safe to assume that ALL HW can support CKSUM BAD if the feature is
>>>>>>>> available and hence it is more portable.
>>>>>>>
>>>>>>> Yes, as I remember PKT_RX_EIP_CKSUM_BAD is based on DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM.
>>>>>>
>>>>>> Switching to two bit won't reduce the portability, HW supports only reporting
>>>>>> CKSUM_BAD can set BAD || UNKNOWN.
>>>>>
>>>>> UNKNOWN is not a bit. It is represented as 0. It spec has 2 bit, then
>>>>> driver need to report GOOD as well.
>>>>>
>>>>> Same applies for PKT_RX_EL4_CKSUM as well.
>>>>>
>>>>>>
>>>>>> And I think patch is not blocked by PKT_RX_EIP_CKSUM_BAD, it can be changed
>>>>>> separately, for this patch question is can we represent PKT_RX_EL4_CKSUM_* with
>>>>>> two bits, to have BAD/GOOD/UNKNOWN?
>>>>
>>>> Yes, exact.
>>>>
>>>> PKT_RX_EIP_CKSUM_BAD must be left aside.
>>>> We should just avoid taking it as a reference.
>>>> And we can reconsider its definition later.
>>>
>>> OK.
>>>
>>> IMO, Using 2 bit scheme for tunneled checksum has following performance
>>> issue from driver side.
>>>
>>> Driver need to mark the packet as GOOD. All the HW can support
>>> detection of BAD. That not necessary mean GOOD in case of tunnel packet,
>>> so driver has to detect the packet is tunneled and packet is not BAD
>>> then mark GOOD.
>>
>> Yes UNKNOWN is not a bit, but a state, why don't use it? Why driver has to check
>> it is GOOD?
> 
> The application is going to check is it GOOD or not. Not the driver,
> Right? My concern was, If application starts dropping the packet instead checking the BAD, if
> it checks == !GOOD.

Got it, but when 2 bits state introduced, app should check if check == BAD for
drop decision, because it is not GOOD || BAD anymore.

> 
>>
>> 0x0 => UNKNOWN
>> 0x1 => BAD
>> 0x2 => GOOD
>> 0x3 => ? (invalid perhaps)
>>
>> HW that supports detecting good packets can set BAD || GOOD state, HW can detect
>> only BAD packet can set BAD || UNKNOWN state.
>>
>> If BAD is not set, there is an ambiguity of state, lets clarify it in lower
>> level, if it is UNKNOWN, let application know it is UNKNOWN.
> 
> OK.
> 
> How about the following then?
> 
> /**
>  * Mask of bits used to determine the status of outer RX L4 checksum.
>  * - PKT_RX_EL4_CKSUM_UNKNOWN: no information about the outer RX L4 checksum
>  * - PKT_RX_EL4_CKSUM_BAD: the outer L4 checksum in the packet is wrong
>  * - PKT_RX_EL4_CKSUM_GOOD: the outer L4 checksum in the packet is valid
>  * - PKT_RX_EL4_CKSUM_INVALID: invalid outer L4 checksum state.
>  *
>  * The detection of PKT_RX_EL4_CKSUM_GOOD shall be based on the given
>  * HW capability, At minimum, the PMD should support
>  * PKT_RX_EL4_CKSUM_UNKNOWN  and PKT_RX_EL4_CKSUM_BAD states
>  * if the offload is available.
>  */
> #define PKT_RX_EL4_CKSUM_MASK   ((1ULL << 21) | (1ULL << 22))
> 
> #define PKT_RX_IP_CKSUM_UNKNOWN 0
> #define PKT_RX_IP_CKSUM_BAD     (1ULL << 21)
> #define PKT_RX_IP_CKSUM_GOOD    (1ULL << 22)
> #define PKT_RX_IP_CKSUM_INVALID ((1ULL << 21) | (1ULL << 22))

Looks good to me.


> 
> 
> 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-08 12:13                                     ` Ferruh Yigit
@ 2018-10-08 12:25                                       ` Jerin Jacob
  2018-10-08 13:03                                         ` Thomas Monjalon
  0 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-08 12:25 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Thomas Monjalon, Ananyev, Konstantin, Andrew Rybchenko, Lu,
	Wenzhuo, Wu, Jingjing, Iremonger, Bernard, Mcnamara, John,
	Kovacevic, Marko, Olivier Matz, dev, shahafs, didier.pallard

-----Original Message-----
> Date: Mon, 8 Oct 2018 13:13:31 +0100
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> CC: Thomas Monjalon <thomas@monjalon.net>, "Ananyev, Konstantin"
>  <konstantin.ananyev@intel.com>, Andrew Rybchenko
>  <arybchenko@solarflare.com>, "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Wu,
>  Jingjing" <jingjing.wu@intel.com>, "Iremonger, Bernard"
>  <bernard.iremonger@intel.com>, "Mcnamara, John" <john.mcnamara@intel.com>,
>  "Kovacevic, Marko" <marko.kovacevic@intel.com>, Olivier Matz
>  <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
>  "shahafs@mellanox.com" <shahafs@mellanox.com>, "didier.pallard@6wind.com"
>  <didier.pallard@6wind.com>
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum definition
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
>  Thunderbird/52.9.1
> 
> On 10/8/2018 12:55 PM, Jerin Jacob wrote:
> > -----Original Message-----
> >> Date: Mon, 8 Oct 2018 11:53:01 +0100
> >> From: Ferruh Yigit <ferruh.yigit@intel.com>
> >> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Thomas Monjalon
> >>  <thomas@monjalon.net>
> >> CC: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>, Andrew Rybchenko
> >>  <arybchenko@solarflare.com>, "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Wu,
> >>  Jingjing" <jingjing.wu@intel.com>, "Iremonger, Bernard"
> >>  <bernard.iremonger@intel.com>, "Mcnamara, John" <john.mcnamara@intel.com>,
> >>  "Kovacevic, Marko" <marko.kovacevic@intel.com>, Olivier Matz
> >>  <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
> >>  "shahafs@mellanox.com" <shahafs@mellanox.com>, "didier.pallard@6wind.com"
> >>  <didier.pallard@6wind.com>
> >> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> >>  checksum definition
> >> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
> >>  Thunderbird/52.9.1
> >>
> >> On 10/8/2018 10:37 AM, Jerin Jacob wrote:
> >>> -----Original Message-----
> >>>> Date: Mon, 08 Oct 2018 11:04:51 +0200
> >>>> From: Thomas Monjalon <thomas@monjalon.net>
> >>>> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>, Ferruh Yigit
> >>>>  <ferruh.yigit@intel.com>, "Ananyev, Konstantin"
> >>>>  <konstantin.ananyev@intel.com>
> >>>> Cc: Andrew Rybchenko <arybchenko@solarflare.com>, "Lu, Wenzhuo"
> >>>>  <wenzhuo.lu@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>,
> >>>>  "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Mcnamara, John"
> >>>>  <john.mcnamara@intel.com>, "Kovacevic, Marko" <marko.kovacevic@intel.com>,
> >>>>  Olivier Matz <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
> >>>>  "shahafs@mellanox.com" <shahafs@mellanox.com>, "didier.pallard@6wind.com"
> >>>>  <didier.pallard@6wind.com>
> >>>> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
> >>>>  checksum definition
> >>>>
> >>>> 08/10/2018 10:24, Jerin Jacob:
> >>>>> From: Ferruh Yigit <ferruh.yigit@intel.com>
> >>>>>> On 10/6/2018 1:18 PM, Ananyev, Konstantin wrote:
> >>>>>>> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> >>>>>>>> From: Thomas Monjalon <thomas@monjalon.net>
> >>>>>>>>> However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.
> >>>>>>>>
> >>>>>>>> Do we need to block this patch due to the exiting PKT_RX_EIP_CKSUM_BAD
> >>>>>>>> definition?
> >>>>>>>>
> >>>>>>>> I already added the author of the PKT_RX_EIP_CKSUM_BAD flag and ethdev and mbuf
> >>>>>>>> maintainers in this list. So what else I need make forward progress
> >>>>>>>> on this patch?
> >>>>>>>>
> >>>>>>>> I think, the definition of PKT_RX_EIP_CKSUM_BAD based on HW capability. It
> >>>>>>>> is safe to assume that ALL HW can support CKSUM BAD if the feature is
> >>>>>>>> available and hence it is more portable.
> >>>>>>>
> >>>>>>> Yes, as I remember PKT_RX_EIP_CKSUM_BAD is based on DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM.
> >>>>>>
> >>>>>> Switching to two bit won't reduce the portability, HW supports only reporting
> >>>>>> CKSUM_BAD can set BAD || UNKNOWN.
> >>>>>
> >>>>> UNKNOWN is not a bit. It is represented as 0. It spec has 2 bit, then
> >>>>> driver need to report GOOD as well.
> >>>>>
> >>>>> Same applies for PKT_RX_EL4_CKSUM as well.
> >>>>>
> >>>>>>
> >>>>>> And I think patch is not blocked by PKT_RX_EIP_CKSUM_BAD, it can be changed
> >>>>>> separately, for this patch question is can we represent PKT_RX_EL4_CKSUM_* with
> >>>>>> two bits, to have BAD/GOOD/UNKNOWN?
> >>>>
> >>>> Yes, exact.
> >>>>
> >>>> PKT_RX_EIP_CKSUM_BAD must be left aside.
> >>>> We should just avoid taking it as a reference.
> >>>> And we can reconsider its definition later.
> >>>
> >>> OK.
> >>>
> >>> IMO, Using 2 bit scheme for tunneled checksum has following performance
> >>> issue from driver side.
> >>>
> >>> Driver need to mark the packet as GOOD. All the HW can support
> >>> detection of BAD. That not necessary mean GOOD in case of tunnel packet,
> >>> so driver has to detect the packet is tunneled and packet is not BAD
> >>> then mark GOOD.
> >>
> >> Yes UNKNOWN is not a bit, but a state, why don't use it? Why driver has to check
> >> it is GOOD?
> >
> > The application is going to check is it GOOD or not. Not the driver,
> > Right? My concern was, If application starts dropping the packet instead checking the BAD, if
> > it checks == !GOOD.
> 
> Got it, but when 2 bits state introduced, app should check if check == BAD for
> drop decision, because it is not GOOD || BAD anymore.

Got it.

> 
> >
> >>
> >> 0x0 => UNKNOWN
> >> 0x1 => BAD
> >> 0x2 => GOOD
> >> 0x3 => ? (invalid perhaps)
> >>
> >> HW that supports detecting good packets can set BAD || GOOD state, HW can detect
> >> only BAD packet can set BAD || UNKNOWN state.
> >>
> >> If BAD is not set, there is an ambiguity of state, lets clarify it in lower
> >> level, if it is UNKNOWN, let application know it is UNKNOWN.
> >
> > OK.
> >
> > How about the following then?
> >
> > /**
> >  * Mask of bits used to determine the status of outer RX L4 checksum.
> >  * - PKT_RX_EL4_CKSUM_UNKNOWN: no information about the outer RX L4 checksum
> >  * - PKT_RX_EL4_CKSUM_BAD: the outer L4 checksum in the packet is wrong
> >  * - PKT_RX_EL4_CKSUM_GOOD: the outer L4 checksum in the packet is valid
> >  * - PKT_RX_EL4_CKSUM_INVALID: invalid outer L4 checksum state.
> >  *
> >  * The detection of PKT_RX_EL4_CKSUM_GOOD shall be based on the given
> >  * HW capability, At minimum, the PMD should support
> >  * PKT_RX_EL4_CKSUM_UNKNOWN  and PKT_RX_EL4_CKSUM_BAD states
> >  * if the offload is available.
> >  */
> > #define PKT_RX_EL4_CKSUM_MASK   ((1ULL << 21) | (1ULL << 22))
> >
> > #define PKT_RX_IP_CKSUM_UNKNOWN 0
> > #define PKT_RX_IP_CKSUM_BAD     (1ULL << 21)
> > #define PKT_RX_IP_CKSUM_GOOD    (1ULL << 22)
> > #define PKT_RX_IP_CKSUM_INVALID ((1ULL << 21) | (1ULL << 22))
> 
> Looks good to me.

If there is no objection with above flag definition, I will send the v3 with that.

> 
> 
> >
> >
> >
> 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-08 12:25                                       ` Jerin Jacob
@ 2018-10-08 13:03                                         ` Thomas Monjalon
  2018-10-08 13:08                                           ` Jerin Jacob
  0 siblings, 1 reply; 87+ messages in thread
From: Thomas Monjalon @ 2018-10-08 13:03 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Ferruh Yigit, Ananyev, Konstantin, Andrew Rybchenko, Lu, Wenzhuo,
	Wu, Jingjing, Iremonger, Bernard, Mcnamara, John, Kovacevic,
	Marko, Olivier Matz, dev, shahafs, didier.pallard

08/10/2018 14:25, Jerin Jacob:
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> > On 10/8/2018 12:55 PM, Jerin Jacob wrote:
> > > From: Ferruh Yigit <ferruh.yigit@intel.com>
> > >> On 10/8/2018 10:37 AM, Jerin Jacob wrote:
> > >>> From: Thomas Monjalon <thomas@monjalon.net>
> > >>>> 08/10/2018 10:24, Jerin Jacob:
> > >>>>> From: Ferruh Yigit <ferruh.yigit@intel.com>
> > >>>>>> On 10/6/2018 1:18 PM, Ananyev, Konstantin wrote:
> > >>>>>>> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > >>>>>>>> From: Thomas Monjalon <thomas@monjalon.net>
> > >>>>>>>>> However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.
> > >>>>>>>>
> > >>>>>>>> Do we need to block this patch due to the exiting PKT_RX_EIP_CKSUM_BAD
> > >>>>>>>> definition?
> > >>>>>>>>
> > >>>>>>>> I already added the author of the PKT_RX_EIP_CKSUM_BAD flag and ethdev and mbuf
> > >>>>>>>> maintainers in this list. So what else I need make forward progress
> > >>>>>>>> on this patch?
> > >>>>>>>>
> > >>>>>>>> I think, the definition of PKT_RX_EIP_CKSUM_BAD based on HW capability. It
> > >>>>>>>> is safe to assume that ALL HW can support CKSUM BAD if the feature is
> > >>>>>>>> available and hence it is more portable.
> > >>>>>>>
> > >>>>>>> Yes, as I remember PKT_RX_EIP_CKSUM_BAD is based on DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM.
> > >>>>>>
> > >>>>>> Switching to two bit won't reduce the portability, HW supports only reporting
> > >>>>>> CKSUM_BAD can set BAD || UNKNOWN.
> > >>>>>
> > >>>>> UNKNOWN is not a bit. It is represented as 0. It spec has 2 bit, then
> > >>>>> driver need to report GOOD as well.
> > >>>>>
> > >>>>> Same applies for PKT_RX_EL4_CKSUM as well.
> > >>>>>
> > >>>>>>
> > >>>>>> And I think patch is not blocked by PKT_RX_EIP_CKSUM_BAD, it can be changed
> > >>>>>> separately, for this patch question is can we represent PKT_RX_EL4_CKSUM_* with
> > >>>>>> two bits, to have BAD/GOOD/UNKNOWN?
> > >>>>
> > >>>> Yes, exact.
> > >>>>
> > >>>> PKT_RX_EIP_CKSUM_BAD must be left aside.
> > >>>> We should just avoid taking it as a reference.
> > >>>> And we can reconsider its definition later.
> > >>>
> > >>> OK.
> > >>>
> > >>> IMO, Using 2 bit scheme for tunneled checksum has following performance
> > >>> issue from driver side.
> > >>>
> > >>> Driver need to mark the packet as GOOD. All the HW can support
> > >>> detection of BAD. That not necessary mean GOOD in case of tunnel packet,
> > >>> so driver has to detect the packet is tunneled and packet is not BAD
> > >>> then mark GOOD.
> > >>
> > >> Yes UNKNOWN is not a bit, but a state, why don't use it? Why driver has to check
> > >> it is GOOD?
> > >
> > > The application is going to check is it GOOD or not. Not the driver,
> > > Right? My concern was, If application starts dropping the packet instead checking the BAD, if
> > > it checks == !GOOD.
> > 
> > Got it, but when 2 bits state introduced, app should check if check == BAD for
> > drop decision, because it is not GOOD || BAD anymore.
> 
> Got it.
> 
> > 
> > >
> > >>
> > >> 0x0 => UNKNOWN
> > >> 0x1 => BAD
> > >> 0x2 => GOOD
> > >> 0x3 => ? (invalid perhaps)
> > >>
> > >> HW that supports detecting good packets can set BAD || GOOD state, HW can detect
> > >> only BAD packet can set BAD || UNKNOWN state.
> > >>
> > >> If BAD is not set, there is an ambiguity of state, lets clarify it in lower
> > >> level, if it is UNKNOWN, let application know it is UNKNOWN.
> > >
> > > OK.
> > >
> > > How about the following then?
> > >
> > > /**
> > >  * Mask of bits used to determine the status of outer RX L4 checksum.
> > >  * - PKT_RX_EL4_CKSUM_UNKNOWN: no information about the outer RX L4 checksum
> > >  * - PKT_RX_EL4_CKSUM_BAD: the outer L4 checksum in the packet is wrong
> > >  * - PKT_RX_EL4_CKSUM_GOOD: the outer L4 checksum in the packet is valid
> > >  * - PKT_RX_EL4_CKSUM_INVALID: invalid outer L4 checksum state.
> > >  *
> > >  * The detection of PKT_RX_EL4_CKSUM_GOOD shall be based on the given
> > >  * HW capability, At minimum, the PMD should support
> > >  * PKT_RX_EL4_CKSUM_UNKNOWN  and PKT_RX_EL4_CKSUM_BAD states
> > >  * if the offload is available.
> > >  */
> > > #define PKT_RX_EL4_CKSUM_MASK   ((1ULL << 21) | (1ULL << 22))
> > >
> > > #define PKT_RX_IP_CKSUM_UNKNOWN 0
> > > #define PKT_RX_IP_CKSUM_BAD     (1ULL << 21)
> > > #define PKT_RX_IP_CKSUM_GOOD    (1ULL << 22)
> > > #define PKT_RX_IP_CKSUM_INVALID ((1ULL << 21) | (1ULL << 22))
> > 
> > Looks good to me.
> 
> If there is no objection with above flag definition, I will send the v3 with that.

Just one objection about the name.
Why naming it EL4 and commenting as outer L4?
I think we should choose between "external" and "outer".
Convention seems to be choosing "outer" word.
So I suggest PKT_RX_OUTER_L4_CKSUM_*.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-08 13:03                                         ` Thomas Monjalon
@ 2018-10-08 13:08                                           ` Jerin Jacob
  0 siblings, 0 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-08 13:08 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Ferruh Yigit, Ananyev, Konstantin, Andrew Rybchenko, Lu, Wenzhuo,
	Wu, Jingjing, Iremonger, Bernard, Mcnamara, John, Kovacevic,
	Marko, Olivier Matz, dev, shahafs, didier.pallard

-----Original Message-----
> Date: Mon, 08 Oct 2018 15:03:49 +0200
> From: Thomas Monjalon <thomas@monjalon.net>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> Cc: Ferruh Yigit <ferruh.yigit@intel.com>, "Ananyev, Konstantin"
>  <konstantin.ananyev@intel.com>, Andrew Rybchenko
>  <arybchenko@solarflare.com>, "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Wu,
>  Jingjing" <jingjing.wu@intel.com>, "Iremonger, Bernard"
>  <bernard.iremonger@intel.com>, "Mcnamara, John" <john.mcnamara@intel.com>,
>  "Kovacevic, Marko" <marko.kovacevic@intel.com>, Olivier Matz
>  <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>,
>  "shahafs@mellanox.com" <shahafs@mellanox.com>, "didier.pallard@6wind.com"
>  <didier.pallard@6wind.com>
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP
>  checksum definition
> 
> 08/10/2018 14:25, Jerin Jacob:
> > From: Ferruh Yigit <ferruh.yigit@intel.com>
> > > On 10/8/2018 12:55 PM, Jerin Jacob wrote:
> > > > From: Ferruh Yigit <ferruh.yigit@intel.com>
> > > >> On 10/8/2018 10:37 AM, Jerin Jacob wrote:
> > > >>> From: Thomas Monjalon <thomas@monjalon.net>
> > > >>>> 08/10/2018 10:24, Jerin Jacob:
> > > >>>>> From: Ferruh Yigit <ferruh.yigit@intel.com>
> > > >>>>>> On 10/6/2018 1:18 PM, Ananyev, Konstantin wrote:
> > > >>>>>>> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> > > >>>>>>>> From: Thomas Monjalon <thomas@monjalon.net>
> > > >>>>>>>>> However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.
> > > >>>>>>>>
> > > >>>>>>>> Do we need to block this patch due to the exiting PKT_RX_EIP_CKSUM_BAD
> > > >>>>>>>> definition?
> > > >>>>>>>>
> > > >>>>>>>> I already added the author of the PKT_RX_EIP_CKSUM_BAD flag and ethdev and mbuf
> > > >>>>>>>> maintainers in this list. So what else I need make forward progress
> > > >>>>>>>> on this patch?
> > > >>>>>>>>
> > > >>>>>>>> I think, the definition of PKT_RX_EIP_CKSUM_BAD based on HW capability. It
> > > >>>>>>>> is safe to assume that ALL HW can support CKSUM BAD if the feature is
> > > >>>>>>>> available and hence it is more portable.
> > > >>>>>>>
> > > >>>>>>> Yes, as I remember PKT_RX_EIP_CKSUM_BAD is based on DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM.
> > > >>>>>>
> > > >>>>>> Switching to two bit won't reduce the portability, HW supports only reporting
> > > >>>>>> CKSUM_BAD can set BAD || UNKNOWN.
> > > >>>>>
> > > >>>>> UNKNOWN is not a bit. It is represented as 0. It spec has 2 bit, then
> > > >>>>> driver need to report GOOD as well.
> > > >>>>>
> > > >>>>> Same applies for PKT_RX_EL4_CKSUM as well.
> > > >>>>>
> > > >>>>>>
> > > >>>>>> And I think patch is not blocked by PKT_RX_EIP_CKSUM_BAD, it can be changed
> > > >>>>>> separately, for this patch question is can we represent PKT_RX_EL4_CKSUM_* with
> > > >>>>>> two bits, to have BAD/GOOD/UNKNOWN?
> > > >>>>
> > > >>>> Yes, exact.
> > > >>>>
> > > >>>> PKT_RX_EIP_CKSUM_BAD must be left aside.
> > > >>>> We should just avoid taking it as a reference.
> > > >>>> And we can reconsider its definition later.
> > > >>>
> > > >>> OK.
> > > >>>
> > > >>> IMO, Using 2 bit scheme for tunneled checksum has following performance
> > > >>> issue from driver side.
> > > >>>
> > > >>> Driver need to mark the packet as GOOD. All the HW can support
> > > >>> detection of BAD. That not necessary mean GOOD in case of tunnel packet,
> > > >>> so driver has to detect the packet is tunneled and packet is not BAD
> > > >>> then mark GOOD.
> > > >>
> > > >> Yes UNKNOWN is not a bit, but a state, why don't use it? Why driver has to check
> > > >> it is GOOD?
> > > >
> > > > The application is going to check is it GOOD or not. Not the driver,
> > > > Right? My concern was, If application starts dropping the packet instead checking the BAD, if
> > > > it checks == !GOOD.
> > >
> > > Got it, but when 2 bits state introduced, app should check if check == BAD for
> > > drop decision, because it is not GOOD || BAD anymore.
> >
> > Got it.
> >
> > >
> > > >
> > > >>
> > > >> 0x0 => UNKNOWN
> > > >> 0x1 => BAD
> > > >> 0x2 => GOOD
> > > >> 0x3 => ? (invalid perhaps)
> > > >>
> > > >> HW that supports detecting good packets can set BAD || GOOD state, HW can detect
> > > >> only BAD packet can set BAD || UNKNOWN state.
> > > >>
> > > >> If BAD is not set, there is an ambiguity of state, lets clarify it in lower
> > > >> level, if it is UNKNOWN, let application know it is UNKNOWN.
> > > >
> > > > OK.
> > > >
> > > > How about the following then?
> > > >
> > > > /**
> > > >  * Mask of bits used to determine the status of outer RX L4 checksum.
> > > >  * - PKT_RX_EL4_CKSUM_UNKNOWN: no information about the outer RX L4 checksum
> > > >  * - PKT_RX_EL4_CKSUM_BAD: the outer L4 checksum in the packet is wrong
> > > >  * - PKT_RX_EL4_CKSUM_GOOD: the outer L4 checksum in the packet is valid
> > > >  * - PKT_RX_EL4_CKSUM_INVALID: invalid outer L4 checksum state.
> > > >  *
> > > >  * The detection of PKT_RX_EL4_CKSUM_GOOD shall be based on the given
> > > >  * HW capability, At minimum, the PMD should support
> > > >  * PKT_RX_EL4_CKSUM_UNKNOWN  and PKT_RX_EL4_CKSUM_BAD states
> > > >  * if the offload is available.
> > > >  */
> > > > #define PKT_RX_EL4_CKSUM_MASK   ((1ULL << 21) | (1ULL << 22))
> > > >
> > > > #define PKT_RX_IP_CKSUM_UNKNOWN 0
> > > > #define PKT_RX_IP_CKSUM_BAD     (1ULL << 21)
> > > > #define PKT_RX_IP_CKSUM_GOOD    (1ULL << 22)
> > > > #define PKT_RX_IP_CKSUM_INVALID ((1ULL << 21) | (1ULL << 22))
> > >
> > > Looks good to me.
> >
> > If there is no objection with above flag definition, I will send the v3 with that.
> 
> Just one objection about the name.
> Why naming it EL4 and commenting as outer L4?
> I think we should choose between "external" and "outer".
> Convention seems to be choosing "outer" word.
> So I suggest PKT_RX_OUTER_L4_CKSUM_*.

OK. I will change to PKT_RX_OUTER_L4_CKSUM_*

> 
> 
> 

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-03 18:16 ` [dpdk-dev] [PATCH v3 " Jerin Jacob
                     ` (2 preceding siblings ...)
  2018-10-03 18:16   ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
@ 2018-10-08 16:09   ` Jerin Jacob
  2018-10-08 16:09     ` [dpdk-dev] [PATCH v4 2/4] ethdev: add Tx " Jerin Jacob
                       ` (4 more replies)
  3 siblings, 5 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-08 16:09 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz
  Cc: dev, Jerin Jacob

Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
PKT_RX_OUTER_L4_CKSUM_* mbuf ol_flags to detect outer UDP checksum
status.

- To use hardware Rx outer UDP checksum offload, the user needs to
configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.

- Driver updates checksum status in mbuf ol_flag as
PKT_RX_OUTER_L4_CKSUM_* flags.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
This patch series is depended on http://patches.dpdk.org/patch/45840/
v4:

- Replaced PKT_RX_EL4_CKSUM_BAD with PKT_RX_OUTER_L4_CKSUM_* flags

v3:
- Mention in git commit log that PKT_RX_EL4_CKSUM_BAD based one bit scheme
selected based on exiting outer L3 PKT_RX_EIP_CKSUM_BAD one bit flag scheme.

- Removed extra empty line in features.rst (Andrew Rybchenko)

v2:
- Removed DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM
as there is no realworld use case for it.
See: http://patches.dpdk.org/patch/44692/

---
 app/test-pmd/config.c          |  9 +++++++++
 doc/guides/nics/features.rst   |  5 +++++
 lib/librte_ethdev/rte_ethdev.c |  1 +
 lib/librte_ethdev/rte_ethdev.h |  1 +
 lib/librte_mbuf/rte_mbuf.c     | 12 ++++++++++++
 lib/librte_mbuf/rte_mbuf.h     | 19 +++++++++++++++++++
 6 files changed, 47 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1adc9b94b..d53c527e5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -594,6 +594,15 @@ port_offload_cap_display(portid_t port_id)
 			printf("off\n");
 	}
 
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_UDP_CKSUM) {
+		printf("RX Outer UDP checksum:               ");
+		if (ports[port_id].dev_conf.rxmode.offloads &
+		    DEV_RX_OFFLOAD_OUTER_UDP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
 	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {
 		printf("Large receive offload:         ");
 		if (ports[port_id].dev_conf.rxmode.offloads &
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index d42489b6d..998f67c8e 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -639,6 +639,11 @@ Inner L4 checksum
 
 Supports inner packet L4 checksum.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_OUTER_L4_CKSUM_UNKNOWN`` |
+  ``PKT_RX_OUTER_L4_CKSUM_BAD`` | ``PKT_RX_OUTER_L4_CKSUM_GOOD`` | ``PKT_RX_OUTER_L4_CKSUM_INVALID``.
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``,
+
 
 .. _nic_features_packet_type_parsing:
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index e9a82fe7f..a630c4fda 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -127,6 +127,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d02db14ad..821d371c3 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -889,6 +889,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SECURITY         0x00008000
 #define DEV_RX_OFFLOAD_KEEP_CRC		0x00010000
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
+#define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index e714c5a59..c1740ce0c 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -301,6 +301,11 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask)
 	case PKT_RX_TIMESTAMP: return "PKT_RX_TIMESTAMP";
 	case PKT_RX_SEC_OFFLOAD: return "PKT_RX_SEC_OFFLOAD";
 	case PKT_RX_SEC_OFFLOAD_FAILED: return "PKT_RX_SEC_OFFLOAD_FAILED";
+	case PKT_RX_OUTER_L4_CKSUM_BAD: return "PKT_RX_OUTER_L4_CKSUM_BAD";
+	case PKT_RX_OUTER_L4_CKSUM_GOOD: return "PKT_RX_OUTER_L4_CKSUM_GOOD";
+	case PKT_RX_OUTER_L4_CKSUM_INVALID:
+		return "PKT_RX_OUTER_L4_CKSUM_INVALID";
+
 	default: return NULL;
 	}
 }
@@ -339,6 +344,13 @@ rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		{ PKT_RX_SEC_OFFLOAD, PKT_RX_SEC_OFFLOAD, NULL },
 		{ PKT_RX_SEC_OFFLOAD_FAILED, PKT_RX_SEC_OFFLOAD_FAILED, NULL },
 		{ PKT_RX_QINQ, PKT_RX_QINQ, NULL },
+		{ PKT_RX_OUTER_L4_CKSUM_BAD, PKT_RX_OUTER_L4_CKSUM_MASK, NULL },
+		{ PKT_RX_OUTER_L4_CKSUM_GOOD, PKT_RX_OUTER_L4_CKSUM_MASK,
+		  NULL },
+		{ PKT_RX_OUTER_L4_CKSUM_INVALID, PKT_RX_OUTER_L4_CKSUM_MASK,
+		  NULL },
+		{ PKT_RX_OUTER_L4_CKSUM_UNKNOWN, PKT_RX_OUTER_L4_CKSUM_MASK,
+		  "PKT_RX_OUTER_L4_CKSUM_UNKNOWN" },
 	};
 	const char *name;
 	unsigned int i;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index eb11779e7..a453ec008 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -177,6 +177,25 @@ extern "C" {
  */
 #define PKT_RX_QINQ          (1ULL << 20)
 
+/**
+ * Mask of bits used to determine the status of outer RX L4 checksum.
+ * - PKT_RX_OUTER_L4_CKSUM_UNKNOWN: no info about the outer RX L4 checksum
+ * - PKT_RX_OUTER_L4_CKSUM_BAD: the outer L4 checksum in the packet is wrong
+ * - PKT_RX_OUTER_L4_CKSUM_GOOD: the outer L4 checksum in the packet is valid
+ * - PKT_RX_OUTER_L4_CKSUM_INVALID: invalid outer L4 checksum state.
+ *
+ * The detection of PKT_RX_OUTER_L4_CKSUM_GOOD shall be based on the given
+ * HW capability, At minimum, the PMD should support
+ * PKT_RX_OUTER_L4_CKSUM_UNKNOWN and PKT_RX_OUTER_L4_CKSUM_BAD states
+ * if the DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload is available.
+ */
+#define PKT_RX_OUTER_L4_CKSUM_MASK	((1ULL << 21) | (1ULL << 22))
+
+#define PKT_RX_OUTER_L4_CKSUM_UNKNOWN	0
+#define PKT_RX_OUTER_L4_CKSUM_BAD	(1ULL << 21)
+#define PKT_RX_OUTER_L4_CKSUM_GOOD	(1ULL << 22)
+#define PKT_RX_OUTER_L4_CKSUM_INVALID	((1ULL << 21) | (1ULL << 22))
+
 /* add new RX flags here */
 
 /* add new TX flags here */
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v4 2/4] ethdev: add Tx offload outer UDP checksum definition
  2018-10-08 16:09   ` [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
@ 2018-10-08 16:09     ` Jerin Jacob
  2018-10-09 10:06       ` Andrew Rybchenko
  2018-10-08 16:09     ` [dpdk-dev] [PATCH v4 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
                       ` (3 subsequent siblings)
  4 siblings, 1 reply; 87+ messages in thread
From: Jerin Jacob @ 2018-10-08 16:09 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz
  Cc: dev, Jerin Jacob

Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and
PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer UDP
checksum offload.

To use hardware Tx outer UDP checksum offload, the user needs to,

- enable following in mbuf:
a) fill outer_l2_len and outer_l3_len in mbuf
b) set the PKT_TX_OUTER_UDP_CKSUM flag
c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6

- configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
v3:

- Git comment corrections (Andrew Rybchenko)
s/PKT_TX_OUTER_TCP_CKSUM/PKT_TX_OUTER_UDP_CKSUM/g
s/mbuff/mbuf/g

v2:
- Removed DEV_TX_OFFLOAD_OUTER_TCP_CKSUM and DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM
as there is no realworld use case for it.
See: http://patches.dpdk.org/patch/44692/

This patch series is depended on http://patches.dpdk.org/patch/45840/
---
 app/test-pmd/config.c          | 10 ++++++++++
 doc/guides/nics/features.rst   |  5 +++++
 lib/librte_ethdev/rte_ethdev.c |  1 +
 lib/librte_ethdev/rte_ethdev.h |  2 ++
 lib/librte_mbuf/rte_mbuf.c     |  1 +
 lib/librte_mbuf/rte_mbuf.h     |  6 +++++-
 6 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index d53c527e5..5d9745ae5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -773,6 +773,16 @@ port_offload_cap_display(portid_t port_id)
 		else
 			printf("off\n");
 	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
+		printf("TX Outer UDP checksum:               ");
+		if (ports[port_id].dev_conf.txmode.offloads &
+		    DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
 }
 
 int
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 998f67c8e..bc5fff2c1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -642,7 +642,12 @@ Supports inner packet L4 checksum.
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_OUTER_L4_CKSUM_UNKNOWN`` |
   ``PKT_RX_OUTER_L4_CKSUM_BAD`` | ``PKT_RX_OUTER_L4_CKSUM_GOOD`` | ``PKT_RX_OUTER_L4_CKSUM_INVALID``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM``.
+* **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_OUTER_IPV4`` | ``PKT_TX_OUTER_IPV6``.
+  ``mbuf.ol_flags:PKT_TX_OUTER_UDP_CKSUM``.
+* **[uses]     mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``,
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM``.
 
 
 .. _nic_features_packet_type_parsing:
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index a630c4fda..bb48b5a0f 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -159,6 +159,7 @@ static const struct {
 	RTE_TX_OFFLOAD_BIT2STR(SECURITY),
 	RTE_TX_OFFLOAD_BIT2STR(UDP_TNL_TSO),
 	RTE_TX_OFFLOAD_BIT2STR(IP_TNL_TSO),
+	RTE_TX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 };
 
 #undef RTE_TX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 821d371c3..79d0bb1ed 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -944,6 +944,8 @@ struct rte_eth_conf {
  * for tunnel TSO.
  */
 #define DEV_TX_OFFLOAD_IP_TNL_TSO       0x00080000
+/** Device supports outer UDP checksum */
+#define DEV_TX_OFFLOAD_OUTER_UDP_CKSUM  0x00100000
 
 #define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001
 /**< Device supports Rx queue setup after device started*/
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index c1740ce0c..c59c5bb0d 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -447,6 +447,7 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		  "PKT_TX_TUNNEL_NONE" },
 		{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
 		{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
+		{ PKT_TX_OUTER_UDP_CKSUM, PKT_TX_OUTER_UDP_CKSUM, NULL },
 	};
 	const char *name;
 	unsigned int i;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index a453ec008..61e6fca4d 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -200,6 +200,9 @@ extern "C" {
 
 /* add new TX flags here */
 
+/**< Outer UDP cksum of TX pkt. computed by NIC. */
+#define PKT_TX_OUTER_UDP_CKSUM     (1ULL << 41)
+
 /**
  * UDP Fragmentation Offload flag. This flag is used for enabling UDP
  * fragmentation in SW or in HW. When use UFO, mbuf->tso_segsz is used
@@ -367,7 +370,8 @@ extern "C" {
 		PKT_TX_TUNNEL_MASK |	 \
 		PKT_TX_MACSEC |		 \
 		PKT_TX_SEC_OFFLOAD |	\
-		PKT_TX_UDP_SEG)
+		PKT_TX_UDP_SEG |	\
+		PKT_TX_OUTER_UDP_CKSUM)
 
 /**
  * Mbuf having an external buffer attached. shinfo in mbuf must be filled.
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v4 3/4] app/testpmd: add outer UDP HW checksum support
  2018-10-08 16:09   ` [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
  2018-10-08 16:09     ` [dpdk-dev] [PATCH v4 2/4] ethdev: add Tx " Jerin Jacob
@ 2018-10-08 16:09     ` Jerin Jacob
  2018-10-08 16:09     ` [dpdk-dev] [PATCH v4 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-08 16:09 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic
  Cc: dev, thomas, ferruh.yigit, arybchenko, olivier.matz, Jerin Jacob

Added outer-udp Tx HW checksum support for csum forward engine
if device supports DEV_TX_OFFLOAD_OUTER_UDP_CKSUM.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---

v3:
- Added Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

v2:
- Added outer-udp support for csum engine
---
 app/test-pmd/cmdline.c                      | 24 ++++++++++++++++++---
 app/test-pmd/csumonly.c                     | 13 +++++++++--
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  8 +++++--
 3 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0c5399dc4..2fd007423 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -397,12 +397,13 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"    Disable hardware insertion of a VLAN header in"
 			" packets sent on a port.\n\n"
 
-			"csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)\n"
+			"csum set (ip|udp|tcp|sctp|outer-ip|outer-udp) (hw|sw) (port_id)\n"
 			"    Select hardware or software calculation of the"
 			" checksum when transmitting a packet using the"
 			" csum forward engine.\n"
 			"    ip|udp|tcp|sctp always concern the inner layer.\n"
 			"    outer-ip concerns the outer IP layer in"
+			"    outer-udp concerns the outer UDP layer in"
 			" case the packet is recognized as a tunnel packet by"
 			" the forward engine (vxlan, gre and ipip are supported)\n"
 			"    Please check the NIC datasheet for HW limits.\n\n"
@@ -4177,6 +4178,8 @@ csum_show(int port_id)
 		(tx_offloads & DEV_TX_OFFLOAD_SCTP_CKSUM) ? "hw" : "sw");
 	printf("Outer-Ip checksum offload is %s\n",
 		(tx_offloads & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ? "hw" : "sw");
+	printf("Outer-Udp checksum offload is %s\n",
+		(tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ? "hw" : "sw");
 
 	/* display warnings if configuration is not supported by the NIC */
 	rte_eth_dev_info_get(port_id, &dev_info);
@@ -4205,6 +4208,12 @@ csum_show(int port_id)
 		printf("Warning: hardware outer IP checksum enabled but not "
 			"supported by port %d\n", port_id);
 	}
+	if ((tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) &&
+		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
+			== 0) {
+		printf("Warning: hardware outer UDP checksum enabled but not "
+			"supported by port %d\n", port_id);
+	}
 }
 
 static void
@@ -4273,6 +4282,15 @@ cmd_csum_parsed(void *parsed_result,
 				printf("Outer IP checksum offload is not "
 				       "supported by port %u\n", res->port_id);
 			}
+		} else if (!strcmp(res->proto, "outer-udp")) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+					DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)) {
+				csum_offloads |=
+						DEV_TX_OFFLOAD_OUTER_UDP_CKSUM;
+			} else {
+				printf("Outer UDP checksum offload is not "
+				       "supported by port %u\n", res->port_id);
+			}
 		}
 
 		if (hw) {
@@ -4296,7 +4314,7 @@ cmdline_parse_token_string_t cmd_csum_mode =
 				mode, "set");
 cmdline_parse_token_string_t cmd_csum_proto =
 	TOKEN_STRING_INITIALIZER(struct cmd_csum_result,
-				proto, "ip#tcp#udp#sctp#outer-ip");
+				proto, "ip#tcp#udp#sctp#outer-ip#outer-udp");
 cmdline_parse_token_string_t cmd_csum_hwsw =
 	TOKEN_STRING_INITIALIZER(struct cmd_csum_result,
 				hwsw, "hw#sw");
@@ -4307,7 +4325,7 @@ cmdline_parse_token_num_t cmd_csum_portid =
 cmdline_parse_inst_t cmd_csum_set = {
 	.f = cmd_csum_parsed,
 	.data = NULL,
-	.help_str = "csum set ip|tcp|udp|sctp|outer-ip hw|sw <port_id>: "
+	.help_str = "csum set ip|tcp|udp|sctp|outer-ip|outer-udp hw|sw <port_id>: "
 		"Enable/Disable hardware calculation of L3/L4 checksum when "
 		"using csum forward engine",
 	.tokens = {
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 494829266..ea5b112d6 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -468,10 +468,15 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
 	if (info->outer_l4_proto != IPPROTO_UDP)
 		return ol_flags;
 
+	/* Skip SW outer UDP checksum generation if HW supports it */
+	if (tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
+		ol_flags |= PKT_TX_OUTER_UDP_CKSUM;
+		return ol_flags;
+	}
+
 	udp_hdr = (struct udp_hdr *)((char *)outer_l3_hdr + info->outer_l3_len);
 
-	/* outer UDP checksum is done in software as we have no hardware
-	 * supporting it today, and no API for it. In the other side, for
+	/* outer UDP checksum is done in software. In the other side, for
 	 * UDP tunneling, like VXLAN or Geneve, outer UDP checksum can be
 	 * set to zero.
 	 *
@@ -826,6 +831,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			if (info.tunnel_tso_segsz ||
 			    (tx_offloads &
 			     DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
+			    (tx_offloads &
+			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
 			    (tx_ol_flags & PKT_TX_OUTER_IPV6)) {
 				m->outer_l2_len = info.outer_l2_len;
 				m->outer_l3_len = info.outer_l3_len;
@@ -898,6 +905,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			if (info.is_tunnel == 1) {
 				if ((tx_offloads &
 				    DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
+				    (tx_offloads &
+				    DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
 				    (tx_ol_flags & PKT_TX_OUTER_IPV6))
 					printf("tx: m->outer_l2_len=%d "
 						"m->outer_l3_len=%d\n",
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 3a73000a6..cfcabf6f0 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -857,7 +857,7 @@ csum set
 Select hardware or software calculation of the checksum when
 transmitting a packet using the ``csum`` forwarding engine::
 
-   testpmd> csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)
+   testpmd> csum set (ip|udp|tcp|sctp|outer-ip|outer-udp) (hw|sw) (port_id)
 
 Where:
 
@@ -867,6 +867,10 @@ Where:
   as a tunnel packet by the forwarding engine (vxlan, gre and ipip are
   supported). See also the ``csum parse-tunnel`` command.
 
+* ``outer-udp`` relates to the outer UDP layer in the case where the packet is recognized
+  as a tunnel packet by the forwarding engine (vxlan, vxlan-gpe are
+  supported). See also the ``csum parse-tunnel`` command.
+
 .. note::
 
    Check the NIC Datasheet for hardware limits.
@@ -940,7 +944,7 @@ Consider a packet in packet like the following::
 
 * If parse-tunnel is enabled, the ``ip|udp|tcp|sctp`` parameters of ``csum set``
   command relate to the inner headers (here ``ipv4_in`` and ``tcp_in``), and the
-  ``outer-ip parameter`` relates to the outer headers (here ``ipv4_out``).
+  ``outer-ip|outer-udp`` parameter relates to the outer headers (here ``ipv4_out`` and ``udp_out``).
 
 * If parse-tunnel is disabled, the ``ip|udp|tcp|sctp`` parameters of ``csum  set``
    command relate to the outer headers, here ``ipv4_out`` and ``udp_out``.
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v4 4/4] app/testpmd: collect bad outer L4 checksum for csum engine
  2018-10-08 16:09   ` [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
  2018-10-08 16:09     ` [dpdk-dev] [PATCH v4 2/4] ethdev: add Tx " Jerin Jacob
  2018-10-08 16:09     ` [dpdk-dev] [PATCH v4 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
@ 2018-10-08 16:09     ` Jerin Jacob
  2018-10-09 10:06     ` [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition Andrew Rybchenko
  2018-10-09 14:18     ` [dpdk-dev] [PATCH v5 " Jerin Jacob
  4 siblings, 0 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-08 16:09 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger
  Cc: dev, thomas, ferruh.yigit, arybchenko, olivier.matz, Jerin Jacob

Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD
errors.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---

v4:

- Added Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
- s/PKT_RX_EL4_CKSUM_BAD/PKT_RX_OUTER_L4_CKSUM_BAD

v3:
- Added Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
- Removed unnecessary extra empty line(Andrew Rybchenko)
- Simplify calculation rx_bad_outer_l4_csum logic(Andrew Rybchenko)

v2:
- Added PKT_RX_EL4_CKSUM_BAD statistics
---
 app/test-pmd/csumonly.c |  5 +++++
 app/test-pmd/testpmd.c  | 18 +++++++++++++-----
 app/test-pmd/testpmd.h  |  4 ++++
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index ea5b112d6..dce4b9be7 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -701,6 +701,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	uint32_t retry;
 	uint32_t rx_bad_ip_csum;
 	uint32_t rx_bad_l4_csum;
+	uint32_t rx_bad_outer_l4_csum;
 	struct testpmd_offload_info info;
 	uint16_t nb_segments = 0;
 	int ret;
@@ -726,6 +727,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	fs->rx_packets += nb_rx;
 	rx_bad_ip_csum = 0;
 	rx_bad_l4_csum = 0;
+	rx_bad_outer_l4_csum = 0;
 	gro_enable = gro_ports[fs->rx_port].enable;
 
 	txp = &ports[fs->tx_port];
@@ -753,6 +755,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			rx_bad_ip_csum += 1;
 		if ((rx_ol_flags & PKT_RX_L4_CKSUM_MASK) == PKT_RX_L4_CKSUM_BAD)
 			rx_bad_l4_csum += 1;
+		if (rx_ol_flags & PKT_RX_OUTER_L4_CKSUM_BAD)
+			rx_bad_outer_l4_csum += 1;
 
 		/* step 1: dissect packet, parsing optional vlan, ip4/ip6, vxlan
 		 * and inner headers */
@@ -991,6 +995,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	fs->tx_packets += nb_tx;
 	fs->rx_bad_ip_csum += rx_bad_ip_csum;
 	fs->rx_bad_l4_csum += rx_bad_l4_csum;
+	fs->rx_bad_outer_l4_csum += rx_bad_outer_l4_csum;
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 	fs->tx_burst_stats.pkt_burst_spread[nb_tx]++;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 001f0e552..2a641fcfe 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1040,8 +1040,9 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
-			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64" \n",
-			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",
+			       port->rx_bad_ip_csum, port->rx_bad_l4_csum,
+			       port->rx_bad_outer_l4_csum);
 		if ((stats->ierrors + stats->rx_nombuf) > 0) {
 			printf("  RX-error: %-"PRIu64"\n",  stats->ierrors);
 			printf("  RX-nombufs: %-14"PRIu64"\n", stats->rx_nombuf);
@@ -1059,8 +1060,9 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
-			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"\n",
-			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"    Bad-outer-l4csum: %-14"PRIu64"\n",
+			       port->rx_bad_ip_csum, port->rx_bad_l4_csum,
+			       port->rx_bad_outer_l4_csum);
 		if ((stats->ierrors + stats->rx_nombuf) > 0) {
 			printf("  RX-error:%"PRIu64"\n", stats->ierrors);
 			printf("  RX-nombufs:             %14"PRIu64"\n",
@@ -1124,7 +1126,9 @@ fwd_stream_stats_display(streamid_t stream_id)
 	/* if checksum mode */
 	if (cur_fwd_eng == &csum_fwd_engine) {
 	       printf("  RX- bad IP checksum: %-14u  Rx- bad L4 checksum: "
-			"%-14u\n", fs->rx_bad_ip_csum, fs->rx_bad_l4_csum);
+			"%-14u Rx- bad outer L4 checksum: %-14u\n",
+			fs->rx_bad_ip_csum, fs->rx_bad_l4_csum,
+			fs->rx_bad_outer_l4_csum);
 	}
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
@@ -1378,6 +1382,7 @@ start_packet_forwarding(int with_tx_first)
 		fwd_streams[sm_id]->fwd_dropped = 0;
 		fwd_streams[sm_id]->rx_bad_ip_csum = 0;
 		fwd_streams[sm_id]->rx_bad_l4_csum = 0;
+		fwd_streams[sm_id]->rx_bad_outer_l4_csum = 0;
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 		memset(&fwd_streams[sm_id]->rx_burst_stats, 0,
@@ -1483,6 +1488,9 @@ stop_packet_forwarding(void)
 		ports[fwd_streams[sm_id]->rx_port].rx_bad_l4_csum =
 							rx_bad_l4_csum;
 
+		ports[fwd_streams[sm_id]->rx_port].rx_bad_outer_l4_csum +=
+				fwd_streams[sm_id]->rx_bad_outer_l4_csum;
+
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 		fwd_cycles = (uint64_t) (fwd_cycles +
 					 fwd_streams[sm_id]->core_cycles);
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index a1f661472..106aeefc2 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -112,6 +112,8 @@ struct fwd_stream {
 	unsigned int fwd_dropped; /**< received packets not forwarded */
 	unsigned int rx_bad_ip_csum ; /**< received packets has bad ip checksum */
 	unsigned int rx_bad_l4_csum ; /**< received packets has bad l4 checksum */
+	unsigned int rx_bad_outer_l4_csum;
+	/**< received packets has bad outer l4 checksum */
 	unsigned int gro_times;	/**< GRO operation times */
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 	uint64_t     core_cycles; /**< used for RX and TX processing */
@@ -165,6 +167,8 @@ struct rte_port {
 	void                    *fwd_ctx;   /**< Forwarding mode context */
 	uint64_t                rx_bad_ip_csum; /**< rx pkts with bad ip checksum  */
 	uint64_t                rx_bad_l4_csum; /**< rx pkts with bad l4 checksum */
+	uint64_t                rx_bad_outer_l4_csum;
+	/**< rx pkts with bad outer l4 checksum */
 	uint8_t                 tx_queue_stats_mapping_enabled;
 	uint8_t                 rx_queue_stats_mapping_enabled;
 	volatile uint16_t        port_status;    /**< port started or not */
-- 
2.19.0

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v4 2/4] ethdev: add Tx offload outer UDP checksum definition
  2018-10-08 16:09     ` [dpdk-dev] [PATCH v4 2/4] ethdev: add Tx " Jerin Jacob
@ 2018-10-09 10:06       ` Andrew Rybchenko
  0 siblings, 0 replies; 87+ messages in thread
From: Andrew Rybchenko @ 2018-10-09 10:06 UTC (permalink / raw)
  To: Jerin Jacob, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	John McNamara, Marko Kovacevic, Thomas Monjalon, Ferruh Yigit,
	Olivier Matz
  Cc: dev

On 10/8/18 7:09 PM, Jerin Jacob wrote:
> Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and
> PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer UDP
> checksum offload.
>
> To use hardware Tx outer UDP checksum offload, the user needs to,
>
> - enable following in mbuf:
> a) fill outer_l2_len and outer_l3_len in mbuf
> b) set the PKT_TX_OUTER_UDP_CKSUM flag
> c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6
>
> - configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path
>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

One question below

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
> index a453ec008..61e6fca4d 100644
> --- a/lib/librte_mbuf/rte_mbuf.h
> +++ b/lib/librte_mbuf/rte_mbuf.h
> @@ -200,6 +200,9 @@ extern "C" {
>   
>   /* add new TX flags here */
>   
> +/**< Outer UDP cksum of TX pkt. computed by NIC. */

Description for the block which includes PKT_TX_UDP_CKSUM has "the user 
need to"...
IMHO, it would be very useful to have similar description here as well.

> +#define PKT_TX_OUTER_UDP_CKSUM     (1ULL << 41)
> +
>   /**
>    * UDP Fragmentation Offload flag. This flag is used for enabling UDP
>    * fragmentation in SW or in HW. When use UFO, mbuf->tso_segsz is used
> @@ -367,7 +370,8 @@ extern "C" {
>   		PKT_TX_TUNNEL_MASK |	 \
>   		PKT_TX_MACSEC |		 \
>   		PKT_TX_SEC_OFFLOAD |	\
> -		PKT_TX_UDP_SEG)
> +		PKT_TX_UDP_SEG |	\
> +		PKT_TX_OUTER_UDP_CKSUM)
>   
>   /**
>    * Mbuf having an external buffer attached. shinfo in mbuf must be filled.

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-08 16:09   ` [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
                       ` (2 preceding siblings ...)
  2018-10-08 16:09     ` [dpdk-dev] [PATCH v4 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
@ 2018-10-09 10:06     ` Andrew Rybchenko
  2018-10-09 14:18     ` [dpdk-dev] [PATCH v5 " Jerin Jacob
  4 siblings, 0 replies; 87+ messages in thread
From: Andrew Rybchenko @ 2018-10-09 10:06 UTC (permalink / raw)
  To: Jerin Jacob, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	John McNamara, Marko Kovacevic, Thomas Monjalon, Ferruh Yigit,
	Olivier Matz
  Cc: dev

On 10/8/18 7:09 PM, Jerin Jacob wrote:
> Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> PKT_RX_OUTER_L4_CKSUM_* mbuf ol_flags to detect outer UDP checksum
> status.
>
> - To use hardware Rx outer UDP checksum offload, the user needs to
> configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
>
> - Driver updates checksum status in mbuf ol_flag as
> PKT_RX_OUTER_L4_CKSUM_* flags.
>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v5 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-08 16:09   ` [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
                       ` (3 preceding siblings ...)
  2018-10-09 10:06     ` [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition Andrew Rybchenko
@ 2018-10-09 14:18     ` Jerin Jacob
  2018-10-09 14:18       ` [dpdk-dev] [PATCH v5 2/4] ethdev: add Tx " Jerin Jacob
                         ` (3 more replies)
  4 siblings, 4 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-09 14:18 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz
  Cc: dev, Jacob,  Jerin

Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
PKT_RX_OUTER_L4_CKSUM_* mbuf ol_flags to detect outer UDP checksum
status.

- To use hardware Rx outer UDP checksum offload, the user needs to
configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.

- Driver updates checksum status in mbuf ol_flag as
PKT_RX_OUTER_L4_CKSUM_* flags.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
This patch series is depended on http://patches.dpdk.org/patch/45840/

v5:
- Added Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

v4:

- Replaced PKT_RX_EL4_CKSUM_BAD with PKT_RX_OUTER_L4_CKSUM_* flags

v3:
- Mention in git commit log that PKT_RX_EL4_CKSUM_BAD based one bit scheme
selected based on exiting outer L3 PKT_RX_EIP_CKSUM_BAD one bit flag scheme.

- Removed extra empty line in features.rst (Andrew Rybchenko)

v2:
- Removed DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM
as there is no realworld use case for it.
See: http://patches.dpdk.org/patch/44692/

---
 app/test-pmd/config.c          |  9 +++++++++
 doc/guides/nics/features.rst   |  5 +++++
 lib/librte_ethdev/rte_ethdev.c |  1 +
 lib/librte_ethdev/rte_ethdev.h |  1 +
 lib/librte_mbuf/rte_mbuf.c     | 12 ++++++++++++
 lib/librte_mbuf/rte_mbuf.h     | 19 +++++++++++++++++++
 6 files changed, 47 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1adc9b94b..d53c527e5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -594,6 +594,15 @@ port_offload_cap_display(portid_t port_id)
 			printf("off\n");
 	}
 
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_UDP_CKSUM) {
+		printf("RX Outer UDP checksum:               ");
+		if (ports[port_id].dev_conf.rxmode.offloads &
+		    DEV_RX_OFFLOAD_OUTER_UDP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
 	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {
 		printf("Large receive offload:         ");
 		if (ports[port_id].dev_conf.rxmode.offloads &
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index d42489b6d..998f67c8e 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -639,6 +639,11 @@ Inner L4 checksum
 
 Supports inner packet L4 checksum.
 
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``.
+* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_OUTER_L4_CKSUM_UNKNOWN`` |
+  ``PKT_RX_OUTER_L4_CKSUM_BAD`` | ``PKT_RX_OUTER_L4_CKSUM_GOOD`` | ``PKT_RX_OUTER_L4_CKSUM_INVALID``.
+* **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``,
+
 
 .. _nic_features_packet_type_parsing:
 
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index e9a82fe7f..a630c4fda 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -127,6 +127,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d02db14ad..821d371c3 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -889,6 +889,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SECURITY         0x00008000
 #define DEV_RX_OFFLOAD_KEEP_CRC		0x00010000
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
+#define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index e714c5a59..c1740ce0c 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -301,6 +301,11 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask)
 	case PKT_RX_TIMESTAMP: return "PKT_RX_TIMESTAMP";
 	case PKT_RX_SEC_OFFLOAD: return "PKT_RX_SEC_OFFLOAD";
 	case PKT_RX_SEC_OFFLOAD_FAILED: return "PKT_RX_SEC_OFFLOAD_FAILED";
+	case PKT_RX_OUTER_L4_CKSUM_BAD: return "PKT_RX_OUTER_L4_CKSUM_BAD";
+	case PKT_RX_OUTER_L4_CKSUM_GOOD: return "PKT_RX_OUTER_L4_CKSUM_GOOD";
+	case PKT_RX_OUTER_L4_CKSUM_INVALID:
+		return "PKT_RX_OUTER_L4_CKSUM_INVALID";
+
 	default: return NULL;
 	}
 }
@@ -339,6 +344,13 @@ rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		{ PKT_RX_SEC_OFFLOAD, PKT_RX_SEC_OFFLOAD, NULL },
 		{ PKT_RX_SEC_OFFLOAD_FAILED, PKT_RX_SEC_OFFLOAD_FAILED, NULL },
 		{ PKT_RX_QINQ, PKT_RX_QINQ, NULL },
+		{ PKT_RX_OUTER_L4_CKSUM_BAD, PKT_RX_OUTER_L4_CKSUM_MASK, NULL },
+		{ PKT_RX_OUTER_L4_CKSUM_GOOD, PKT_RX_OUTER_L4_CKSUM_MASK,
+		  NULL },
+		{ PKT_RX_OUTER_L4_CKSUM_INVALID, PKT_RX_OUTER_L4_CKSUM_MASK,
+		  NULL },
+		{ PKT_RX_OUTER_L4_CKSUM_UNKNOWN, PKT_RX_OUTER_L4_CKSUM_MASK,
+		  "PKT_RX_OUTER_L4_CKSUM_UNKNOWN" },
 	};
 	const char *name;
 	unsigned int i;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index eb11779e7..a453ec008 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -177,6 +177,25 @@ extern "C" {
  */
 #define PKT_RX_QINQ          (1ULL << 20)
 
+/**
+ * Mask of bits used to determine the status of outer RX L4 checksum.
+ * - PKT_RX_OUTER_L4_CKSUM_UNKNOWN: no info about the outer RX L4 checksum
+ * - PKT_RX_OUTER_L4_CKSUM_BAD: the outer L4 checksum in the packet is wrong
+ * - PKT_RX_OUTER_L4_CKSUM_GOOD: the outer L4 checksum in the packet is valid
+ * - PKT_RX_OUTER_L4_CKSUM_INVALID: invalid outer L4 checksum state.
+ *
+ * The detection of PKT_RX_OUTER_L4_CKSUM_GOOD shall be based on the given
+ * HW capability, At minimum, the PMD should support
+ * PKT_RX_OUTER_L4_CKSUM_UNKNOWN and PKT_RX_OUTER_L4_CKSUM_BAD states
+ * if the DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload is available.
+ */
+#define PKT_RX_OUTER_L4_CKSUM_MASK	((1ULL << 21) | (1ULL << 22))
+
+#define PKT_RX_OUTER_L4_CKSUM_UNKNOWN	0
+#define PKT_RX_OUTER_L4_CKSUM_BAD	(1ULL << 21)
+#define PKT_RX_OUTER_L4_CKSUM_GOOD	(1ULL << 22)
+#define PKT_RX_OUTER_L4_CKSUM_INVALID	((1ULL << 21) | (1ULL << 22))
+
 /* add new RX flags here */
 
 /* add new TX flags here */
-- 
2.19.1

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v5 2/4] ethdev: add Tx offload outer UDP checksum definition
  2018-10-09 14:18     ` [dpdk-dev] [PATCH v5 " Jerin Jacob
@ 2018-10-09 14:18       ` Jerin Jacob
  2018-10-09 14:18       ` [dpdk-dev] [PATCH v5 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-09 14:18 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Olivier Matz
  Cc: dev, Jacob,  Jerin

Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and
PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer UDP
checksum offload.

To use hardware Tx outer UDP checksum offload, the user needs to,

- enable following in mbuf:
a) fill outer_l2_len and outer_l3_len in mbuf
b) set the PKT_TX_OUTER_UDP_CKSUM flag
c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6

- configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---

v4:
- Added Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
- Added more description for PKT_TX_OUTER_UDP_CKSUM flag(Andrew Rybchenko)

v3:

- Git comment corrections (Andrew Rybchenko)
s/PKT_TX_OUTER_TCP_CKSUM/PKT_TX_OUTER_UDP_CKSUM/g
s/mbuff/mbuf/g

v2:
- Removed DEV_TX_OFFLOAD_OUTER_TCP_CKSUM and DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM
as there is no realworld use case for it.
See: http://patches.dpdk.org/patch/44692/

This patch series is depended on http://patches.dpdk.org/patch/45840/
---
 app/test-pmd/config.c          | 10 ++++++++++
 doc/guides/nics/features.rst   |  5 +++++
 lib/librte_ethdev/rte_ethdev.c |  1 +
 lib/librte_ethdev/rte_ethdev.h |  2 ++
 lib/librte_mbuf/rte_mbuf.c     |  1 +
 lib/librte_mbuf/rte_mbuf.h     | 14 +++++++++++++-
 6 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index d53c527e5..5d9745ae5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -773,6 +773,16 @@ port_offload_cap_display(portid_t port_id)
 		else
 			printf("off\n");
 	}
+
+	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
+		printf("TX Outer UDP checksum:               ");
+		if (ports[port_id].dev_conf.txmode.offloads &
+		    DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
+			printf("on\n");
+		else
+			printf("off\n");
+	}
+
 }
 
 int
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 998f67c8e..bc5fff2c1 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -642,7 +642,12 @@ Supports inner packet L4 checksum.
 * **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_OUTER_L4_CKSUM_UNKNOWN`` |
   ``PKT_RX_OUTER_L4_CKSUM_BAD`` | ``PKT_RX_OUTER_L4_CKSUM_GOOD`` | ``PKT_RX_OUTER_L4_CKSUM_INVALID``.
+* **[uses]     rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM``.
+* **[uses]     mbuf**: ``mbuf.ol_flags:PKT_TX_OUTER_IPV4`` | ``PKT_TX_OUTER_IPV6``.
+  ``mbuf.ol_flags:PKT_TX_OUTER_UDP_CKSUM``.
+* **[uses]     mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``.
 * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``,
+  ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM``.
 
 
 .. _nic_features_packet_type_parsing:
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index a630c4fda..bb48b5a0f 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -159,6 +159,7 @@ static const struct {
 	RTE_TX_OFFLOAD_BIT2STR(SECURITY),
 	RTE_TX_OFFLOAD_BIT2STR(UDP_TNL_TSO),
 	RTE_TX_OFFLOAD_BIT2STR(IP_TNL_TSO),
+	RTE_TX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
 };
 
 #undef RTE_TX_OFFLOAD_BIT2STR
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 821d371c3..79d0bb1ed 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -944,6 +944,8 @@ struct rte_eth_conf {
  * for tunnel TSO.
  */
 #define DEV_TX_OFFLOAD_IP_TNL_TSO       0x00080000
+/** Device supports outer UDP checksum */
+#define DEV_TX_OFFLOAD_OUTER_UDP_CKSUM  0x00100000
 
 #define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001
 /**< Device supports Rx queue setup after device started*/
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index c1740ce0c..c59c5bb0d 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -447,6 +447,7 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		  "PKT_TX_TUNNEL_NONE" },
 		{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
 		{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
+		{ PKT_TX_OUTER_UDP_CKSUM, PKT_TX_OUTER_UDP_CKSUM, NULL },
 	};
 	const char *name;
 	unsigned int i;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index a453ec008..ba5d02f3e 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -200,6 +200,17 @@ extern "C" {
 
 /* add new TX flags here */
 
+/**
+ * Outer UDP checksum offload flag. This flag is used for enabling
+ * outer UDP checksum in PMD. To use outer UDP checksum, the user needs to
+ * 1) Enable the following in mbuff,
+ * a) Fill outer_l2_len and outer_l3_len in mbuf.
+ * b) Set the PKT_TX_OUTER_UDP_CKSUM flag.
+ * c) Set the PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6 flag.
+ * 2) Configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flag.
+ */
+#define PKT_TX_OUTER_UDP_CKSUM     (1ULL << 41)
+
 /**
  * UDP Fragmentation Offload flag. This flag is used for enabling UDP
  * fragmentation in SW or in HW. When use UFO, mbuf->tso_segsz is used
@@ -367,7 +378,8 @@ extern "C" {
 		PKT_TX_TUNNEL_MASK |	 \
 		PKT_TX_MACSEC |		 \
 		PKT_TX_SEC_OFFLOAD |	\
-		PKT_TX_UDP_SEG)
+		PKT_TX_UDP_SEG |	\
+		PKT_TX_OUTER_UDP_CKSUM)
 
 /**
  * Mbuf having an external buffer attached. shinfo in mbuf must be filled.
-- 
2.19.1

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v5 3/4] app/testpmd: add outer UDP HW checksum support
  2018-10-09 14:18     ` [dpdk-dev] [PATCH v5 " Jerin Jacob
  2018-10-09 14:18       ` [dpdk-dev] [PATCH v5 2/4] ethdev: add Tx " Jerin Jacob
@ 2018-10-09 14:18       ` Jerin Jacob
  2018-10-09 14:18       ` [dpdk-dev] [PATCH v5 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
  2018-10-09 16:46       ` [dpdk-dev] [PATCH v5 1/4] ethdev: add Rx offload outer UDP checksum definition Ferruh Yigit
  3 siblings, 0 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-09 14:18 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, John McNamara,
	Marko Kovacevic
  Cc: dev, thomas, ferruh.yigit, arybchenko, olivier.matz, Jacob,  Jerin

Added outer-udp Tx HW checksum support for csum forward engine
if device supports DEV_TX_OFFLOAD_OUTER_UDP_CKSUM.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 24 ++++++++++++++++++---
 app/test-pmd/csumonly.c                     | 13 +++++++++--
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  8 +++++--
 3 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0c5399dc4..2fd007423 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -397,12 +397,13 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"    Disable hardware insertion of a VLAN header in"
 			" packets sent on a port.\n\n"
 
-			"csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)\n"
+			"csum set (ip|udp|tcp|sctp|outer-ip|outer-udp) (hw|sw) (port_id)\n"
 			"    Select hardware or software calculation of the"
 			" checksum when transmitting a packet using the"
 			" csum forward engine.\n"
 			"    ip|udp|tcp|sctp always concern the inner layer.\n"
 			"    outer-ip concerns the outer IP layer in"
+			"    outer-udp concerns the outer UDP layer in"
 			" case the packet is recognized as a tunnel packet by"
 			" the forward engine (vxlan, gre and ipip are supported)\n"
 			"    Please check the NIC datasheet for HW limits.\n\n"
@@ -4177,6 +4178,8 @@ csum_show(int port_id)
 		(tx_offloads & DEV_TX_OFFLOAD_SCTP_CKSUM) ? "hw" : "sw");
 	printf("Outer-Ip checksum offload is %s\n",
 		(tx_offloads & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ? "hw" : "sw");
+	printf("Outer-Udp checksum offload is %s\n",
+		(tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ? "hw" : "sw");
 
 	/* display warnings if configuration is not supported by the NIC */
 	rte_eth_dev_info_get(port_id, &dev_info);
@@ -4205,6 +4208,12 @@ csum_show(int port_id)
 		printf("Warning: hardware outer IP checksum enabled but not "
 			"supported by port %d\n", port_id);
 	}
+	if ((tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) &&
+		(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)
+			== 0) {
+		printf("Warning: hardware outer UDP checksum enabled but not "
+			"supported by port %d\n", port_id);
+	}
 }
 
 static void
@@ -4273,6 +4282,15 @@ cmd_csum_parsed(void *parsed_result,
 				printf("Outer IP checksum offload is not "
 				       "supported by port %u\n", res->port_id);
 			}
+		} else if (!strcmp(res->proto, "outer-udp")) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+					DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)) {
+				csum_offloads |=
+						DEV_TX_OFFLOAD_OUTER_UDP_CKSUM;
+			} else {
+				printf("Outer UDP checksum offload is not "
+				       "supported by port %u\n", res->port_id);
+			}
 		}
 
 		if (hw) {
@@ -4296,7 +4314,7 @@ cmdline_parse_token_string_t cmd_csum_mode =
 				mode, "set");
 cmdline_parse_token_string_t cmd_csum_proto =
 	TOKEN_STRING_INITIALIZER(struct cmd_csum_result,
-				proto, "ip#tcp#udp#sctp#outer-ip");
+				proto, "ip#tcp#udp#sctp#outer-ip#outer-udp");
 cmdline_parse_token_string_t cmd_csum_hwsw =
 	TOKEN_STRING_INITIALIZER(struct cmd_csum_result,
 				hwsw, "hw#sw");
@@ -4307,7 +4325,7 @@ cmdline_parse_token_num_t cmd_csum_portid =
 cmdline_parse_inst_t cmd_csum_set = {
 	.f = cmd_csum_parsed,
 	.data = NULL,
-	.help_str = "csum set ip|tcp|udp|sctp|outer-ip hw|sw <port_id>: "
+	.help_str = "csum set ip|tcp|udp|sctp|outer-ip|outer-udp hw|sw <port_id>: "
 		"Enable/Disable hardware calculation of L3/L4 checksum when "
 		"using csum forward engine",
 	.tokens = {
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 494829266..ea5b112d6 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -468,10 +468,15 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
 	if (info->outer_l4_proto != IPPROTO_UDP)
 		return ol_flags;
 
+	/* Skip SW outer UDP checksum generation if HW supports it */
+	if (tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {
+		ol_flags |= PKT_TX_OUTER_UDP_CKSUM;
+		return ol_flags;
+	}
+
 	udp_hdr = (struct udp_hdr *)((char *)outer_l3_hdr + info->outer_l3_len);
 
-	/* outer UDP checksum is done in software as we have no hardware
-	 * supporting it today, and no API for it. In the other side, for
+	/* outer UDP checksum is done in software. In the other side, for
 	 * UDP tunneling, like VXLAN or Geneve, outer UDP checksum can be
 	 * set to zero.
 	 *
@@ -826,6 +831,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			if (info.tunnel_tso_segsz ||
 			    (tx_offloads &
 			     DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
+			    (tx_offloads &
+			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
 			    (tx_ol_flags & PKT_TX_OUTER_IPV6)) {
 				m->outer_l2_len = info.outer_l2_len;
 				m->outer_l3_len = info.outer_l3_len;
@@ -898,6 +905,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			if (info.is_tunnel == 1) {
 				if ((tx_offloads &
 				    DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
+				    (tx_offloads &
+				    DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
 				    (tx_ol_flags & PKT_TX_OUTER_IPV6))
 					printf("tx: m->outer_l2_len=%d "
 						"m->outer_l3_len=%d\n",
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 3a73000a6..cfcabf6f0 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -857,7 +857,7 @@ csum set
 Select hardware or software calculation of the checksum when
 transmitting a packet using the ``csum`` forwarding engine::
 
-   testpmd> csum set (ip|udp|tcp|sctp|outer-ip) (hw|sw) (port_id)
+   testpmd> csum set (ip|udp|tcp|sctp|outer-ip|outer-udp) (hw|sw) (port_id)
 
 Where:
 
@@ -867,6 +867,10 @@ Where:
   as a tunnel packet by the forwarding engine (vxlan, gre and ipip are
   supported). See also the ``csum parse-tunnel`` command.
 
+* ``outer-udp`` relates to the outer UDP layer in the case where the packet is recognized
+  as a tunnel packet by the forwarding engine (vxlan, vxlan-gpe are
+  supported). See also the ``csum parse-tunnel`` command.
+
 .. note::
 
    Check the NIC Datasheet for hardware limits.
@@ -940,7 +944,7 @@ Consider a packet in packet like the following::
 
 * If parse-tunnel is enabled, the ``ip|udp|tcp|sctp`` parameters of ``csum set``
   command relate to the inner headers (here ``ipv4_in`` and ``tcp_in``), and the
-  ``outer-ip parameter`` relates to the outer headers (here ``ipv4_out``).
+  ``outer-ip|outer-udp`` parameter relates to the outer headers (here ``ipv4_out`` and ``udp_out``).
 
 * If parse-tunnel is disabled, the ``ip|udp|tcp|sctp`` parameters of ``csum  set``
    command relate to the outer headers, here ``ipv4_out`` and ``udp_out``.
-- 
2.19.1

^ permalink raw reply	[flat|nested] 87+ messages in thread

* [dpdk-dev] [PATCH v5 4/4] app/testpmd: collect bad outer L4 checksum for csum engine
  2018-10-09 14:18     ` [dpdk-dev] [PATCH v5 " Jerin Jacob
  2018-10-09 14:18       ` [dpdk-dev] [PATCH v5 2/4] ethdev: add Tx " Jerin Jacob
  2018-10-09 14:18       ` [dpdk-dev] [PATCH v5 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
@ 2018-10-09 14:18       ` Jerin Jacob
  2018-10-09 16:46       ` [dpdk-dev] [PATCH v5 1/4] ethdev: add Rx offload outer UDP checksum definition Ferruh Yigit
  3 siblings, 0 replies; 87+ messages in thread
From: Jerin Jacob @ 2018-10-09 14:18 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger
  Cc: dev, thomas, ferruh.yigit, arybchenko, olivier.matz, Jacob,  Jerin

Collect and prints the statistics for PKT_RX_EL4_CKSUM_BAD
errors.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/csumonly.c |  5 +++++
 app/test-pmd/testpmd.c  | 18 +++++++++++++-----
 app/test-pmd/testpmd.h  |  4 ++++
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index ea5b112d6..dce4b9be7 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -701,6 +701,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	uint32_t retry;
 	uint32_t rx_bad_ip_csum;
 	uint32_t rx_bad_l4_csum;
+	uint32_t rx_bad_outer_l4_csum;
 	struct testpmd_offload_info info;
 	uint16_t nb_segments = 0;
 	int ret;
@@ -726,6 +727,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	fs->rx_packets += nb_rx;
 	rx_bad_ip_csum = 0;
 	rx_bad_l4_csum = 0;
+	rx_bad_outer_l4_csum = 0;
 	gro_enable = gro_ports[fs->rx_port].enable;
 
 	txp = &ports[fs->tx_port];
@@ -753,6 +755,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			rx_bad_ip_csum += 1;
 		if ((rx_ol_flags & PKT_RX_L4_CKSUM_MASK) == PKT_RX_L4_CKSUM_BAD)
 			rx_bad_l4_csum += 1;
+		if (rx_ol_flags & PKT_RX_OUTER_L4_CKSUM_BAD)
+			rx_bad_outer_l4_csum += 1;
 
 		/* step 1: dissect packet, parsing optional vlan, ip4/ip6, vxlan
 		 * and inner headers */
@@ -991,6 +995,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	fs->tx_packets += nb_tx;
 	fs->rx_bad_ip_csum += rx_bad_ip_csum;
 	fs->rx_bad_l4_csum += rx_bad_l4_csum;
+	fs->rx_bad_outer_l4_csum += rx_bad_outer_l4_csum;
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 	fs->tx_burst_stats.pkt_burst_spread[nb_tx]++;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 001f0e552..2a641fcfe 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1040,8 +1040,9 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
-			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64" \n",
-			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+			printf("  Bad-ipcsum: %-14"PRIu64" Bad-l4csum: %-14"PRIu64"Bad-outer-l4csum: %-14"PRIu64"\n",
+			       port->rx_bad_ip_csum, port->rx_bad_l4_csum,
+			       port->rx_bad_outer_l4_csum);
 		if ((stats->ierrors + stats->rx_nombuf) > 0) {
 			printf("  RX-error: %-"PRIu64"\n",  stats->ierrors);
 			printf("  RX-nombufs: %-14"PRIu64"\n", stats->rx_nombuf);
@@ -1059,8 +1060,9 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)
 		       (uint64_t) (stats->ipackets + stats->imissed));
 
 		if (cur_fwd_eng == &csum_fwd_engine)
-			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"\n",
-			       port->rx_bad_ip_csum, port->rx_bad_l4_csum);
+			printf("  Bad-ipcsum:%14"PRIu64"    Bad-l4csum:%14"PRIu64"    Bad-outer-l4csum: %-14"PRIu64"\n",
+			       port->rx_bad_ip_csum, port->rx_bad_l4_csum,
+			       port->rx_bad_outer_l4_csum);
 		if ((stats->ierrors + stats->rx_nombuf) > 0) {
 			printf("  RX-error:%"PRIu64"\n", stats->ierrors);
 			printf("  RX-nombufs:             %14"PRIu64"\n",
@@ -1124,7 +1126,9 @@ fwd_stream_stats_display(streamid_t stream_id)
 	/* if checksum mode */
 	if (cur_fwd_eng == &csum_fwd_engine) {
 	       printf("  RX- bad IP checksum: %-14u  Rx- bad L4 checksum: "
-			"%-14u\n", fs->rx_bad_ip_csum, fs->rx_bad_l4_csum);
+			"%-14u Rx- bad outer L4 checksum: %-14u\n",
+			fs->rx_bad_ip_csum, fs->rx_bad_l4_csum,
+			fs->rx_bad_outer_l4_csum);
 	}
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
@@ -1378,6 +1382,7 @@ start_packet_forwarding(int with_tx_first)
 		fwd_streams[sm_id]->fwd_dropped = 0;
 		fwd_streams[sm_id]->rx_bad_ip_csum = 0;
 		fwd_streams[sm_id]->rx_bad_l4_csum = 0;
+		fwd_streams[sm_id]->rx_bad_outer_l4_csum = 0;
 
 #ifdef RTE_TEST_PMD_RECORD_BURST_STATS
 		memset(&fwd_streams[sm_id]->rx_burst_stats, 0,
@@ -1483,6 +1488,9 @@ stop_packet_forwarding(void)
 		ports[fwd_streams[sm_id]->rx_port].rx_bad_l4_csum =
 							rx_bad_l4_csum;
 
+		ports[fwd_streams[sm_id]->rx_port].rx_bad_outer_l4_csum +=
+				fwd_streams[sm_id]->rx_bad_outer_l4_csum;
+
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 		fwd_cycles = (uint64_t) (fwd_cycles +
 					 fwd_streams[sm_id]->core_cycles);
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index a1f661472..106aeefc2 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -112,6 +112,8 @@ struct fwd_stream {
 	unsigned int fwd_dropped; /**< received packets not forwarded */
 	unsigned int rx_bad_ip_csum ; /**< received packets has bad ip checksum */
 	unsigned int rx_bad_l4_csum ; /**< received packets has bad l4 checksum */
+	unsigned int rx_bad_outer_l4_csum;
+	/**< received packets has bad outer l4 checksum */
 	unsigned int gro_times;	/**< GRO operation times */
 #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
 	uint64_t     core_cycles; /**< used for RX and TX processing */
@@ -165,6 +167,8 @@ struct rte_port {
 	void                    *fwd_ctx;   /**< Forwarding mode context */
 	uint64_t                rx_bad_ip_csum; /**< rx pkts with bad ip checksum  */
 	uint64_t                rx_bad_l4_csum; /**< rx pkts with bad l4 checksum */
+	uint64_t                rx_bad_outer_l4_csum;
+	/**< rx pkts with bad outer l4 checksum */
 	uint8_t                 tx_queue_stats_mapping_enabled;
 	uint8_t                 rx_queue_stats_mapping_enabled;
 	volatile uint16_t        port_status;    /**< port started or not */
-- 
2.19.1

^ permalink raw reply	[flat|nested] 87+ messages in thread

* Re: [dpdk-dev] [PATCH v5 1/4] ethdev: add Rx offload outer UDP checksum definition
  2018-10-09 14:18     ` [dpdk-dev] [PATCH v5 " Jerin Jacob
                         ` (2 preceding siblings ...)
  2018-10-09 14:18       ` [dpdk-dev] [PATCH v5 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
@ 2018-10-09 16:46       ` Ferruh Yigit
  3 siblings, 0 replies; 87+ messages in thread
From: Ferruh Yigit @ 2018-10-09 16:46 UTC (permalink / raw)
  To: Jerin Jacob, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	John McNamara, Marko Kovacevic, Thomas Monjalon,
	Andrew Rybchenko, Olivier Matz
  Cc: dev, Jacob, Jerin

On 10/9/2018 3:18 PM, Jerin Jacob wrote:
> Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and
> PKT_RX_OUTER_L4_CKSUM_* mbuf ol_flags to detect outer UDP checksum
> status.
> 
> - To use hardware Rx outer UDP checksum offload, the user needs to
> configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath.
> 
> - Driver updates checksum status in mbuf ol_flag as
> PKT_RX_OUTER_L4_CKSUM_* flags.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Series applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 87+ messages in thread

end of thread, other threads:[~2018-10-09 16:46 UTC | newest]

Thread overview: 87+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-13 13:47 [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support Jerin Jacob
2018-09-13 13:47 ` [dpdk-dev] [PATCH 2/4] mbuf: fix Tx offload mask Jerin Jacob
2018-10-01 13:45   ` Ferruh Yigit
2018-10-01 15:53     ` Jerin Jacob
2018-10-01 16:13       ` Ferruh Yigit
2018-09-13 13:47 ` [dpdk-dev] [PATCH 3/4] ethdev: add Rx offload outer L4 checksum definitions Jerin Jacob
2018-09-13 17:24   ` Shahaf Shuler
2018-09-14  3:05     ` Jerin Jacob
2018-09-16  5:53       ` Shahaf Shuler
2018-09-16  9:32         ` Jerin Jacob
2018-09-13 13:47 ` [dpdk-dev] [PATCH 4/4] ethdev: add Tx " Jerin Jacob
2018-10-01 13:45   ` Ferruh Yigit
2018-10-02  9:52     ` Jerin Jacob
2018-10-01 13:45 ` [dpdk-dev] [PATCH 1/4] ethdev: add SCTP Rx checksum offload support Ferruh Yigit
2018-10-01 13:46 ` Ferruh Yigit
2018-10-01 15:59   ` Jerin Jacob
2018-10-01 16:11     ` Ferruh Yigit
2018-10-02  8:53       ` Jerin Jacob
2018-10-02  9:13     ` Ferruh Yigit
2018-10-02 10:51 ` [dpdk-dev] [PATCH v2 1/2] " Jerin Jacob
2018-10-02 10:51   ` [dpdk-dev] [PATCH v2 2/2] mbuf: fix Tx offload mask Jerin Jacob
2018-10-04  2:31     ` Hu, Jiayu
2018-10-04 16:05       ` Ferruh Yigit
2018-10-03 18:52   ` [dpdk-dev] [PATCH v2 1/2] ethdev: add SCTP Rx checksum offload support Ferruh Yigit
2018-10-02 19:24 ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx " Jerin Jacob
2018-10-03  7:41     ` Andrew Rybchenko
2018-10-03  7:58       ` Jerin Jacob
2018-10-03  8:02         ` Ferruh Yigit
2018-10-03  8:36           ` Thomas Monjalon
2018-10-03 10:52     ` Iremonger, Bernard
2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
2018-10-03 13:23     ` Iremonger, Bernard
2018-10-02 19:24   ` [dpdk-dev] [PATCH v2 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
2018-10-03  8:29     ` Andrew Rybchenko
2018-10-03  7:34   ` [dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition Andrew Rybchenko
2018-10-03  7:57     ` Jerin Jacob
2018-10-03  8:35       ` Thomas Monjalon
2018-10-03  8:36         ` Andrew Rybchenko
2018-10-03 17:12       ` Jerin Jacob
2018-10-03 18:00         ` Andrew Rybchenko
2018-10-03 18:14           ` Jerin Jacob
2018-10-03 19:47             ` Andrew Rybchenko
2018-10-03 20:08               ` Thomas Monjalon
2018-10-04  5:59               ` Jerin Jacob
2018-10-05 19:48                 ` Ferruh Yigit
2018-10-05 20:04                 ` Ferruh Yigit
2018-10-05 22:44                   ` Thomas Monjalon
2018-10-06  8:15                     ` Jerin Jacob
2018-10-06 12:18                       ` Ananyev, Konstantin
2018-10-08  8:12                         ` Ferruh Yigit
2018-10-08  8:24                           ` Jerin Jacob
2018-10-08  9:04                             ` Thomas Monjalon
2018-10-08  9:37                               ` Jerin Jacob
2018-10-08 10:53                                 ` Ferruh Yigit
2018-10-08 11:55                                   ` Jerin Jacob
2018-10-08 12:13                                     ` Ferruh Yigit
2018-10-08 12:25                                       ` Jerin Jacob
2018-10-08 13:03                                         ` Thomas Monjalon
2018-10-08 13:08                                           ` Jerin Jacob
2018-10-03  8:53   ` Ananyev, Konstantin
2018-10-03  8:59     ` Jerin Jacob
2018-10-03  9:17       ` Ananyev, Konstantin
2018-10-03  9:22         ` Jerin Jacob
2018-10-03 10:16           ` Ananyev, Konstantin
2018-10-03 11:15             ` Jerin Jacob
2018-10-03 10:51   ` Iremonger, Bernard
2018-10-03 11:19     ` Jerin Jacob
2018-10-03 13:00       ` Iremonger, Bernard
2018-10-03 18:16 ` [dpdk-dev] [PATCH v3 " Jerin Jacob
2018-10-03 18:16   ` [dpdk-dev] [PATCH v3 2/4] ethdev: add Tx " Jerin Jacob
2018-10-03 18:16   ` [dpdk-dev] [PATCH v3 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
2018-10-03 18:16   ` [dpdk-dev] [PATCH v3 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
2018-10-04 13:45     ` Iremonger, Bernard
2018-10-04 14:16       ` Jerin Jacob
2018-10-04 15:06         ` Iremonger, Bernard
2018-10-08 16:09   ` [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition Jerin Jacob
2018-10-08 16:09     ` [dpdk-dev] [PATCH v4 2/4] ethdev: add Tx " Jerin Jacob
2018-10-09 10:06       ` Andrew Rybchenko
2018-10-08 16:09     ` [dpdk-dev] [PATCH v4 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
2018-10-08 16:09     ` [dpdk-dev] [PATCH v4 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
2018-10-09 10:06     ` [dpdk-dev] [PATCH v4 1/4] ethdev: add Rx offload outer UDP checksum definition Andrew Rybchenko
2018-10-09 14:18     ` [dpdk-dev] [PATCH v5 " Jerin Jacob
2018-10-09 14:18       ` [dpdk-dev] [PATCH v5 2/4] ethdev: add Tx " Jerin Jacob
2018-10-09 14:18       ` [dpdk-dev] [PATCH v5 3/4] app/testpmd: add outer UDP HW checksum support Jerin Jacob
2018-10-09 14:18       ` [dpdk-dev] [PATCH v5 4/4] app/testpmd: collect bad outer L4 checksum for csum engine Jerin Jacob
2018-10-09 16:46       ` [dpdk-dev] [PATCH v5 1/4] ethdev: add Rx offload outer UDP checksum definition Ferruh Yigit

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).