common/sfc_efx/base: indicate support for MAE
authorIvan Malov <ivan.malov@oktetlabs.ru>
Tue, 20 Oct 2020 09:12:42 +0000 (10:12 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 22:24:24 +0000 (23:24 +0100)
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
drivers/common/sfc_efx/base/efx.h
drivers/common/sfc_efx/base/efx_check.h
drivers/common/sfc_efx/base/siena_nic.c
drivers/common/sfc_efx/efsys.h

index df7db6a..68414d9 100644 (file)
@@ -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);
 
index bd1ac30..9947882 100644 (file)
@@ -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;
index 8f42d87..078e5b9 100644 (file)
 # 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 */
index 4137c1e..e2af0ff 100644 (file)
@@ -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:
index f7d5f8a..8636e73 100644 (file)
@@ -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;