net/sfc/base: support drop filters on EF10 family NICs
authorRoman Zhukov <roman.zhukov@oktetlabs.ru>
Tue, 27 Feb 2018 13:11:18 +0000 (13:11 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:43 +0000 (14:08 +0200)
Add support for filters which drop packets when forming MCDI request
for a filter.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
drivers/net/sfc/base/ef10_filter.c

index a627cce..bf4992e 100644 (file)
@@ -211,10 +211,15 @@ efx_mcdi_filter_op_add(
            EVB_PORT_ID_ASSIGNED);
        MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_MATCH_FIELDS,
            match_flags);
-       MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_DEST,
-           MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST);
-       MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_QUEUE,
-           spec->efs_dmaq_id);
+       if (spec->efs_dmaq_id == EFX_FILTER_SPEC_RX_DMAQ_ID_DROP) {
+               MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_DEST,
+                   MC_CMD_FILTER_OP_EXT_IN_RX_DEST_DROP);
+       } else {
+               MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_DEST,
+                   MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST);
+               MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_QUEUE,
+                   spec->efs_dmaq_id);
+       }
 
 #if EFSYS_OPT_RX_SCALE
        if (spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) {