[v4,02/34] common/sfc_efx/base: detect MCDI Table Access API support

Message ID 20230607130245.8048-3-ivan.malov@arknetworks.am (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/sfc: support HW conntrack assistance |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ivan Malov June 7, 2023, 1:02 p.m. UTC
  From: Denis Pryazhennikov <denis.pryazhennikov@arknetworks.am>

Future patches will add an implementation of MCDI Table
Access API in libefx. This patch adds a way to determine
if this API is supported.

Signed-off-by: Denis Pryazhennikov <denis.pryazhennikov@arknetworks.am>
Reviewed-by: Ivan Malov <ivan.malov@arknetworks.am>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/common/sfc_efx/base/efx.h          | 2 ++
 drivers/common/sfc_efx/base/hunt_nic.c     | 2 ++
 drivers/common/sfc_efx/base/medford2_nic.c | 2 ++
 drivers/common/sfc_efx/base/medford_nic.c  | 2 ++
 drivers/common/sfc_efx/base/rhead_nic.c    | 9 +++++++++
 drivers/common/sfc_efx/base/siena_nic.c    | 2 ++
 6 files changed, 19 insertions(+)
  

Patch

diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index f4fa88f169..520674a602 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -1672,6 +1672,8 @@  typedef struct efx_nic_cfg_s {
 	boolean_t		enc_mae_admin;
 	/* NIC support for MAE action set v2 features. */
 	boolean_t		enc_mae_aset_v2_supported;
+	/* NIC support for MCDI Table Access API. */
+	boolean_t		enc_table_api_supported;
 	/* Firmware support for "FLAG" and "MARK" filter actions */
 	boolean_t		enc_filter_action_flag_supported;
 	boolean_t		enc_filter_action_mark_supported;
diff --git a/drivers/common/sfc_efx/base/hunt_nic.c b/drivers/common/sfc_efx/base/hunt_nic.c
index 08ae324482..04595a39c8 100644
--- a/drivers/common/sfc_efx/base/hunt_nic.c
+++ b/drivers/common/sfc_efx/base/hunt_nic.c
@@ -192,6 +192,8 @@  hunt_board_cfg(
 	/* All Huntington devices have a PCIe Gen3, 8 lane connector */
 	encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3;
 
+	encp->enc_table_api_supported = B_FALSE;
+
 	return (0);
 
 fail4:
diff --git a/drivers/common/sfc_efx/base/medford2_nic.c b/drivers/common/sfc_efx/base/medford2_nic.c
index 6d19524573..49adabffb2 100644
--- a/drivers/common/sfc_efx/base/medford2_nic.c
+++ b/drivers/common/sfc_efx/base/medford2_nic.c
@@ -152,6 +152,8 @@  medford2_board_cfg(
 	encp->enc_required_pcie_bandwidth_mbps = bandwidth;
 	encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3;
 
+	encp->enc_table_api_supported = B_FALSE;
+
 	return (0);
 
 fail4:
diff --git a/drivers/common/sfc_efx/base/medford_nic.c b/drivers/common/sfc_efx/base/medford_nic.c
index b111e3eded..9a460b2b9b 100644
--- a/drivers/common/sfc_efx/base/medford_nic.c
+++ b/drivers/common/sfc_efx/base/medford_nic.c
@@ -150,6 +150,8 @@  medford_board_cfg(
 	encp->enc_required_pcie_bandwidth_mbps = bandwidth;
 	encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3;
 
+	encp->enc_table_api_supported = B_FALSE;
+
 	return (0);
 
 fail4:
diff --git a/drivers/common/sfc_efx/base/rhead_nic.c b/drivers/common/sfc_efx/base/rhead_nic.c
index eda6c1c4f9..a773aea38d 100644
--- a/drivers/common/sfc_efx/base/rhead_nic.c
+++ b/drivers/common/sfc_efx/base/rhead_nic.c
@@ -176,6 +176,15 @@  rhead_board_cfg(
 	encp->enc_required_pcie_bandwidth_mbps = bandwidth;
 	encp->enc_max_pcie_link_gen = EFX_PCIE_LINK_SPEED_GEN3;
 
+	/*
+	 * FIXME: MCDI table API support depends on an EF100 firmware build
+	 * and an EF100 platform. It should be discovered by using a capability
+	 * flag from MCDI that is not implemented yet.
+	 * Right now we can safely rely on the return code from the libefx
+	 * MCDI Table API.
+	 */
+	encp->enc_table_api_supported = B_TRUE;
+
 	return (0);
 
 fail3:
diff --git a/drivers/common/sfc_efx/base/siena_nic.c b/drivers/common/sfc_efx/base/siena_nic.c
index 9f14faf271..1f1fb7d2af 100644
--- a/drivers/common/sfc_efx/base/siena_nic.c
+++ b/drivers/common/sfc_efx/base/siena_nic.c
@@ -205,6 +205,8 @@  siena_board_cfg(
 	encp->enc_mae_supported = B_FALSE;
 	encp->enc_mae_admin = B_FALSE;
 
+	encp->enc_table_api_supported = B_FALSE;
+
 	encp->enc_dma_mapping = EFX_NIC_DMA_MAPPING_FLAT;
 
 	return (0);