From: Ivan Malov <ivan.malov@oktetlabs.ru>
Riverhead boards maintain support for MAE, a low-level Match-Action Engine.
The feature is documented in SF-122526-TC.
The new field will help client drivers to test
NIC support for MAE status.
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
drivers/common/sfc_efx/base/ef10_nic.c | 15 +++++++++++++++
drivers/common/sfc_efx/base/efx.h | 2 ++
drivers/common/sfc_efx/base/efx_check.h | 6 ++++++
drivers/common/sfc_efx/base/siena_nic.c | 2 ++
drivers/common/sfc_efx/efsys.h | 2 ++
5 files changed, 27 insertions(+)
@@ -1421,8 +1421,23 @@ ef10_get_datapath_caps(
else
encp->enc_filter_action_mark_max = 0;
+#if EFSYS_OPT_MAE
+ /*
+ * Indicate support for MAE.
+ * MAE is supported by Riverhead boards starting with R2,
+ * and it is required that FW is built with MAE support, too.
+ */
+ if (CAP_FLAGS3(req, MAE_SUPPORTED))
+ encp->enc_mae_supported = B_TRUE;
+ else
+ encp->enc_mae_supported = B_FALSE;
+#else
+ encp->enc_mae_supported = B_FALSE;
+#endif /* EFSYS_OPT_MAE */
+
#undef CAP_FLAGS1
#undef CAP_FLAGS2
+#undef CAP_FLAGS3
return (0);
@@ -1593,6 +1593,8 @@ typedef struct efx_nic_cfg_s {
uint32_t enc_mac_stats_nstats;
boolean_t enc_fec_counters;
boolean_t enc_hlb_counters;
+ /* NIC support for Match-Action Engine (MAE). */
+ boolean_t enc_mae_supported;
/* Firmware support for "FLAG" and "MARK" filter actions */
boolean_t enc_filter_action_flag_supported;
boolean_t enc_filter_action_mark_supported;
@@ -401,4 +401,10 @@
# endif
#endif /* EFSYS_OPT_DESC_PROXY */
+#if EFSYS_OPT_MAE
+# if !EFSYS_OPT_RIVERHEAD
+# error "MAE requires RIVERHEAD"
+# endif
+#endif /* EFSYS_OPT_MAE */
+
#endif /* _SYS_EFX_CHECK_H */
@@ -196,6 +196,8 @@ siena_board_cfg(
encp->enc_filter_action_mark_supported = B_FALSE;
encp->enc_filter_action_mark_max = 0;
+ encp->enc_mae_supported = B_FALSE;
+
return (0);
fail2:
@@ -167,6 +167,8 @@ prefetch_read_once(const volatile void *addr)
#define EFSYS_OPT_DESC_PROXY 0
+#define EFSYS_OPT_MAE 0
+
/* ID */
typedef struct __efsys_identifier_s efsys_identifier_t;