patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 11/15] net/ena: fix bad checksum handling
       [not found] <20240702144626.14545-1-shaibran@amazon.com>
@ 2024-07-02 14:46 ` shaibran
  2024-07-02 14:46 ` [PATCH 12/15] net/ena: fix invalid return value check shaibran
  2024-07-02 14:46 ` [PATCH 13/15] net/ena: fix wrong handling of checksum shaibran
  2 siblings, 0 replies; 3+ messages in thread
From: shaibran @ 2024-07-02 14:46 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, Shai Brandes, stable

From: Shai Brandes <shaibran@amazon.com>

Removed a workaround for a false L4 bad Rx csum
indication from the device. The workaround was to set it
as unknown so the application would check it instead.
The issue was fixed in the device, thus the driver bad csum
handling should be fixed in the PMD.

Fixes: b2d2f1cf89a6 ("net/ena: fix checksum flag for L4")
Cc: stable@dpdk.org
Signed-off-by: Shai Brandes <shaibran@amazon.com>
---
 doc/guides/rel_notes/release_24_07.rst | 1 +
 drivers/net/ena/ena_ethdev.c           | 8 +-------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/doc/guides/rel_notes/release_24_07.rst b/doc/guides/rel_notes/release_24_07.rst
index a59fb2a21f..f000dec54b 100644
--- a/doc/guides/rel_notes/release_24_07.rst
+++ b/doc/guides/rel_notes/release_24_07.rst
@@ -78,6 +78,7 @@ New Features
   * Reworked the driver logger usage in order to improve Tx performance.
   * Reworked the device uninitialization flow to ensure complete resource
     cleanup and lay the groundwork for hot-unplug support.
+  * Removed an obsolete workaround for a false L4 bad Rx checksum indication.
 
 * **Update Tap PMD driver.**
 
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 4e7171e629..b43b913903 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -674,13 +674,7 @@ static inline void ena_rx_mbuf_prepare(struct ena_ring *rx_ring,
 	} else {
 		if (unlikely(ena_rx_ctx->l4_csum_err)) {
 			++rx_stats->l4_csum_bad;
-			/*
-			 * For the L4 Rx checksum offload the HW may indicate
-			 * bad checksum although it's valid. Because of that,
-			 * we're setting the UNKNOWN flag to let the app
-			 * re-verify the checksum.
-			 */
-			ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN;
+			ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_BAD;
 		} else {
 			++rx_stats->l4_csum_good;
 			ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD;
-- 
2.17.1


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

* [PATCH 12/15] net/ena: fix invalid return value check
       [not found] <20240702144626.14545-1-shaibran@amazon.com>
  2024-07-02 14:46 ` [PATCH 11/15] net/ena: fix bad checksum handling shaibran
@ 2024-07-02 14:46 ` shaibran
  2024-07-02 14:46 ` [PATCH 13/15] net/ena: fix wrong handling of checksum shaibran
  2 siblings, 0 replies; 3+ messages in thread
From: shaibran @ 2024-07-02 14:46 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, Shai Brandes, stable

From: Shai Brandes <shaibran@amazon.com>

Removed the sign inversion for when checking if
ena_com_set_host_attributes returns ENA_COM_UNSUPPORTED.
ENA_COM_UNSUPPORTED is defined as -EOPNOTSUPP, so the extra sign
inversion is wrong.

Fixes: 3adcba9a8987 ("net/ena: update HAL to the newer version")
Cc: stable@dpdk.org

Signed-off-by: Shai Brandes <shaibran@amazon.com>
---
 doc/guides/rel_notes/release_24_07.rst | 1 +
 drivers/net/ena/ena_ethdev.c           | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/guides/rel_notes/release_24_07.rst b/doc/guides/rel_notes/release_24_07.rst
index f000dec54b..24bb91ad46 100644
--- a/doc/guides/rel_notes/release_24_07.rst
+++ b/doc/guides/rel_notes/release_24_07.rst
@@ -79,6 +79,7 @@ New Features
   * Reworked the device uninitialization flow to ensure complete resource
     cleanup and lay the groundwork for hot-unplug support.
   * Removed an obsolete workaround for a false L4 bad Rx checksum indication.
+  * Fixed an invalid return value check.
 
 * **Update Tap PMD driver.**
 
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index b43b913903..67a1d86f9a 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -812,7 +812,7 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev)
 
 	rc = ena_com_set_host_attributes(ena_dev);
 	if (rc) {
-		if (rc == -ENA_COM_UNSUPPORTED)
+		if (rc == ENA_COM_UNSUPPORTED)
 			PMD_DRV_LOG(WARNING, "Cannot set host attributes\n");
 		else
 			PMD_DRV_LOG(ERR, "Cannot set host attributes\n");
@@ -856,7 +856,7 @@ static void ena_config_debug_area(struct ena_adapter *adapter)
 
 	rc = ena_com_set_host_attributes(&adapter->ena_dev);
 	if (rc) {
-		if (rc == -ENA_COM_UNSUPPORTED)
+		if (rc == ENA_COM_UNSUPPORTED)
 			PMD_DRV_LOG(WARNING, "Cannot set host attributes\n");
 		else
 			PMD_DRV_LOG(ERR, "Cannot set host attributes\n");
-- 
2.17.1


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

* [PATCH 13/15] net/ena: fix wrong handling of checksum
       [not found] <20240702144626.14545-1-shaibran@amazon.com>
  2024-07-02 14:46 ` [PATCH 11/15] net/ena: fix bad checksum handling shaibran
  2024-07-02 14:46 ` [PATCH 12/15] net/ena: fix invalid return value check shaibran
@ 2024-07-02 14:46 ` shaibran
  2 siblings, 0 replies; 3+ messages in thread
From: shaibran @ 2024-07-02 14:46 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, Shai Brandes, stable

From: Shai Brandes <shaibran@amazon.com>

This change fixes an issue where a non tcp/udp packet can be indicated
to have an invalid csum. If the device erroneously tries to verify the
csum on a non tcp/udp packet it will result in false indication that
there is a csum error. This change make the driver ignore the
indication for csum error on such packets.

Fixes: 84daba9962b5 ("net/ena: add extra Rx checksum related xstats")
Cc: stable@dpdk.org
Signed-off-by: Shai Brandes <shaibran@amazon.com>
---
 doc/guides/rel_notes/release_24_07.rst | 1 +
 drivers/net/ena/ena_ethdev.c           | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/guides/rel_notes/release_24_07.rst b/doc/guides/rel_notes/release_24_07.rst
index 24bb91ad46..ec960d93cc 100644
--- a/doc/guides/rel_notes/release_24_07.rst
+++ b/doc/guides/rel_notes/release_24_07.rst
@@ -80,6 +80,7 @@ New Features
     cleanup and lay the groundwork for hot-unplug support.
   * Removed an obsolete workaround for a false L4 bad Rx checksum indication.
   * Fixed an invalid return value check.
+  * Fixed Rx chcecksum inspection to check only TCP/UDP packets.
 
 * **Update Tap PMD driver.**
 
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 67a1d86f9a..a18c94df28 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -669,7 +669,8 @@ static inline void ena_rx_mbuf_prepare(struct ena_ring *rx_ring,
 		packet_type |= RTE_PTYPE_L3_IPV6;
 	}
 
-	if (!ena_rx_ctx->l4_csum_checked || ena_rx_ctx->frag) {
+	if (!ena_rx_ctx->l4_csum_checked || ena_rx_ctx->frag ||
+		!(packet_type & (RTE_PTYPE_L4_TCP | RTE_PTYPE_L4_UDP))) {
 		ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN;
 	} else {
 		if (unlikely(ena_rx_ctx->l4_csum_err)) {
-- 
2.17.1


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

end of thread, other threads:[~2024-07-02 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20240702144626.14545-1-shaibran@amazon.com>
2024-07-02 14:46 ` [PATCH 11/15] net/ena: fix bad checksum handling shaibran
2024-07-02 14:46 ` [PATCH 12/15] net/ena: fix invalid return value check shaibran
2024-07-02 14:46 ` [PATCH 13/15] net/ena: fix wrong handling of checksum shaibran

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