common/sfc_efx/base: use EF10 filter methods for Riverhead
authorAndrew Rybchenko <arybchenko@solarflare.com>
Thu, 24 Sep 2020 12:11:51 +0000 (13:11 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:12 +0000 (19:19 +0200)
Filtering MCDI on Riverhead are the same as on EF10.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
drivers/common/sfc_efx/base/ef10_filter.c
drivers/common/sfc_efx/base/efx_filter.c
drivers/common/sfc_efx/base/efx_impl.h

index 12c84a5..51e6f1a 100644 (file)
@@ -7,7 +7,7 @@
 #include "efx.h"
 #include "efx_impl.h"
 
-#if EFX_OPTS_EF10()
+#if EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10()
 
 #if EFSYS_OPT_FILTER
 
@@ -94,7 +94,7 @@ ef10_filter_init(
        efx_rc_t rc;
        ef10_filter_table_t *eftp;
 
-       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF100(enp) || EFX_FAMILY_IS_EF10(enp));
 
 #define        MATCH_MASK(match) (EFX_MASK32(match) << EFX_LOW_BIT(match))
        EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_HOST ==
@@ -152,7 +152,7 @@ fail1:
 ef10_filter_fini(
        __in            efx_nic_t *enp)
 {
-       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF100(enp) || EFX_FAMILY_IS_EF10(enp));
 
        if (enp->en_filter.ef_ef10_filter_table != NULL) {
                EFSYS_KMEM_FREE(enp->en_esip, sizeof (ef10_filter_table_t),
@@ -540,7 +540,7 @@ ef10_filter_restore(
        efsys_lock_state_t state;
        efx_rc_t rc;
 
-       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF100(enp) || EFX_FAMILY_IS_EF10(enp));
 
        for (tbl_id = 0; tbl_id < EFX_EF10_FILTER_TBL_ROWS; tbl_id++) {
 
@@ -839,7 +839,7 @@ ef10_filter_add_internal(
        efsys_lock_state_t state;
        boolean_t locked = B_FALSE;
 
-       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF100(enp) || EFX_FAMILY_IS_EF10(enp));
 
        EFSYS_ASSERT(spec->efs_overridden_spec == NULL);
 
@@ -1149,7 +1149,7 @@ ef10_filter_delete(
        efsys_lock_state_t state;
        boolean_t locked = B_FALSE;
 
-       EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
+       EFSYS_ASSERT(EFX_FAMILY_IS_EF100(enp) || EFX_FAMILY_IS_EF10(enp));
 
        hash = ef10_filter_hash(spec);
 
@@ -2138,4 +2138,4 @@ ef10_filter_default_rxq_clear(
 
 #endif /* EFSYS_OPT_FILTER */
 
-#endif /* EFX_OPTS_EF10() */
+#endif /* EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10() */
index 3310b73..9b4cd08 100644 (file)
@@ -68,6 +68,18 @@ static const efx_filter_ops_t        __efx_filter_ef10_ops = {
 };
 #endif /* EFX_OPTS_EF10() */
 
+#if EFSYS_OPT_RIVERHEAD
+static const efx_filter_ops_t  __efx_filter_rhead_ops = {
+       ef10_filter_init,               /* efo_init */
+       ef10_filter_fini,               /* efo_fini */
+       ef10_filter_restore,            /* efo_restore */
+       ef10_filter_add,                /* efo_add */
+       ef10_filter_delete,             /* efo_delete */
+       ef10_filter_supported_filters,  /* efo_supported_filters */
+       ef10_filter_reconfigure,        /* efo_reconfigure */
+};
+#endif /* EFSYS_OPT_RIVERHEAD */
+
        __checkReturn   efx_rc_t
 efx_filter_insert(
        __in            efx_nic_t *enp,
@@ -180,6 +192,12 @@ efx_filter_init(
                break;
 #endif /* EFSYS_OPT_MEDFORD2 */
 
+#if EFSYS_OPT_RIVERHEAD
+       case EFX_FAMILY_RIVERHEAD:
+               efop = &__efx_filter_rhead_ops;
+               break;
+#endif /* EFSYS_OPT_RIVERHEAD */
+
        default:
                EFSYS_ASSERT(0);
                rc = ENOTSUP;
index b41b0e5..cc34a05 100644 (file)
@@ -465,9 +465,9 @@ typedef struct efx_filter_s {
 #if EFSYS_OPT_SIENA
        siena_filter_t          *ef_siena_filter;
 #endif /* EFSYS_OPT_SIENA */
-#if EFX_OPTS_EF10()
+#if EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10()
        ef10_filter_table_t     *ef_ef10_filter_table;
-#endif /* EFX_OPTS_EF10() */
+#endif /* EFSYS_OPT_RIVERHEAD || EFX_OPTS_EF10() */
 } efx_filter_t;
 
 #if EFSYS_OPT_SIENA