common/sfc_efx/base: add API for adding action drop
authorIvan Malov <ivan.malov@oktetlabs.ru>
Tue, 20 Oct 2020 09:13:18 +0000 (10:13 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 22:24:25 +0000 (23:24 +0100)
Client drivers may need to request that matching traffic be dropped.
Add a dedicated API to support this. The API relies on action
DELIVER with properly constructed NULL MPORT argument.

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/efx.h
drivers/common/sfc_efx/base/efx_mae.c
drivers/common/sfc_efx/version.map

index 96ea93f..4a4dc8b 100644 (file)
@@ -4211,6 +4211,11 @@ efx_mae_action_set_populate_deliver(
        __in                            efx_mae_actions_t *spec,
        __in                            const efx_mport_sel_t *mportp);
 
+LIBEFX_API
+extern __checkReturn                   efx_rc_t
+efx_mae_action_set_populate_drop(
+       __in                            efx_mae_actions_t *spec);
+
 LIBEFX_API
 extern __checkReturn                   boolean_t
 efx_mae_action_set_specs_equal(
index 7acb964..4b56911 100644 (file)
@@ -1028,6 +1028,25 @@ fail1:
        return (rc);
 }
 
+       __checkReturn                   efx_rc_t
+efx_mae_action_set_populate_drop(
+       __in                            efx_mae_actions_t *spec)
+{
+       efx_mport_sel_t mport;
+       const uint8_t *arg;
+       efx_dword_t dword;
+
+       EFX_POPULATE_DWORD_1(dword,
+           MAE_MPORT_SELECTOR_FLAT, MAE_MPORT_SELECTOR_NULL);
+
+       mport.sel = dword.ed_u32[0];
+
+       arg = (const uint8_t *)&mport.sel;
+
+       return (efx_mae_action_set_spec_populate(spec,
+           EFX_MAE_ACTION_DELIVER, sizeof (mport.sel), arg));
+}
+
        __checkReturn                   boolean_t
 efx_mae_action_set_specs_equal(
        __in                            const efx_mae_actions_t *left,
index cb92955..7cc692d 100644 (file)
@@ -90,6 +90,7 @@ INTERNAL {
        efx_mae_action_set_alloc;
        efx_mae_action_set_free;
        efx_mae_action_set_populate_deliver;
+       efx_mae_action_set_populate_drop;
        efx_mae_action_set_populate_flag;
        efx_mae_action_set_populate_mark;
        efx_mae_action_set_populate_vlan_pop;