[v2,08/13] net/bnxt: fix LRO offload capability

Message ID 20241027171128.50221-9-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series patchset for bnxt PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ajit Khaparde Oct. 27, 2024, 5:11 p.m. UTC
Fix LRO offload capability for P7 devices.
Export the capability to the application only if compressed
Rx CQE mode is not enabled.

LRO aka TPA is not supported when compressed CQE mode is set.

Fixes: 3b56c3ffc182 ("net/bnxt: refactor code to support P7 devices")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Vasuthevan Maheswaran <vasuthevan.maheswaran@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxq.c | 7 ++++++-
 drivers/net/bnxt/bnxt_rxr.c | 3 +++
 2 files changed, 9 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index 1c25c57ca6..249fe7f6e5 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -30,10 +30,12 @@  uint64_t bnxt_get_rx_port_offloads(struct bnxt *bp)
 			  RTE_ETH_RX_OFFLOAD_KEEP_CRC    |
 			  RTE_ETH_RX_OFFLOAD_VLAN_FILTER |
 			  RTE_ETH_RX_OFFLOAD_VLAN_EXTEND |
-			  RTE_ETH_RX_OFFLOAD_TCP_LRO |
 			  RTE_ETH_RX_OFFLOAD_SCATTER |
 			  RTE_ETH_RX_OFFLOAD_RSS_HASH;
 
+	if ((BNXT_CHIP_P7(bp) && !bnxt_compressed_rx_cqe_mode_enabled(bp)) ||
+	    BNXT_CHIP_P5(bp))
+		rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TCP_LRO;
 	if (bp->flags & BNXT_FLAG_PTP_SUPPORTED)
 		rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
 	if (bp->vnic_cap_flags & BNXT_VNIC_CAP_VLAN_RX_STRIP)
@@ -244,6 +246,9 @@  void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq)
 		}
 	}
 
+	if (bnxt_compressed_rx_cqe_mode_enabled(rxq->bp))
+		return;
+
 	/* Free up mbufs in TPA */
 	tpa_info = rxq->rx_ring->tpa_info;
 	if (tpa_info) {
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 0f3fd5326e..dc0bf6032b 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -1671,6 +1671,9 @@  int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
 	}
 	PMD_DRV_LOG_LINE(DEBUG, "AGG Done!");
 
+	if (bnxt_compressed_rx_cqe_mode_enabled(rxq->bp))
+		return 0;
+
 	if (rxr->tpa_info) {
 		unsigned int max_aggs = BNXT_TPA_MAX_AGGS(rxq->bp);