patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 20.11] net/bnxt: fix VLAN indication in Rx mbuf
@ 2021-11-14 13:31 Kalesh A P
  2021-11-27 14:39 ` Xueming(Steven) Li
  0 siblings, 1 reply; 2+ messages in thread
From: Kalesh A P @ 2021-11-14 13:31 UTC (permalink / raw)
  To: stable

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

[ upstream commit 620e0290d14cc9a1126ef1af4eaa71ef9eadca72 ]

Fix to ignore the RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN
when the firmware doesn't support the VLAN strip offload.

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h     |  1 +
 drivers/net/bnxt/bnxt_rxr.c | 11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index c8c6dc4..9a54305 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -721,6 +721,7 @@ struct bnxt {
 #define BNXT_VNIC_CAP_COS_CLASSIFY	BIT(0)
 #define BNXT_VNIC_CAP_OUTER_RSS		BIT(1)
 #define BNXT_VNIC_CAP_VLAN_RX_STRIP	BIT(3)
+#define BNXT_RX_VLAN_STRIP_EN(bp)	((bp)->vnic_cap_flags & BNXT_VNIC_CAP_VLAN_RX_STRIP)
 	unsigned int		rx_nr_rings;
 	unsigned int		rx_cp_nr_rings;
 	unsigned int		rx_num_qs_per_vnic;
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index c1893bb..67181b0 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -214,8 +214,9 @@ static void bnxt_tpa_start(struct bnxt_rx_queue *rxq,
 		mbuf->hash.fdir.id = rte_le_to_cpu_16(tpa_start1->cfa_code);
 		mbuf->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID;
 	}
-	if (tpa_start1->flags2 &
-	    rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN)) {
+	if ((tpa_start1->flags2 &
+	     rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN)) &&
+	    BNXT_RX_VLAN_STRIP_EN(rxq->bp)) {
 		mbuf->vlan_tci = rte_le_to_cpu_32(tpa_start1->metadata);
 		mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
 	}
@@ -515,8 +516,10 @@ bnxt_init_ol_flags_tables(struct bnxt_rx_queue *rxq)
 	for (i = 0; i < BNXT_OL_FLAGS_TBL_DIM; i++) {
 		pt[i] = 0;
 
-		if (i & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN)
-			pt[i] |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
+		if (BNXT_RX_VLAN_STRIP_EN(rxq->bp)) {
+			if (i & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN)
+				pt[i] |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
+		}
 
 		if (i & (RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC << 3)) {
 			/* Tunnel case. */
-- 
2.10.1


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

* Re: [PATCH 20.11] net/bnxt: fix VLAN indication in Rx mbuf
  2021-11-14 13:31 [PATCH 20.11] net/bnxt: fix VLAN indication in Rx mbuf Kalesh A P
@ 2021-11-27 14:39 ` Xueming(Steven) Li
  0 siblings, 0 replies; 2+ messages in thread
From: Xueming(Steven) Li @ 2021-11-27 14:39 UTC (permalink / raw)
  To: kalesh-anakkur.purayil, stable

On Sun, 2021-11-14 at 19:01 +0530, Kalesh A P wrote:
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> 
> [ upstream commit 620e0290d14cc9a1126ef1af4eaa71ef9eadca72 ]
> 
> Fix to ignore the RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN
> when the firmware doesn't support the VLAN strip offload.
> 
> Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
> 
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---


Applied to 20.11.4 list, thanks!

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

end of thread, other threads:[~2021-11-27 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-14 13:31 [PATCH 20.11] net/bnxt: fix VLAN indication in Rx mbuf Kalesh A P
2021-11-27 14:39 ` Xueming(Steven) Li

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