[PATCH v6 1/4] common/sfc_efx/base: report VLAN stripping capability

Artemii Morozov artemii.morozov at arknetworks.am
Thu Jun 22 13:31:01 CEST 2023


These changes are necessary in order to add support for stripping
VLAN tags in the future.

Signed-off-by: Artemii Morozov <artemii.morozov at arknetworks.am>
Reviewed-by: Ivan Malov <ivan.malov at arknetworks.am>
Reviewed-by: Andy Moreton <amoreton at xilinx.com>
---
 drivers/common/sfc_efx/base/ef10_nic.c  | 6 ++++++
 drivers/common/sfc_efx/base/efx.h       | 1 +
 drivers/common/sfc_efx/base/siena_nic.c | 1 +
 3 files changed, 8 insertions(+)

diff --git a/drivers/common/sfc_efx/base/ef10_nic.c b/drivers/common/sfc_efx/base/ef10_nic.c
index e1709d1200..070f4d08b5 100644
--- a/drivers/common/sfc_efx/base/ef10_nic.c
+++ b/drivers/common/sfc_efx/base/ef10_nic.c
@@ -1146,6 +1146,12 @@ ef10_get_datapath_caps(
 	else
 		encp->enc_hw_tx_insert_vlan_enabled = B_FALSE;
 
+	/* Check if firmware supports VLAN stripping. */
+	if (CAP_FLAGS1(req, RX_VLAN_STRIPPING))
+		encp->enc_rx_vlan_stripping_supported = B_TRUE;
+	else
+		encp->enc_rx_vlan_stripping_supported = B_FALSE;
+
 	/* Check if the firmware supports RX event batching */
 	if (CAP_FLAGS1(req, RX_BATCHING))
 		encp->enc_rx_batching_enabled = B_TRUE;
diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index 10c412bcd7..9a29583ecb 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -1616,6 +1616,7 @@ typedef struct efx_nic_cfg_s {
 	/* Number of TSO contexts on the NIC (FATSOv2) */
 	uint32_t		enc_fw_assisted_tso_v2_n_contexts;
 	boolean_t		enc_hw_tx_insert_vlan_enabled;
+	boolean_t		enc_rx_vlan_stripping_supported;
 	/* Number of PFs on the NIC */
 	uint32_t		enc_hw_pf_count;
 	/* Datapath firmware vadapter/vport/vswitch support */
diff --git a/drivers/common/sfc_efx/base/siena_nic.c b/drivers/common/sfc_efx/base/siena_nic.c
index 9f14faf271..4b7f7cbb87 100644
--- a/drivers/common/sfc_efx/base/siena_nic.c
+++ b/drivers/common/sfc_efx/base/siena_nic.c
@@ -179,6 +179,7 @@ siena_board_cfg(
 	    (encp->enc_rxq_limit * EFX_RXQ_DC_NDESCS(EFX_RXQ_DC_SIZE));
 
 	encp->enc_hw_tx_insert_vlan_enabled = B_FALSE;
+	encp->enc_rx_vlan_stripping_supported = B_FALSE;
 	encp->enc_fw_assisted_tso_enabled = B_FALSE;
 	encp->enc_fw_assisted_tso_v2_enabled = B_FALSE;
 	encp->enc_fw_assisted_tso_v2_n_contexts = 0;
-- 
2.34.1



More information about the dev mailing list