From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 16293A0C43; Fri, 27 Aug 2021 08:59:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15E1D4128F; Fri, 27 Aug 2021 08:58:11 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id EDFE34128A for ; Fri, 27 Aug 2021 08:58:07 +0200 (CEST) Received: by shelob.oktetlabs.ru (Postfix, from userid 122) id B88BF7F6D6; Fri, 27 Aug 2021 09:58:07 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shelob.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17]) by shelob.oktetlabs.ru (Postfix) with ESMTP id 188C07F6DD; Fri, 27 Aug 2021 09:57:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 188C07F6DD Authentication-Results: shelob.oktetlabs.ru/188C07F6DD; dkim=none; dkim-atps=neutral From: Andrew Rybchenko To: dev@dpdk.org Cc: Igor Romanov , Andy Moreton , Ivan Malov Date: Fri, 27 Aug 2021 09:56:51 +0300 Message-Id: <20210827065717.1838258-13-andrew.rybchenko@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210827065717.1838258-1-andrew.rybchenko@oktetlabs.ru> References: <20210827065717.1838258-1-andrew.rybchenko@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 12/38] common/sfc_efx/base: add filter ingress mport matching field X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Igor Romanov The field changes the mport for which the filter is created. It is required to filter traffic from VF on an alias mport. Signed-off-by: Igor Romanov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton Reviewed-by: Ivan Malov --- drivers/common/sfc_efx/base/ef10_filter.c | 11 +++++++++-- drivers/common/sfc_efx/base/efx.h | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/common/sfc_efx/base/ef10_filter.c b/drivers/common/sfc_efx/base/ef10_filter.c index ac6006c9b4..6d19797d16 100644 --- a/drivers/common/sfc_efx/base/ef10_filter.c +++ b/drivers/common/sfc_efx/base/ef10_filter.c @@ -171,6 +171,7 @@ efx_mcdi_filter_op_add( EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FILTER_OP_V3_IN_LEN, MC_CMD_FILTER_OP_EXT_OUT_LEN); efx_filter_match_flags_t match_flags; + uint32_t port_id; efx_rc_t rc; req.emr_cmd = MC_CMD_FILTER_OP; @@ -180,10 +181,11 @@ efx_mcdi_filter_op_add( req.emr_out_length = MC_CMD_FILTER_OP_EXT_OUT_LEN; /* - * Remove match flag for encapsulated filters that does not correspond + * Remove EFX match flags that do not correspond * to the MCDI match flags */ match_flags = spec->efs_match_flags & ~EFX_FILTER_MATCH_ENCAP_TYPE; + match_flags &= ~EFX_FILTER_MATCH_MPORT; switch (filter_op) { case MC_CMD_FILTER_OP_IN_OP_REPLACE: @@ -202,7 +204,12 @@ efx_mcdi_filter_op_add( goto fail1; } - MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_PORT_ID, enp->en_vport_id); + if (spec->efs_match_flags & EFX_FILTER_MATCH_MPORT) + port_id = spec->efs_ingress_mport; + else + port_id = enp->en_vport_id; + + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_PORT_ID, port_id); MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_MATCH_FIELDS, match_flags); if (spec->efs_dmaq_id == EFX_FILTER_SPEC_RX_DMAQ_ID_DROP) { diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index c0d1535017..7f04b42bae 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -3389,6 +3389,8 @@ typedef uint8_t efx_filter_flags_t; #define EFX_FILTER_MATCH_OUTER_VID 0x00000100 /* Match by IP transport protocol */ #define EFX_FILTER_MATCH_IP_PROTO 0x00000200 +/* Match by ingress MPORT */ +#define EFX_FILTER_MATCH_MPORT 0x00000400 /* Match by VNI or VSID */ #define EFX_FILTER_MATCH_VNI_OR_VSID 0x00000800 /* For encapsulated packets, match by inner frame local MAC address */ @@ -3451,6 +3453,7 @@ typedef struct efx_filter_spec_s { efx_oword_t efs_loc_host; uint8_t efs_vni_or_vsid[EFX_VNI_OR_VSID_LEN]; uint8_t efs_ifrm_loc_mac[EFX_MAC_ADDR_LEN]; + uint32_t efs_ingress_mport; } efx_filter_spec_t; -- 2.30.2