DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] net/mvneta: minor updates
@ 2019-06-11 13:06 lironh
  2019-06-11 13:06 ` [dpdk-dev] [PATCH 1/3] net/mvneta: fix: ierror counted twice lironh
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: lironh @ 2019-06-11 13:06 UTC (permalink / raw)
  To: zr; +Cc: tdu, dev, Liron Himi

From: Liron Himi <lironh@marvell.com>

Two patches handle statistics issues, the 3rd patch use ol_flags
for the checksum generation

Liron Himi (2):
  net/mvneta: fix: ierror counted twice
  net/mvneta: only use ol_flags for checksum generation offload

Yuri Chipchev (1):
  net/mvneta: reset stats during device start

 drivers/net/mvneta/mvneta_ethdev.c | 18 +++--------
 drivers/net/mvneta/mvneta_ethdev.h | 14 +++++++++
 drivers/net/mvneta/mvneta_rxtx.c   | 62 ++++++++++++++------------------------
 3 files changed, 41 insertions(+), 53 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH 1/3] net/mvneta: fix: ierror counted twice
  2019-06-11 13:06 [dpdk-dev] [PATCH 0/3] net/mvneta: minor updates lironh
@ 2019-06-11 13:06 ` lironh
  2019-06-11 13:06 ` [dpdk-dev] [PATCH 2/3] net/mvneta: reset stats during device start lironh
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: lironh @ 2019-06-11 13:06 UTC (permalink / raw)
  To: zr; +Cc: tdu, dev, Liron Himi

From: Liron Himi <lironh@marvell.com>

Change-Id: Ieaac221e774e4caf1f9105e6761540df04313d4f
Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
Tested-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvneta/mvneta_ethdev.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index 9657444..d6e64a8 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -707,10 +707,7 @@ mvneta_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	stats->imissed += ppio_stats.rx_discard +
 			  ppio_stats.rx_overrun -
 			  priv->prev_stats.imissed;
-
-	stats->ierrors = ppio_stats.rx_packets_err +
-			ppio_stats.rx_errors +
-			ppio_stats.rx_crc_error -
+	stats->ierrors = ppio_stats.rx_packets_err -
 			priv->prev_stats.ierrors;
 	stats->oerrors = ppio_stats.tx_errors - priv->prev_stats.oerrors;
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH 2/3] net/mvneta: reset stats during device start
  2019-06-11 13:06 [dpdk-dev] [PATCH 0/3] net/mvneta: minor updates lironh
  2019-06-11 13:06 ` [dpdk-dev] [PATCH 1/3] net/mvneta: fix: ierror counted twice lironh
@ 2019-06-11 13:06 ` lironh
  2019-06-11 13:06 ` [dpdk-dev] [PATCH 3/3] net/mvneta: only use ol_flags for checksum generation offload lironh
  2019-06-13 13:58 ` [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates lironh
  3 siblings, 0 replies; 14+ messages in thread
From: lironh @ 2019-06-11 13:06 UTC (permalink / raw)
  To: zr; +Cc: tdu, dev, Yuri Chipchev

From: Yuri Chipchev <yuric@marvell.com>

Change-Id: I5e46a1c930759d059816fa851697df95f7333b51
Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Tested-by: Yuri Chipchev <yuric@marvell.com>
---
 drivers/net/mvneta/mvneta_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index d6e64a8..f324d93 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -57,6 +57,8 @@ struct mvneta_ifnames {
 
 static int mvneta_dev_num;
 
+static void mvneta_stats_reset(struct rte_eth_dev *dev);
+
 /**
  * Deinitialize packet processor.
  */
@@ -359,6 +361,8 @@ mvneta_dev_start(struct rte_eth_dev *dev)
 	}
 	priv->ppio_id = priv->ppio->port_id;
 
+	mvneta_stats_reset(dev);
+
 	/*
 	 * In case there are some some stale uc/mc mac addresses flush them
 	 * here. It cannot be done during mvneta_dev_close() as port information
-- 
2.7.4


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

* [dpdk-dev] [PATCH 3/3] net/mvneta: only use ol_flags for checksum generation offload
  2019-06-11 13:06 [dpdk-dev] [PATCH 0/3] net/mvneta: minor updates lironh
  2019-06-11 13:06 ` [dpdk-dev] [PATCH 1/3] net/mvneta: fix: ierror counted twice lironh
  2019-06-11 13:06 ` [dpdk-dev] [PATCH 2/3] net/mvneta: reset stats during device start lironh
@ 2019-06-11 13:06 ` lironh
  2019-06-13 13:58 ` [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates lironh
  3 siblings, 0 replies; 14+ messages in thread
From: lironh @ 2019-06-11 13:06 UTC (permalink / raw)
  To: zr; +Cc: tdu, dev, Liron Himi

From: Liron Himi <lironh@marvell.com>

Change-Id: I3b9c6360c885043d74c1a7a11d38268b61dae8d5
Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
Tested-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvneta/mvneta_ethdev.c |  9 ------
 drivers/net/mvneta/mvneta_ethdev.h | 14 +++++++++
 drivers/net/mvneta/mvneta_rxtx.c   | 62 ++++++++++++++------------------------
 3 files changed, 36 insertions(+), 49 deletions(-)

diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index f324d93..d46a13b 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -27,15 +27,6 @@
 
 #define MVNETA_IFACE_NAME_ARG "iface"
 
-#define MVNETA_RX_OFFLOADS (DEV_RX_OFFLOAD_JUMBO_FRAME | \
-			  DEV_RX_OFFLOAD_CHECKSUM)
-
-/** Port Tx offloads capabilities */
-#define MVNETA_TX_OFFLOADS (DEV_TX_OFFLOAD_IPV4_CKSUM | \
-			  DEV_TX_OFFLOAD_UDP_CKSUM | \
-			  DEV_TX_OFFLOAD_TCP_CKSUM | \
-			  DEV_TX_OFFLOAD_MULTI_SEGS)
-
 #define MVNETA_PKT_SIZE_MAX (16382 - MV_MH_SIZE) /* 9700B */
 #define MVNETA_DEFAULT_MTU 1500
 
diff --git a/drivers/net/mvneta/mvneta_ethdev.h b/drivers/net/mvneta/mvneta_ethdev.h
index d892d6c..ef80677 100644
--- a/drivers/net/mvneta/mvneta_ethdev.h
+++ b/drivers/net/mvneta/mvneta_ethdev.h
@@ -53,6 +53,20 @@
 #define MRVL_NETA_MTU_TO_MRU(mtu)	((mtu) + MRVL_NETA_HDRS_LEN)
 #define MRVL_NETA_MRU_TO_MTU(mru)	((mru) - MRVL_NETA_HDRS_LEN)
 
+/** Rx offloads capabilities */
+#define MVNETA_RX_OFFLOADS (DEV_RX_OFFLOAD_JUMBO_FRAME | \
+			    DEV_RX_OFFLOAD_CHECKSUM)
+
+/** Tx offloads capabilities */
+#define MVNETA_TX_OFFLOAD_CHECKSUM (DEV_TX_OFFLOAD_IPV4_CKSUM | \
+				    DEV_TX_OFFLOAD_UDP_CKSUM  | \
+				    DEV_TX_OFFLOAD_TCP_CKSUM)
+#define MVNETA_TX_OFFLOADS (MVNETA_TX_OFFLOAD_CHECKSUM | \
+			    DEV_TX_OFFLOAD_MULTI_SEGS)
+
+#define MVNETA_TX_PKT_OFFLOADS (PKT_TX_IP_CKSUM | \
+				PKT_TX_TCP_CKSUM | \
+				PKT_TX_UDP_CKSUM)
 
 struct mvneta_priv {
 	/* Hot fields, used in fast path. */
diff --git a/drivers/net/mvneta/mvneta_rxtx.c b/drivers/net/mvneta/mvneta_rxtx.c
index 62caa68..10b6f57 100644
--- a/drivers/net/mvneta/mvneta_rxtx.c
+++ b/drivers/net/mvneta/mvneta_rxtx.c
@@ -280,8 +280,6 @@ mvneta_desc_to_packet_type_and_offset(struct neta_ppio_desc *desc,
  *
  * @param ol_flags
  *   Offload flags.
- * @param packet_type
- *   Packet type bitfield.
  * @param l3_type
  *   Pointer to the neta_ouq_l3_type structure.
  * @param l4_type
@@ -290,41 +288,34 @@ mvneta_desc_to_packet_type_and_offset(struct neta_ppio_desc *desc,
  *   Will be set to 1 in case l3 checksum is computed.
  * @param l4_cksum
  *   Will be set to 1 in case l4 checksum is computed.
- *
- * @return
- *   0 on success, negative error value otherwise.
  */
-static inline int
-mvneta_prepare_proto_info(uint64_t ol_flags, uint32_t packet_type,
-			enum neta_outq_l3_type *l3_type,
-			enum neta_outq_l4_type *l4_type,
-			int *gen_l3_cksum,
-			int *gen_l4_cksum)
+static inline void
+mvneta_prepare_proto_info(uint64_t ol_flags,
+			  enum neta_outq_l3_type *l3_type,
+			  enum neta_outq_l4_type *l4_type,
+			  int *gen_l3_cksum,
+			  int *gen_l4_cksum)
 {
 	/*
 	 * Based on ol_flags prepare information
 	 * for neta_ppio_outq_desc_set_proto_info() which setups descriptor
 	 * for offloading.
+	 * in most of the checksum cases ipv4 must be set, so this is the
+	 * default value
 	 */
-	if (ol_flags & PKT_TX_IPV4) {
-		*l3_type = NETA_OUTQ_L3_TYPE_IPV4;
-		*gen_l3_cksum = ol_flags & PKT_TX_IP_CKSUM ? 1 : 0;
-	} else if (ol_flags & PKT_TX_IPV6) {
+	*l3_type = NETA_OUTQ_L3_TYPE_IPV4;
+	*gen_l3_cksum = ol_flags & PKT_TX_IP_CKSUM ? 1 : 0;
+
+	if (ol_flags & PKT_TX_IPV6) {
 		*l3_type = NETA_OUTQ_L3_TYPE_IPV6;
 		/* no checksum for ipv6 header */
 		*gen_l3_cksum = 0;
-	} else {
-		/* if something different then stop processing */
-		return -1;
 	}
 
-	ol_flags &= PKT_TX_L4_MASK;
-	if ((packet_type & RTE_PTYPE_L4_TCP) &&
-	    ol_flags == PKT_TX_TCP_CKSUM) {
+	if (ol_flags & PKT_TX_TCP_CKSUM) {
 		*l4_type = NETA_OUTQ_L4_TYPE_TCP;
 		*gen_l4_cksum = 1;
-	} else if ((packet_type & RTE_PTYPE_L4_UDP) &&
-		   ol_flags == PKT_TX_UDP_CKSUM) {
+	} else if (ol_flags & PKT_TX_UDP_CKSUM) {
 		*l4_type = NETA_OUTQ_L4_TYPE_UDP;
 		*gen_l4_cksum = 1;
 	} else {
@@ -332,8 +323,6 @@ mvneta_prepare_proto_info(uint64_t ol_flags, uint32_t packet_type,
 		/* no checksum for other type */
 		*gen_l4_cksum = 0;
 	}
-
-	return 0;
 }
 
 /**
@@ -385,8 +374,7 @@ mvneta_tx_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	struct mvneta_txq *q = txq;
 	struct mvneta_shadow_txq *sq;
 	struct neta_ppio_desc descs[nb_pkts];
-
-	int i, ret, bytes_sent = 0;
+	int i, bytes_sent = 0;
 	uint16_t num, sq_free_size;
 	uint64_t addr;
 
@@ -419,13 +407,10 @@ mvneta_tx_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		bytes_sent += rte_pktmbuf_pkt_len(mbuf);
 
-		ret = mvneta_prepare_proto_info(mbuf->ol_flags,
-						mbuf->packet_type,
-						&l3_type, &l4_type,
-						&gen_l3_cksum,
-						&gen_l4_cksum);
-		if (unlikely(ret))
+		if (!(mbuf->ol_flags & MVNETA_TX_PKT_OFFLOADS))
 			continue;
+		mvneta_prepare_proto_info(mbuf->ol_flags, &l3_type, &l4_type,
+					  &gen_l3_cksum, &gen_l4_cksum);
 
 		neta_ppio_outq_desc_set_proto_info(&descs[i], l3_type, l4_type,
 						   mbuf->l2_len,
@@ -473,7 +458,7 @@ mvneta_tx_sg_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	struct neta_ppio_desc descs[nb_pkts * NETA_PPIO_DESC_NUM_FRAGS];
 	struct neta_ppio_sg_pkts pkts;
 	uint8_t frags[nb_pkts];
-	int i, j, ret, bytes_sent = 0;
+	int i, j, bytes_sent = 0;
 	int tail, tail_first;
 	uint16_t num, sq_free_size;
 	uint16_t nb_segs, total_descs = 0;
@@ -549,13 +534,10 @@ mvneta_tx_sg_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		bytes_sent += rte_pktmbuf_pkt_len(mbuf);
 
-		ret = mvneta_prepare_proto_info(mbuf->ol_flags,
-						mbuf->packet_type,
-						&l3_type, &l4_type,
-						&gen_l3_cksum,
-						&gen_l4_cksum);
-		if (unlikely(ret))
+		if (!(mbuf->ol_flags & MVNETA_TX_PKT_OFFLOADS))
 			continue;
+		mvneta_prepare_proto_info(mbuf->ol_flags, &l3_type, &l4_type,
+					  &gen_l3_cksum, &gen_l4_cksum);
 
 		neta_ppio_outq_desc_set_proto_info(&descs[tail_first],
 						   l3_type, l4_type,
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates
  2019-06-11 13:06 [dpdk-dev] [PATCH 0/3] net/mvneta: minor updates lironh
                   ` (2 preceding siblings ...)
  2019-06-11 13:06 ` [dpdk-dev] [PATCH 3/3] net/mvneta: only use ol_flags for checksum generation offload lironh
@ 2019-06-13 13:58 ` lironh
  2019-06-13 13:58   ` [dpdk-dev] [PATCH v2 1/3] net/mvneta: fix: ierror counted twice lironh
                     ` (4 more replies)
  3 siblings, 5 replies; 14+ messages in thread
From: lironh @ 2019-06-13 13:58 UTC (permalink / raw)
  To: dev; +Cc: Liron Himi

From: Liron Himi <lironh@marvell.com>

Two patches handle statistics issues, the 3rd patch use ol_flags
for the checksum generation

v2:
- removed Change-Id

Liron Himi (2):
  net/mvneta: fix: ierror counted twice
  net/mvneta: only use ol_flags for checksum generation offload

Yuri Chipchev (1):
  net/mvneta: reset stats during device start

 drivers/net/mvneta/mvneta_ethdev.c | 18 +++--------
 drivers/net/mvneta/mvneta_ethdev.h | 14 +++++++++
 drivers/net/mvneta/mvneta_rxtx.c   | 62 ++++++++++++++------------------------
 3 files changed, 41 insertions(+), 53 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 1/3] net/mvneta: fix: ierror counted twice
  2019-06-13 13:58 ` [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates lironh
@ 2019-06-13 13:58   ` lironh
  2019-06-13 13:58   ` [dpdk-dev] [PATCH v2 2/3] net/mvneta: reset stats during device start lironh
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: lironh @ 2019-06-13 13:58 UTC (permalink / raw)
  To: dev; +Cc: Liron Himi

From: Liron Himi <lironh@marvell.com>

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
Tested-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvneta/mvneta_ethdev.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index 9657444..d6e64a8 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -707,10 +707,7 @@ mvneta_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	stats->imissed += ppio_stats.rx_discard +
 			  ppio_stats.rx_overrun -
 			  priv->prev_stats.imissed;
-
-	stats->ierrors = ppio_stats.rx_packets_err +
-			ppio_stats.rx_errors +
-			ppio_stats.rx_crc_error -
+	stats->ierrors = ppio_stats.rx_packets_err -
 			priv->prev_stats.ierrors;
 	stats->oerrors = ppio_stats.tx_errors - priv->prev_stats.oerrors;
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 2/3] net/mvneta: reset stats during device start
  2019-06-13 13:58 ` [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates lironh
  2019-06-13 13:58   ` [dpdk-dev] [PATCH v2 1/3] net/mvneta: fix: ierror counted twice lironh
@ 2019-06-13 13:58   ` lironh
  2019-06-13 13:58   ` [dpdk-dev] [PATCH v2 3/3] net/mvneta: only use ol_flags for checksum generation offload lironh
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: lironh @ 2019-06-13 13:58 UTC (permalink / raw)
  To: dev; +Cc: Yuri Chipchev

From: Yuri Chipchev <yuric@marvell.com>

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Tested-by: Yuri Chipchev <yuric@marvell.com>
---
 drivers/net/mvneta/mvneta_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index d6e64a8..f324d93 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -57,6 +57,8 @@ struct mvneta_ifnames {
 
 static int mvneta_dev_num;
 
+static void mvneta_stats_reset(struct rte_eth_dev *dev);
+
 /**
  * Deinitialize packet processor.
  */
@@ -359,6 +361,8 @@ mvneta_dev_start(struct rte_eth_dev *dev)
 	}
 	priv->ppio_id = priv->ppio->port_id;
 
+	mvneta_stats_reset(dev);
+
 	/*
 	 * In case there are some some stale uc/mc mac addresses flush them
 	 * here. It cannot be done during mvneta_dev_close() as port information
-- 
2.7.4


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

* [dpdk-dev] [PATCH v2 3/3] net/mvneta: only use ol_flags for checksum generation offload
  2019-06-13 13:58 ` [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates lironh
  2019-06-13 13:58   ` [dpdk-dev] [PATCH v2 1/3] net/mvneta: fix: ierror counted twice lironh
  2019-06-13 13:58   ` [dpdk-dev] [PATCH v2 2/3] net/mvneta: reset stats during device start lironh
@ 2019-06-13 13:58   ` lironh
  2019-06-25  8:22   ` [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates Jerin Jacob Kollanukkaran
  2019-07-01  8:00   ` [dpdk-dev] [PATCH v3 " lironh
  4 siblings, 0 replies; 14+ messages in thread
From: lironh @ 2019-06-13 13:58 UTC (permalink / raw)
  To: dev; +Cc: Liron Himi

From: Liron Himi <lironh@marvell.com>

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
Tested-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvneta/mvneta_ethdev.c |  9 ------
 drivers/net/mvneta/mvneta_ethdev.h | 14 +++++++++
 drivers/net/mvneta/mvneta_rxtx.c   | 62 ++++++++++++++------------------------
 3 files changed, 36 insertions(+), 49 deletions(-)

diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index f324d93..d46a13b 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -27,15 +27,6 @@
 
 #define MVNETA_IFACE_NAME_ARG "iface"
 
-#define MVNETA_RX_OFFLOADS (DEV_RX_OFFLOAD_JUMBO_FRAME | \
-			  DEV_RX_OFFLOAD_CHECKSUM)
-
-/** Port Tx offloads capabilities */
-#define MVNETA_TX_OFFLOADS (DEV_TX_OFFLOAD_IPV4_CKSUM | \
-			  DEV_TX_OFFLOAD_UDP_CKSUM | \
-			  DEV_TX_OFFLOAD_TCP_CKSUM | \
-			  DEV_TX_OFFLOAD_MULTI_SEGS)
-
 #define MVNETA_PKT_SIZE_MAX (16382 - MV_MH_SIZE) /* 9700B */
 #define MVNETA_DEFAULT_MTU 1500
 
diff --git a/drivers/net/mvneta/mvneta_ethdev.h b/drivers/net/mvneta/mvneta_ethdev.h
index d892d6c..ef80677 100644
--- a/drivers/net/mvneta/mvneta_ethdev.h
+++ b/drivers/net/mvneta/mvneta_ethdev.h
@@ -53,6 +53,20 @@
 #define MRVL_NETA_MTU_TO_MRU(mtu)	((mtu) + MRVL_NETA_HDRS_LEN)
 #define MRVL_NETA_MRU_TO_MTU(mru)	((mru) - MRVL_NETA_HDRS_LEN)
 
+/** Rx offloads capabilities */
+#define MVNETA_RX_OFFLOADS (DEV_RX_OFFLOAD_JUMBO_FRAME | \
+			    DEV_RX_OFFLOAD_CHECKSUM)
+
+/** Tx offloads capabilities */
+#define MVNETA_TX_OFFLOAD_CHECKSUM (DEV_TX_OFFLOAD_IPV4_CKSUM | \
+				    DEV_TX_OFFLOAD_UDP_CKSUM  | \
+				    DEV_TX_OFFLOAD_TCP_CKSUM)
+#define MVNETA_TX_OFFLOADS (MVNETA_TX_OFFLOAD_CHECKSUM | \
+			    DEV_TX_OFFLOAD_MULTI_SEGS)
+
+#define MVNETA_TX_PKT_OFFLOADS (PKT_TX_IP_CKSUM | \
+				PKT_TX_TCP_CKSUM | \
+				PKT_TX_UDP_CKSUM)
 
 struct mvneta_priv {
 	/* Hot fields, used in fast path. */
diff --git a/drivers/net/mvneta/mvneta_rxtx.c b/drivers/net/mvneta/mvneta_rxtx.c
index 62caa68..10b6f57 100644
--- a/drivers/net/mvneta/mvneta_rxtx.c
+++ b/drivers/net/mvneta/mvneta_rxtx.c
@@ -280,8 +280,6 @@ mvneta_desc_to_packet_type_and_offset(struct neta_ppio_desc *desc,
  *
  * @param ol_flags
  *   Offload flags.
- * @param packet_type
- *   Packet type bitfield.
  * @param l3_type
  *   Pointer to the neta_ouq_l3_type structure.
  * @param l4_type
@@ -290,41 +288,34 @@ mvneta_desc_to_packet_type_and_offset(struct neta_ppio_desc *desc,
  *   Will be set to 1 in case l3 checksum is computed.
  * @param l4_cksum
  *   Will be set to 1 in case l4 checksum is computed.
- *
- * @return
- *   0 on success, negative error value otherwise.
  */
-static inline int
-mvneta_prepare_proto_info(uint64_t ol_flags, uint32_t packet_type,
-			enum neta_outq_l3_type *l3_type,
-			enum neta_outq_l4_type *l4_type,
-			int *gen_l3_cksum,
-			int *gen_l4_cksum)
+static inline void
+mvneta_prepare_proto_info(uint64_t ol_flags,
+			  enum neta_outq_l3_type *l3_type,
+			  enum neta_outq_l4_type *l4_type,
+			  int *gen_l3_cksum,
+			  int *gen_l4_cksum)
 {
 	/*
 	 * Based on ol_flags prepare information
 	 * for neta_ppio_outq_desc_set_proto_info() which setups descriptor
 	 * for offloading.
+	 * in most of the checksum cases ipv4 must be set, so this is the
+	 * default value
 	 */
-	if (ol_flags & PKT_TX_IPV4) {
-		*l3_type = NETA_OUTQ_L3_TYPE_IPV4;
-		*gen_l3_cksum = ol_flags & PKT_TX_IP_CKSUM ? 1 : 0;
-	} else if (ol_flags & PKT_TX_IPV6) {
+	*l3_type = NETA_OUTQ_L3_TYPE_IPV4;
+	*gen_l3_cksum = ol_flags & PKT_TX_IP_CKSUM ? 1 : 0;
+
+	if (ol_flags & PKT_TX_IPV6) {
 		*l3_type = NETA_OUTQ_L3_TYPE_IPV6;
 		/* no checksum for ipv6 header */
 		*gen_l3_cksum = 0;
-	} else {
-		/* if something different then stop processing */
-		return -1;
 	}
 
-	ol_flags &= PKT_TX_L4_MASK;
-	if ((packet_type & RTE_PTYPE_L4_TCP) &&
-	    ol_flags == PKT_TX_TCP_CKSUM) {
+	if (ol_flags & PKT_TX_TCP_CKSUM) {
 		*l4_type = NETA_OUTQ_L4_TYPE_TCP;
 		*gen_l4_cksum = 1;
-	} else if ((packet_type & RTE_PTYPE_L4_UDP) &&
-		   ol_flags == PKT_TX_UDP_CKSUM) {
+	} else if (ol_flags & PKT_TX_UDP_CKSUM) {
 		*l4_type = NETA_OUTQ_L4_TYPE_UDP;
 		*gen_l4_cksum = 1;
 	} else {
@@ -332,8 +323,6 @@ mvneta_prepare_proto_info(uint64_t ol_flags, uint32_t packet_type,
 		/* no checksum for other type */
 		*gen_l4_cksum = 0;
 	}
-
-	return 0;
 }
 
 /**
@@ -385,8 +374,7 @@ mvneta_tx_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	struct mvneta_txq *q = txq;
 	struct mvneta_shadow_txq *sq;
 	struct neta_ppio_desc descs[nb_pkts];
-
-	int i, ret, bytes_sent = 0;
+	int i, bytes_sent = 0;
 	uint16_t num, sq_free_size;
 	uint64_t addr;
 
@@ -419,13 +407,10 @@ mvneta_tx_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		bytes_sent += rte_pktmbuf_pkt_len(mbuf);
 
-		ret = mvneta_prepare_proto_info(mbuf->ol_flags,
-						mbuf->packet_type,
-						&l3_type, &l4_type,
-						&gen_l3_cksum,
-						&gen_l4_cksum);
-		if (unlikely(ret))
+		if (!(mbuf->ol_flags & MVNETA_TX_PKT_OFFLOADS))
 			continue;
+		mvneta_prepare_proto_info(mbuf->ol_flags, &l3_type, &l4_type,
+					  &gen_l3_cksum, &gen_l4_cksum);
 
 		neta_ppio_outq_desc_set_proto_info(&descs[i], l3_type, l4_type,
 						   mbuf->l2_len,
@@ -473,7 +458,7 @@ mvneta_tx_sg_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	struct neta_ppio_desc descs[nb_pkts * NETA_PPIO_DESC_NUM_FRAGS];
 	struct neta_ppio_sg_pkts pkts;
 	uint8_t frags[nb_pkts];
-	int i, j, ret, bytes_sent = 0;
+	int i, j, bytes_sent = 0;
 	int tail, tail_first;
 	uint16_t num, sq_free_size;
 	uint16_t nb_segs, total_descs = 0;
@@ -549,13 +534,10 @@ mvneta_tx_sg_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		bytes_sent += rte_pktmbuf_pkt_len(mbuf);
 
-		ret = mvneta_prepare_proto_info(mbuf->ol_flags,
-						mbuf->packet_type,
-						&l3_type, &l4_type,
-						&gen_l3_cksum,
-						&gen_l4_cksum);
-		if (unlikely(ret))
+		if (!(mbuf->ol_flags & MVNETA_TX_PKT_OFFLOADS))
 			continue;
+		mvneta_prepare_proto_info(mbuf->ol_flags, &l3_type, &l4_type,
+					  &gen_l3_cksum, &gen_l4_cksum);
 
 		neta_ppio_outq_desc_set_proto_info(&descs[tail_first],
 						   l3_type, l4_type,
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates
  2019-06-13 13:58 ` [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates lironh
                     ` (2 preceding siblings ...)
  2019-06-13 13:58   ` [dpdk-dev] [PATCH v2 3/3] net/mvneta: only use ol_flags for checksum generation offload lironh
@ 2019-06-25  8:22   ` Jerin Jacob Kollanukkaran
  2019-07-01  8:00   ` [dpdk-dev] [PATCH v3 " lironh
  4 siblings, 0 replies; 14+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-06-25  8:22 UTC (permalink / raw)
  To: Liron Himi, dev; +Cc: Liron Himi

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of lironh@marvell.com
> Sent: Thursday, June 13, 2019 7:28 PM
> To: dev@dpdk.org
> Cc: Liron Himi <lironh@marvell.com>
> Subject: [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates
> 
> From: Liron Himi <lironh@marvell.com>
> 
> Two patches handle statistics issues, the 3rd patch use ol_flags for the checksum
> generation
> 
> v2:
> - removed Change-Id
> 
> Liron Himi (2):
>   net/mvneta: fix: ierror counted twice
>   net/mvneta: only use ol_flags for checksum generation offload
> 
> Yuri Chipchev (1):
>   net/mvneta: reset stats during device start


This series, all the patches has empty git commit comments and there are missing Fixes lines.
Please make sure to run the following scripts before submitting to upstream.

./devtools/checkpatches.sh && ./devtools/check-git-log.sh


> 
>  drivers/net/mvneta/mvneta_ethdev.c | 18 +++--------
> drivers/net/mvneta/mvneta_ethdev.h | 14 +++++++++
>  drivers/net/mvneta/mvneta_rxtx.c   | 62 ++++++++++++++------------------------
>  3 files changed, 41 insertions(+), 53 deletions(-)
> 
> --
> 2.7.4


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

* [dpdk-dev] [PATCH v3 0/3] net/mvneta: minor updates
  2019-06-13 13:58 ` [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates lironh
                     ` (3 preceding siblings ...)
  2019-06-25  8:22   ` [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates Jerin Jacob Kollanukkaran
@ 2019-07-01  8:00   ` lironh
  2019-07-01  8:00     ` [dpdk-dev] [PATCH v3 1/3] net/mvneta: fix: ierror counted twice lironh
                       ` (2 more replies)
  4 siblings, 3 replies; 14+ messages in thread
From: lironh @ 2019-07-01  8:00 UTC (permalink / raw)
  To: jerinj; +Cc: dev, Liron Himi

From: Liron Himi <lironh@marvell.com>

Two patches handle statistics issues, the 3rd patch use ol_flags
for the checksum generation

v3:
- add commit messages
- add fixes lines

v2:
- removed Change-Id

Liron Himi (2):
  net/mvneta: fix: ierror counted twice
  net/mvneta: only use ol_flags for checksum generation offload

Yuri Chipchev (1):
  net/mvneta: reset stats during device initialization

 drivers/net/mvneta/mvneta_ethdev.c | 18 +++--------
 drivers/net/mvneta/mvneta_ethdev.h | 14 +++++++++
 drivers/net/mvneta/mvneta_rxtx.c   | 62 ++++++++++++++------------------------
 3 files changed, 41 insertions(+), 53 deletions(-)

-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 1/3] net/mvneta: fix: ierror counted twice
  2019-07-01  8:00   ` [dpdk-dev] [PATCH v3 " lironh
@ 2019-07-01  8:00     ` lironh
  2019-07-01 17:45       ` Jerin Jacob Kollanukkaran
  2019-07-01  8:00     ` [dpdk-dev] [PATCH v3 2/3] net/mvneta: reset stats during device initialization lironh
  2019-07-01  8:00     ` [dpdk-dev] [PATCH v3 3/3] net/mvneta: only use ol_flags for checksum generation offload lironh
  2 siblings, 1 reply; 14+ messages in thread
From: lironh @ 2019-07-01  8:00 UTC (permalink / raw)
  To: jerinj; +Cc: dev, Liron Himi

From: Liron Himi <lironh@marvell.com>

error packets were counted twice due to use
of redundant counters

Fixes: e9d5faff ("net/mvneta: support basic stats")

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
Tested-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvneta/mvneta_ethdev.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index 9657444..d6e64a8 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -707,10 +707,7 @@ mvneta_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	stats->imissed += ppio_stats.rx_discard +
 			  ppio_stats.rx_overrun -
 			  priv->prev_stats.imissed;
-
-	stats->ierrors = ppio_stats.rx_packets_err +
-			ppio_stats.rx_errors +
-			ppio_stats.rx_crc_error -
+	stats->ierrors = ppio_stats.rx_packets_err -
 			priv->prev_stats.ierrors;
 	stats->oerrors = ppio_stats.tx_errors - priv->prev_stats.oerrors;
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 2/3] net/mvneta: reset stats during device initialization
  2019-07-01  8:00   ` [dpdk-dev] [PATCH v3 " lironh
  2019-07-01  8:00     ` [dpdk-dev] [PATCH v3 1/3] net/mvneta: fix: ierror counted twice lironh
@ 2019-07-01  8:00     ` lironh
  2019-07-01  8:00     ` [dpdk-dev] [PATCH v3 3/3] net/mvneta: only use ol_flags for checksum generation offload lironh
  2 siblings, 0 replies; 14+ messages in thread
From: lironh @ 2019-07-01  8:00 UTC (permalink / raw)
  To: jerinj; +Cc: dev, Yuri Chipchev

From: Yuri Chipchev <yuric@marvell.com>

reset device statistics on device initialization

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Tested-by: Yuri Chipchev <yuric@marvell.com>
---
 drivers/net/mvneta/mvneta_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index d6e64a8..f324d93 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -57,6 +57,8 @@ struct mvneta_ifnames {
 
 static int mvneta_dev_num;
 
+static void mvneta_stats_reset(struct rte_eth_dev *dev);
+
 /**
  * Deinitialize packet processor.
  */
@@ -359,6 +361,8 @@ mvneta_dev_start(struct rte_eth_dev *dev)
 	}
 	priv->ppio_id = priv->ppio->port_id;
 
+	mvneta_stats_reset(dev);
+
 	/*
 	 * In case there are some some stale uc/mc mac addresses flush them
 	 * here. It cannot be done during mvneta_dev_close() as port information
-- 
2.7.4


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

* [dpdk-dev] [PATCH v3 3/3] net/mvneta: only use ol_flags for checksum generation offload
  2019-07-01  8:00   ` [dpdk-dev] [PATCH v3 " lironh
  2019-07-01  8:00     ` [dpdk-dev] [PATCH v3 1/3] net/mvneta: fix: ierror counted twice lironh
  2019-07-01  8:00     ` [dpdk-dev] [PATCH v3 2/3] net/mvneta: reset stats during device initialization lironh
@ 2019-07-01  8:00     ` lironh
  2 siblings, 0 replies; 14+ messages in thread
From: lironh @ 2019-07-01  8:00 UTC (permalink / raw)
  To: jerinj; +Cc: dev, Liron Himi

From: Liron Himi <lironh@marvell.com>

for tx checksum offload it is not mandatory to provide
a valid packet_type in addition to a valid ol_flags.
this patch only use ol_flags information for this
feature

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Yuri Chipchev <yuric@marvell.com>
Tested-by: Liron Himi <lironh@marvell.com>
---
 drivers/net/mvneta/mvneta_ethdev.c |  9 ------
 drivers/net/mvneta/mvneta_ethdev.h | 14 +++++++++
 drivers/net/mvneta/mvneta_rxtx.c   | 62 ++++++++++++++------------------------
 3 files changed, 36 insertions(+), 49 deletions(-)

diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c
index f324d93..d46a13b 100644
--- a/drivers/net/mvneta/mvneta_ethdev.c
+++ b/drivers/net/mvneta/mvneta_ethdev.c
@@ -27,15 +27,6 @@
 
 #define MVNETA_IFACE_NAME_ARG "iface"
 
-#define MVNETA_RX_OFFLOADS (DEV_RX_OFFLOAD_JUMBO_FRAME | \
-			  DEV_RX_OFFLOAD_CHECKSUM)
-
-/** Port Tx offloads capabilities */
-#define MVNETA_TX_OFFLOADS (DEV_TX_OFFLOAD_IPV4_CKSUM | \
-			  DEV_TX_OFFLOAD_UDP_CKSUM | \
-			  DEV_TX_OFFLOAD_TCP_CKSUM | \
-			  DEV_TX_OFFLOAD_MULTI_SEGS)
-
 #define MVNETA_PKT_SIZE_MAX (16382 - MV_MH_SIZE) /* 9700B */
 #define MVNETA_DEFAULT_MTU 1500
 
diff --git a/drivers/net/mvneta/mvneta_ethdev.h b/drivers/net/mvneta/mvneta_ethdev.h
index d892d6c..ef80677 100644
--- a/drivers/net/mvneta/mvneta_ethdev.h
+++ b/drivers/net/mvneta/mvneta_ethdev.h
@@ -53,6 +53,20 @@
 #define MRVL_NETA_MTU_TO_MRU(mtu)	((mtu) + MRVL_NETA_HDRS_LEN)
 #define MRVL_NETA_MRU_TO_MTU(mru)	((mru) - MRVL_NETA_HDRS_LEN)
 
+/** Rx offloads capabilities */
+#define MVNETA_RX_OFFLOADS (DEV_RX_OFFLOAD_JUMBO_FRAME | \
+			    DEV_RX_OFFLOAD_CHECKSUM)
+
+/** Tx offloads capabilities */
+#define MVNETA_TX_OFFLOAD_CHECKSUM (DEV_TX_OFFLOAD_IPV4_CKSUM | \
+				    DEV_TX_OFFLOAD_UDP_CKSUM  | \
+				    DEV_TX_OFFLOAD_TCP_CKSUM)
+#define MVNETA_TX_OFFLOADS (MVNETA_TX_OFFLOAD_CHECKSUM | \
+			    DEV_TX_OFFLOAD_MULTI_SEGS)
+
+#define MVNETA_TX_PKT_OFFLOADS (PKT_TX_IP_CKSUM | \
+				PKT_TX_TCP_CKSUM | \
+				PKT_TX_UDP_CKSUM)
 
 struct mvneta_priv {
 	/* Hot fields, used in fast path. */
diff --git a/drivers/net/mvneta/mvneta_rxtx.c b/drivers/net/mvneta/mvneta_rxtx.c
index 62caa68..10b6f57 100644
--- a/drivers/net/mvneta/mvneta_rxtx.c
+++ b/drivers/net/mvneta/mvneta_rxtx.c
@@ -280,8 +280,6 @@ mvneta_desc_to_packet_type_and_offset(struct neta_ppio_desc *desc,
  *
  * @param ol_flags
  *   Offload flags.
- * @param packet_type
- *   Packet type bitfield.
  * @param l3_type
  *   Pointer to the neta_ouq_l3_type structure.
  * @param l4_type
@@ -290,41 +288,34 @@ mvneta_desc_to_packet_type_and_offset(struct neta_ppio_desc *desc,
  *   Will be set to 1 in case l3 checksum is computed.
  * @param l4_cksum
  *   Will be set to 1 in case l4 checksum is computed.
- *
- * @return
- *   0 on success, negative error value otherwise.
  */
-static inline int
-mvneta_prepare_proto_info(uint64_t ol_flags, uint32_t packet_type,
-			enum neta_outq_l3_type *l3_type,
-			enum neta_outq_l4_type *l4_type,
-			int *gen_l3_cksum,
-			int *gen_l4_cksum)
+static inline void
+mvneta_prepare_proto_info(uint64_t ol_flags,
+			  enum neta_outq_l3_type *l3_type,
+			  enum neta_outq_l4_type *l4_type,
+			  int *gen_l3_cksum,
+			  int *gen_l4_cksum)
 {
 	/*
 	 * Based on ol_flags prepare information
 	 * for neta_ppio_outq_desc_set_proto_info() which setups descriptor
 	 * for offloading.
+	 * in most of the checksum cases ipv4 must be set, so this is the
+	 * default value
 	 */
-	if (ol_flags & PKT_TX_IPV4) {
-		*l3_type = NETA_OUTQ_L3_TYPE_IPV4;
-		*gen_l3_cksum = ol_flags & PKT_TX_IP_CKSUM ? 1 : 0;
-	} else if (ol_flags & PKT_TX_IPV6) {
+	*l3_type = NETA_OUTQ_L3_TYPE_IPV4;
+	*gen_l3_cksum = ol_flags & PKT_TX_IP_CKSUM ? 1 : 0;
+
+	if (ol_flags & PKT_TX_IPV6) {
 		*l3_type = NETA_OUTQ_L3_TYPE_IPV6;
 		/* no checksum for ipv6 header */
 		*gen_l3_cksum = 0;
-	} else {
-		/* if something different then stop processing */
-		return -1;
 	}
 
-	ol_flags &= PKT_TX_L4_MASK;
-	if ((packet_type & RTE_PTYPE_L4_TCP) &&
-	    ol_flags == PKT_TX_TCP_CKSUM) {
+	if (ol_flags & PKT_TX_TCP_CKSUM) {
 		*l4_type = NETA_OUTQ_L4_TYPE_TCP;
 		*gen_l4_cksum = 1;
-	} else if ((packet_type & RTE_PTYPE_L4_UDP) &&
-		   ol_flags == PKT_TX_UDP_CKSUM) {
+	} else if (ol_flags & PKT_TX_UDP_CKSUM) {
 		*l4_type = NETA_OUTQ_L4_TYPE_UDP;
 		*gen_l4_cksum = 1;
 	} else {
@@ -332,8 +323,6 @@ mvneta_prepare_proto_info(uint64_t ol_flags, uint32_t packet_type,
 		/* no checksum for other type */
 		*gen_l4_cksum = 0;
 	}
-
-	return 0;
 }
 
 /**
@@ -385,8 +374,7 @@ mvneta_tx_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	struct mvneta_txq *q = txq;
 	struct mvneta_shadow_txq *sq;
 	struct neta_ppio_desc descs[nb_pkts];
-
-	int i, ret, bytes_sent = 0;
+	int i, bytes_sent = 0;
 	uint16_t num, sq_free_size;
 	uint64_t addr;
 
@@ -419,13 +407,10 @@ mvneta_tx_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		bytes_sent += rte_pktmbuf_pkt_len(mbuf);
 
-		ret = mvneta_prepare_proto_info(mbuf->ol_flags,
-						mbuf->packet_type,
-						&l3_type, &l4_type,
-						&gen_l3_cksum,
-						&gen_l4_cksum);
-		if (unlikely(ret))
+		if (!(mbuf->ol_flags & MVNETA_TX_PKT_OFFLOADS))
 			continue;
+		mvneta_prepare_proto_info(mbuf->ol_flags, &l3_type, &l4_type,
+					  &gen_l3_cksum, &gen_l4_cksum);
 
 		neta_ppio_outq_desc_set_proto_info(&descs[i], l3_type, l4_type,
 						   mbuf->l2_len,
@@ -473,7 +458,7 @@ mvneta_tx_sg_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	struct neta_ppio_desc descs[nb_pkts * NETA_PPIO_DESC_NUM_FRAGS];
 	struct neta_ppio_sg_pkts pkts;
 	uint8_t frags[nb_pkts];
-	int i, j, ret, bytes_sent = 0;
+	int i, j, bytes_sent = 0;
 	int tail, tail_first;
 	uint16_t num, sq_free_size;
 	uint16_t nb_segs, total_descs = 0;
@@ -549,13 +534,10 @@ mvneta_tx_sg_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 		bytes_sent += rte_pktmbuf_pkt_len(mbuf);
 
-		ret = mvneta_prepare_proto_info(mbuf->ol_flags,
-						mbuf->packet_type,
-						&l3_type, &l4_type,
-						&gen_l3_cksum,
-						&gen_l4_cksum);
-		if (unlikely(ret))
+		if (!(mbuf->ol_flags & MVNETA_TX_PKT_OFFLOADS))
 			continue;
+		mvneta_prepare_proto_info(mbuf->ol_flags, &l3_type, &l4_type,
+					  &gen_l3_cksum, &gen_l4_cksum);
 
 		neta_ppio_outq_desc_set_proto_info(&descs[tail_first],
 						   l3_type, l4_type,
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH v3 1/3] net/mvneta: fix: ierror counted twice
  2019-07-01  8:00     ` [dpdk-dev] [PATCH v3 1/3] net/mvneta: fix: ierror counted twice lironh
@ 2019-07-01 17:45       ` Jerin Jacob Kollanukkaran
  0 siblings, 0 replies; 14+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-07-01 17:45 UTC (permalink / raw)
  To: Liron Himi; +Cc: dev, Liron Himi


> -----Original Message-----
> From: lironh@marvell.com <lironh@marvell.com>
> Sent: Monday, July 1, 2019 1:30 PM
> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> Cc: dev@dpdk.org; Liron Himi <lironh@marvell.com>
> Subject: [PATCH v3 1/3] net/mvneta: fix: ierror counted twice

No need to have ":" after fix.
Added Cc: stable@dpdk.orf

Corrected  following check-gitlog.sh errors
        net/mvneta: only use ol_flags for checksum generation offload
Headline too long:
        net/mvneta: only use ol_flags for checksum generation offload

Series applied to dpdk-next-net-mrvl/master. Thanks.

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

end of thread, other threads:[~2019-07-01 17:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 13:06 [dpdk-dev] [PATCH 0/3] net/mvneta: minor updates lironh
2019-06-11 13:06 ` [dpdk-dev] [PATCH 1/3] net/mvneta: fix: ierror counted twice lironh
2019-06-11 13:06 ` [dpdk-dev] [PATCH 2/3] net/mvneta: reset stats during device start lironh
2019-06-11 13:06 ` [dpdk-dev] [PATCH 3/3] net/mvneta: only use ol_flags for checksum generation offload lironh
2019-06-13 13:58 ` [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates lironh
2019-06-13 13:58   ` [dpdk-dev] [PATCH v2 1/3] net/mvneta: fix: ierror counted twice lironh
2019-06-13 13:58   ` [dpdk-dev] [PATCH v2 2/3] net/mvneta: reset stats during device start lironh
2019-06-13 13:58   ` [dpdk-dev] [PATCH v2 3/3] net/mvneta: only use ol_flags for checksum generation offload lironh
2019-06-25  8:22   ` [dpdk-dev] [PATCH v2 0/3] net/mvneta: minor updates Jerin Jacob Kollanukkaran
2019-07-01  8:00   ` [dpdk-dev] [PATCH v3 " lironh
2019-07-01  8:00     ` [dpdk-dev] [PATCH v3 1/3] net/mvneta: fix: ierror counted twice lironh
2019-07-01 17:45       ` Jerin Jacob Kollanukkaran
2019-07-01  8:00     ` [dpdk-dev] [PATCH v3 2/3] net/mvneta: reset stats during device initialization lironh
2019-07-01  8:00     ` [dpdk-dev] [PATCH v3 3/3] net/mvneta: only use ol_flags for checksum generation offload lironh

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