patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/ena: fix false indication of bad L4 Rx csums
@ 2019-10-28 10:16 Michal Krawczyk
  2019-10-28 10:23 ` [dpdk-stable] [PATCH v2] " Michal Krawczyk
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Krawczyk @ 2019-10-28 10:16 UTC (permalink / raw)
  To: Marcin Wojtas, Michal Krawczyk, Guy Tzalik, Evgeny Schemeilin,
	Igor Chauskin
  Cc: dev, stable, Maciej Bielski

Add checking of l4_csum_checked and frag flags before checking the
l4_csum_error flag.

In case of IP fragment/unchecked L4 csum - add PKT_RX_L4_CKSUM_UNKNOWN
flag to the indicated mbuf.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")
Cc: stable@dpdk.org

Signed-off-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Maciej Bielski <mba@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
---
 drivers/net/ena/ena_ethdev.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index aa84fabc5..55b4982da 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -272,9 +272,14 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf,
 	else if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV6)
 		packet_type |= RTE_PTYPE_L3_IPV6;
 
-	if (unlikely(ena_rx_ctx->l4_csum_err))
-		ol_flags |= PKT_RX_L4_CKSUM_BAD;
+	if (!ena_rx_ctx->l4_csum_checked)
+		ol_flags |= PKT_RX_L4_CKSUM_UNKNOWN;
+	else
+		if (unlikely(ena_rx_ctx->l4_csum_err) && !ena_rx_ctx->frag)
+			ol_flags |= PKT_RX_L4_CKSUM_BAD;
+		else
+			ol_flags |= PKT_RX_L4_CKSUM_UNKNOWN;
+
 	if (unlikely(ena_rx_ctx->l3_csum_err))
 		ol_flags |= PKT_RX_IP_CKSUM_BAD;
 
-- 
2.20.1


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

* [dpdk-stable] [PATCH v2] net/ena: fix false indication of bad L4 Rx csums
  2019-10-28 10:16 [dpdk-stable] [PATCH] net/ena: fix false indication of bad L4 Rx csums Michal Krawczyk
@ 2019-10-28 10:23 ` Michal Krawczyk
  2019-10-31 11:47   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Krawczyk @ 2019-10-28 10:23 UTC (permalink / raw)
  To: Marcin Wojtas, Michal Krawczyk, Guy Tzalik, Evgeny Schemeilin,
	Igor Chauskin
  Cc: dev, stable, Maciej Bielski

From: Igor Chauskin <igorch@amazon.com>

Add checking of l4_csum_checked and frag flags before checking the
l4_csum_error flag.

In case of IP fragment/unchecked L4 csum - add PKT_RX_L4_CKSUM_UNKNOWN
flag to the indicated mbuf.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")
Cc: stable@dpdk.org

Signed-off-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Maciej Bielski <mba@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
---
v2:
* Update ENA PMD version to the v2.0.2

 drivers/net/ena/ena_ethdev.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index aa84fabc5..8bbd80dfb 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -27,7 +27,7 @@
 
 #define DRV_MODULE_VER_MAJOR	2
 #define DRV_MODULE_VER_MINOR	0
-#define DRV_MODULE_VER_SUBMINOR	1
+#define DRV_MODULE_VER_SUBMINOR	2
 
 #define ENA_IO_TXQ_IDX(q)	(2 * (q))
 #define ENA_IO_RXQ_IDX(q)	(2 * (q) + 1)
@@ -272,8 +272,14 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf,
 	else if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV6)
 		packet_type |= RTE_PTYPE_L3_IPV6;
 
-	if (unlikely(ena_rx_ctx->l4_csum_err))
-		ol_flags |= PKT_RX_L4_CKSUM_BAD;
+	if (!ena_rx_ctx->l4_csum_checked)
+		ol_flags |= PKT_RX_L4_CKSUM_UNKNOWN;
+	else
+		if (unlikely(ena_rx_ctx->l4_csum_err) && !ena_rx_ctx->frag)
+			ol_flags |= PKT_RX_L4_CKSUM_BAD;
+		else
+			ol_flags |= PKT_RX_L4_CKSUM_UNKNOWN;
+
 	if (unlikely(ena_rx_ctx->l3_csum_err))
 		ol_flags |= PKT_RX_IP_CKSUM_BAD;
 
-- 
2.20.1


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

* Re: [dpdk-stable] [PATCH v2] net/ena: fix false indication of bad L4 Rx csums
  2019-10-28 10:23 ` [dpdk-stable] [PATCH v2] " Michal Krawczyk
@ 2019-10-31 11:47   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2019-10-31 11:47 UTC (permalink / raw)
  To: Michal Krawczyk, Marcin Wojtas, Guy Tzalik, Evgeny Schemeilin,
	Igor Chauskin
  Cc: dev, stable, Maciej Bielski

On 10/28/2019 10:23 AM, Michal Krawczyk wrote:
> From: Igor Chauskin <igorch@amazon.com>
> 
> Add checking of l4_csum_checked and frag flags before checking the
> l4_csum_error flag.
> 
> In case of IP fragment/unchecked L4 csum - add PKT_RX_L4_CKSUM_UNKNOWN
> flag to the indicated mbuf.
> 
> Fixes: 1173fca25af9 ("ena: add polling-mode driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Igor Chauskin <igorch@amazon.com>
> Reviewed-by: Maciej Bielski <mba@semihalf.com>
> Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2019-10-31 11:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-28 10:16 [dpdk-stable] [PATCH] net/ena: fix false indication of bad L4 Rx csums Michal Krawczyk
2019-10-28 10:23 ` [dpdk-stable] [PATCH v2] " Michal Krawczyk
2019-10-31 11:47   ` 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).