patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 19.11 1/2] net/bnxt: check FW capability for VLAN offloads
@ 2021-12-05  4:02 Kalesh A P
  2021-12-05  4:02 ` [PATCH 19.11 2/2] net/bnxt: fix VLAN indication in Rx mbuf Kalesh A P
  2021-12-06  8:27 ` [PATCH 19.11 1/2] net/bnxt: check FW capability for VLAN offloads Christian Ehrhardt
  0 siblings, 2 replies; 4+ messages in thread
From: Kalesh A P @ 2021-12-05  4:02 UTC (permalink / raw)
  To: stable

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

[ upstream commit baedf29794aa7cf8527d6362af17dce5046b1f51 ]

VLAN offload capability may be disabled in the FW. The driver
should not attempt to override or utilize this feature in such
scenarios since it will not work as expected.

Fixes: 0a6d2a720078 ("net/bnxt: get device infos")

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                |  2 ++
 drivers/net/bnxt/bnxt_ethdev.c         |  8 +++++---
 drivers/net/bnxt/bnxt_hwrm.c           | 10 ++++++++++
 drivers/net/bnxt/hsi_struct_def_dpdk.h |  3 +++
 4 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index ceff0a7..63d7475 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -592,11 +592,13 @@ struct bnxt {
 #define BNXT_FW_CAP_IF_CHANGE		BIT(1)
 #define BNXT_FW_CAP_ERROR_RECOVERY	BIT(2)
 #define BNXT_FW_CAP_ERR_RECOVER_RELOAD	BIT(3)
+#define BNXT_FW_CAP_VLAN_TX_INSERT	BIT(4)
 
 	pthread_mutex_t         flow_lock;
 
 	uint32_t		vnic_cap_flags;
 #define BNXT_VNIC_CAP_COS_CLASSIFY	BIT(0)
+#define BNXT_VNIC_CAP_VLAN_RX_STRIP	BIT(1)
 	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_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 81f9886..d4c63fa 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -100,8 +100,7 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 	ETH_RSS_NONFRAG_IPV6_TCP |	\
 	ETH_RSS_NONFRAG_IPV6_UDP)
 
-#define BNXT_DEV_TX_OFFLOAD_SUPPORT (DEV_TX_OFFLOAD_VLAN_INSERT | \
-				     DEV_TX_OFFLOAD_IPV4_CKSUM | \
+#define BNXT_DEV_TX_OFFLOAD_SUPPORT (DEV_TX_OFFLOAD_IPV4_CKSUM | \
 				     DEV_TX_OFFLOAD_TCP_CKSUM | \
 				     DEV_TX_OFFLOAD_UDP_CKSUM | \
 				     DEV_TX_OFFLOAD_TCP_TSO | \
@@ -114,7 +113,6 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 				     DEV_TX_OFFLOAD_MULTI_SEGS)
 
 #define BNXT_DEV_RX_OFFLOAD_SUPPORT (DEV_RX_OFFLOAD_VLAN_FILTER | \
-				     DEV_RX_OFFLOAD_VLAN_STRIP | \
 				     DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				     DEV_RX_OFFLOAD_UDP_CKSUM | \
 				     DEV_RX_OFFLOAD_TCP_CKSUM | \
@@ -587,7 +585,11 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 	dev_info->rx_offload_capa = BNXT_DEV_RX_OFFLOAD_SUPPORT;
 	if (bp->flags & BNXT_FLAG_PTP_SUPPORTED)
 		dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_TIMESTAMP;
+	if (bp->vnic_cap_flags & BNXT_VNIC_CAP_VLAN_RX_STRIP)
+		dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_VLAN_STRIP;
 	dev_info->tx_offload_capa = BNXT_DEV_TX_OFFLOAD_SUPPORT;
+	if (bp->fw_cap & BNXT_FW_CAP_VLAN_TX_INSERT)
+		dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_VLAN_INSERT;
 	dev_info->flow_type_rss_offloads = BNXT_ETH_RSS_SUPPORT;
 
 	dev_info->default_rxconf = (struct rte_eth_rxconf) {
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 844f1e8..25e6b8c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -734,6 +734,10 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 	if (flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE)
 		bp->fw_cap |= BNXT_FW_CAP_HOT_RESET;
 
+	if (!(flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VLAN_ACCELERATION_TX_DISABLED)) {
+		bp->fw_cap |= BNXT_FW_CAP_VLAN_TX_INSERT;
+		PMD_DRV_LOG(DEBUG, "VLAN acceleration for TX is enabled\n");
+	}
 unlock:
 	HWRM_UNLOCK();
 
@@ -787,6 +791,12 @@ int bnxt_hwrm_vnic_qcaps(struct bnxt *bp)
 		PMD_DRV_LOG(INFO, "CoS assignment capability enabled\n");
 	}
 
+	if (rte_le_to_cpu_32(resp->flags) &
+	    HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP) {
+		bp->vnic_cap_flags |= BNXT_VNIC_CAP_VLAN_RX_STRIP;
+		PMD_DRV_LOG(DEBUG, "Rx VLAN strip capability enabled\n");
+	}
+
 	bp->max_tpa_v2 = rte_le_to_cpu_16(resp->max_aggs_supported);
 
 	HWRM_UNLOCK();
diff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h
index 6a16ea9..0935eb7 100644
--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h
+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h
@@ -7441,6 +7441,9 @@ struct hwrm_func_qcaps_output {
 	 */
 	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NOTIFY_VF_DEF_VNIC_CHNG_SUPPORTED \
 		UINT32_C(0x4000000)
+	/* If set to 1, then the vlan acceleration for TX is disabled. */
+	#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VLAN_ACCELERATION_TX_DISABLED \
+		UINT32_C(0x8000000)
 	/*
 	 * This value is current MAC address configured for this
 	 * function. A value of 00-00-00-00-00-00 indicates no
-- 
2.10.1


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

* [PATCH 19.11 2/2] net/bnxt: fix VLAN indication in Rx mbuf
  2021-12-05  4:02 [PATCH 19.11 1/2] net/bnxt: check FW capability for VLAN offloads Kalesh A P
@ 2021-12-05  4:02 ` Kalesh A P
  2021-12-06  8:27   ` Christian Ehrhardt
  2021-12-06  8:27 ` [PATCH 19.11 1/2] net/bnxt: check FW capability for VLAN offloads Christian Ehrhardt
  1 sibling, 1 reply; 4+ messages in thread
From: Kalesh A P @ 2021-12-05  4:02 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          | 8 +++++---
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 5 +++--
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 63d7475..73001b1 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -599,6 +599,7 @@ struct bnxt {
 	uint32_t		vnic_cap_flags;
 #define BNXT_VNIC_CAP_COS_CLASSIFY	BIT(0)
 #define BNXT_VNIC_CAP_VLAN_RX_STRIP	BIT(1)
+#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 56213f0..3355e00 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -209,8 +209,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 (BNXT_RX_VLAN_STRIP_EN(rxq->bp) &&
+	    (tpa_start1->flags2 &
+	     rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN))) {
 		mbuf->vlan_tci = rte_le_to_cpu_32(tpa_start1->metadata);
 		mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
 	}
@@ -601,7 +602,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 	if (agg_buf)
 		bnxt_rx_pages(rxq, mbuf, &tmp_raw_cons, agg_buf, NULL);
 
-	if (rxcmp1->flags2 & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN) {
+	if (BNXT_RX_VLAN_STRIP_EN(rxq->bp) &&
+	    (rxcmp1->flags2 & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN)) {
 		mbuf->vlan_tci = rxcmp1->metadata &
 			(RX_PKT_CMPL_METADATA_VID_MASK |
 			RX_PKT_CMPL_METADATA_DE |
diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
index 9c3ae39..3d2081b 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
@@ -287,8 +287,9 @@ recv_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 			if (rxcmp->flags_type & RX_PKT_CMPL_FLAGS_RSS_VALID)
 				mbuf->ol_flags |= PKT_RX_RSS_HASH;
 
-			if (rxcmp1->flags2 &
-			    RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN) {
+			if (BNXT_RX_VLAN_STRIP_EN(rxq->bp) &&
+			    (rxcmp1->flags2 &
+			     RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN)) {
 				mbuf->vlan_tci = rxcmp1->metadata &
 					(RX_PKT_CMPL_METADATA_VID_MASK |
 					RX_PKT_CMPL_METADATA_DE |
-- 
2.10.1


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

* Re: [PATCH 19.11 1/2] net/bnxt: check FW capability for VLAN offloads
  2021-12-05  4:02 [PATCH 19.11 1/2] net/bnxt: check FW capability for VLAN offloads Kalesh A P
  2021-12-05  4:02 ` [PATCH 19.11 2/2] net/bnxt: fix VLAN indication in Rx mbuf Kalesh A P
@ 2021-12-06  8:27 ` Christian Ehrhardt
  1 sibling, 0 replies; 4+ messages in thread
From: Christian Ehrhardt @ 2021-12-06  8:27 UTC (permalink / raw)
  To: Kalesh A P; +Cc: stable

On Sun, Dec 5, 2021 at 4:42 AM Kalesh A P
<kalesh-anakkur.purayil@broadcom.com> wrote:
>
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> [ upstream commit baedf29794aa7cf8527d6362af17dce5046b1f51 ]

Applied, thanks!

> VLAN offload capability may be disabled in the FW. The driver
> should not attempt to override or utilize this feature in such
> scenarios since it will not work as expected.
>
> Fixes: 0a6d2a720078 ("net/bnxt: get device infos")
>
> 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                |  2 ++
>  drivers/net/bnxt/bnxt_ethdev.c         |  8 +++++---
>  drivers/net/bnxt/bnxt_hwrm.c           | 10 ++++++++++
>  drivers/net/bnxt/hsi_struct_def_dpdk.h |  3 +++
>  4 files changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
> index ceff0a7..63d7475 100644
> --- a/drivers/net/bnxt/bnxt.h
> +++ b/drivers/net/bnxt/bnxt.h
> @@ -592,11 +592,13 @@ struct bnxt {
>  #define BNXT_FW_CAP_IF_CHANGE          BIT(1)
>  #define BNXT_FW_CAP_ERROR_RECOVERY     BIT(2)
>  #define BNXT_FW_CAP_ERR_RECOVER_RELOAD BIT(3)
> +#define BNXT_FW_CAP_VLAN_TX_INSERT     BIT(4)
>
>         pthread_mutex_t         flow_lock;
>
>         uint32_t                vnic_cap_flags;
>  #define BNXT_VNIC_CAP_COS_CLASSIFY     BIT(0)
> +#define BNXT_VNIC_CAP_VLAN_RX_STRIP    BIT(1)
>         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_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index 81f9886..d4c63fa 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -100,8 +100,7 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
>         ETH_RSS_NONFRAG_IPV6_TCP |      \
>         ETH_RSS_NONFRAG_IPV6_UDP)
>
> -#define BNXT_DEV_TX_OFFLOAD_SUPPORT (DEV_TX_OFFLOAD_VLAN_INSERT | \
> -                                    DEV_TX_OFFLOAD_IPV4_CKSUM | \
> +#define BNXT_DEV_TX_OFFLOAD_SUPPORT (DEV_TX_OFFLOAD_IPV4_CKSUM | \
>                                      DEV_TX_OFFLOAD_TCP_CKSUM | \
>                                      DEV_TX_OFFLOAD_UDP_CKSUM | \
>                                      DEV_TX_OFFLOAD_TCP_TSO | \
> @@ -114,7 +113,6 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
>                                      DEV_TX_OFFLOAD_MULTI_SEGS)
>
>  #define BNXT_DEV_RX_OFFLOAD_SUPPORT (DEV_RX_OFFLOAD_VLAN_FILTER | \
> -                                    DEV_RX_OFFLOAD_VLAN_STRIP | \
>                                      DEV_RX_OFFLOAD_IPV4_CKSUM | \
>                                      DEV_RX_OFFLOAD_UDP_CKSUM | \
>                                      DEV_RX_OFFLOAD_TCP_CKSUM | \
> @@ -587,7 +585,11 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
>         dev_info->rx_offload_capa = BNXT_DEV_RX_OFFLOAD_SUPPORT;
>         if (bp->flags & BNXT_FLAG_PTP_SUPPORTED)
>                 dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_TIMESTAMP;
> +       if (bp->vnic_cap_flags & BNXT_VNIC_CAP_VLAN_RX_STRIP)
> +               dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_VLAN_STRIP;
>         dev_info->tx_offload_capa = BNXT_DEV_TX_OFFLOAD_SUPPORT;
> +       if (bp->fw_cap & BNXT_FW_CAP_VLAN_TX_INSERT)
> +               dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_VLAN_INSERT;
>         dev_info->flow_type_rss_offloads = BNXT_ETH_RSS_SUPPORT;
>
>         dev_info->default_rxconf = (struct rte_eth_rxconf) {
> diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
> index 844f1e8..25e6b8c 100644
> --- a/drivers/net/bnxt/bnxt_hwrm.c
> +++ b/drivers/net/bnxt/bnxt_hwrm.c
> @@ -734,6 +734,10 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
>         if (flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_HOT_RESET_CAPABLE)
>                 bp->fw_cap |= BNXT_FW_CAP_HOT_RESET;
>
> +       if (!(flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VLAN_ACCELERATION_TX_DISABLED)) {
> +               bp->fw_cap |= BNXT_FW_CAP_VLAN_TX_INSERT;
> +               PMD_DRV_LOG(DEBUG, "VLAN acceleration for TX is enabled\n");
> +       }
>  unlock:
>         HWRM_UNLOCK();
>
> @@ -787,6 +791,12 @@ int bnxt_hwrm_vnic_qcaps(struct bnxt *bp)
>                 PMD_DRV_LOG(INFO, "CoS assignment capability enabled\n");
>         }
>
> +       if (rte_le_to_cpu_32(resp->flags) &
> +           HWRM_VNIC_QCAPS_OUTPUT_FLAGS_VLAN_STRIP_CAP) {
> +               bp->vnic_cap_flags |= BNXT_VNIC_CAP_VLAN_RX_STRIP;
> +               PMD_DRV_LOG(DEBUG, "Rx VLAN strip capability enabled\n");
> +       }
> +
>         bp->max_tpa_v2 = rte_le_to_cpu_16(resp->max_aggs_supported);
>
>         HWRM_UNLOCK();
> diff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h
> index 6a16ea9..0935eb7 100644
> --- a/drivers/net/bnxt/hsi_struct_def_dpdk.h
> +++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h
> @@ -7441,6 +7441,9 @@ struct hwrm_func_qcaps_output {
>          */
>         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_NOTIFY_VF_DEF_VNIC_CHNG_SUPPORTED \
>                 UINT32_C(0x4000000)
> +       /* If set to 1, then the vlan acceleration for TX is disabled. */
> +       #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_VLAN_ACCELERATION_TX_DISABLED \
> +               UINT32_C(0x8000000)
>         /*
>          * This value is current MAC address configured for this
>          * function. A value of 00-00-00-00-00-00 indicates no
> --
> 2.10.1
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

* Re: [PATCH 19.11 2/2] net/bnxt: fix VLAN indication in Rx mbuf
  2021-12-05  4:02 ` [PATCH 19.11 2/2] net/bnxt: fix VLAN indication in Rx mbuf Kalesh A P
@ 2021-12-06  8:27   ` Christian Ehrhardt
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Ehrhardt @ 2021-12-06  8:27 UTC (permalink / raw)
  To: Kalesh A P; +Cc: stable

On Sun, Dec 5, 2021 at 4:42 AM Kalesh A P
<kalesh-anakkur.purayil@broadcom.com> wrote:
>
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> [ upstream commit 620e0290d14cc9a1126ef1af4eaa71ef9eadca72 ]

Applied, thanks!

> 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          | 8 +++++---
>  drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 5 +++--
>  3 files changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
> index 63d7475..73001b1 100644
> --- a/drivers/net/bnxt/bnxt.h
> +++ b/drivers/net/bnxt/bnxt.h
> @@ -599,6 +599,7 @@ struct bnxt {
>         uint32_t                vnic_cap_flags;
>  #define BNXT_VNIC_CAP_COS_CLASSIFY     BIT(0)
>  #define BNXT_VNIC_CAP_VLAN_RX_STRIP    BIT(1)
> +#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 56213f0..3355e00 100644
> --- a/drivers/net/bnxt/bnxt_rxr.c
> +++ b/drivers/net/bnxt/bnxt_rxr.c
> @@ -209,8 +209,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 (BNXT_RX_VLAN_STRIP_EN(rxq->bp) &&
> +           (tpa_start1->flags2 &
> +            rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN))) {
>                 mbuf->vlan_tci = rte_le_to_cpu_32(tpa_start1->metadata);
>                 mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
>         }
> @@ -601,7 +602,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
>         if (agg_buf)
>                 bnxt_rx_pages(rxq, mbuf, &tmp_raw_cons, agg_buf, NULL);
>
> -       if (rxcmp1->flags2 & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN) {
> +       if (BNXT_RX_VLAN_STRIP_EN(rxq->bp) &&
> +           (rxcmp1->flags2 & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN)) {
>                 mbuf->vlan_tci = rxcmp1->metadata &
>                         (RX_PKT_CMPL_METADATA_VID_MASK |
>                         RX_PKT_CMPL_METADATA_DE |
> diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
> index 9c3ae39..3d2081b 100644
> --- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
> +++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
> @@ -287,8 +287,9 @@ recv_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
>                         if (rxcmp->flags_type & RX_PKT_CMPL_FLAGS_RSS_VALID)
>                                 mbuf->ol_flags |= PKT_RX_RSS_HASH;
>
> -                       if (rxcmp1->flags2 &
> -                           RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN) {
> +                       if (BNXT_RX_VLAN_STRIP_EN(rxq->bp) &&
> +                           (rxcmp1->flags2 &
> +                            RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN)) {
>                                 mbuf->vlan_tci = rxcmp1->metadata &
>                                         (RX_PKT_CMPL_METADATA_VID_MASK |
>                                         RX_PKT_CMPL_METADATA_DE |
> --
> 2.10.1
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

end of thread, other threads:[~2021-12-06  8:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-05  4:02 [PATCH 19.11 1/2] net/bnxt: check FW capability for VLAN offloads Kalesh A P
2021-12-05  4:02 ` [PATCH 19.11 2/2] net/bnxt: fix VLAN indication in Rx mbuf Kalesh A P
2021-12-06  8:27   ` Christian Ehrhardt
2021-12-06  8:27 ` [PATCH 19.11 1/2] net/bnxt: check FW capability for VLAN offloads Christian Ehrhardt

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