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 1B1F8A0C55; Wed, 13 Oct 2021 15:15:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B6E97411D9; Wed, 13 Oct 2021 15:15:30 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 2FAEE40E64 for ; Wed, 13 Oct 2021 15:15:28 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.123.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id BB12D7F6F4; Wed, 13 Oct 2021 16:15:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru BB12D7F6F4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1634130927; bh=A9APtQ9QH+g1KNF+bRbYqi6OP4rqUjfPGxeg8kMEORo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nX/xK5xAzwnDmJ5IyLINeKenICRPpwXhuLPBfPitB5GXA29izW3wvvDoM6Xr3Cx2E mWZ8WTsj0fDYj+4m0apd7vFhk5y4C4Q5oeFKN4eVOLlzUB0OAoZMOYcgaYUR5RTnFn tpuzLWlVZQbpvIpKGZMW9Ex0C5ZCtM5LvA2c1Q3g= From: Ivan Malov To: dev@dpdk.org Cc: Ferruh Yigit , Andrew Rybchenko , Ray Kinsella Date: Wed, 13 Oct 2021 16:15:05 +0300 Message-Id: <20211013131514.20376-3-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211013131514.20376-1-ivan.malov@oktetlabs.ru> References: <20210929205730.775-1-ivan.malov@oktetlabs.ru> <20211013131514.20376-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 02/10] common/sfc_efx/base: support recirculation ID in outer rules 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" When an outer rule is hit, it can pass recirculation ID down to action rule lookup, and action rules can match on this ID instead of matching on the outer rule allocation handle. By default, recirculation ID is assumed to be zero. Add an API to set recirculation ID in outer rules. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Acked-by: Ray Kinsella --- drivers/common/sfc_efx/base/efx.h | 9 +++++++++ drivers/common/sfc_efx/base/efx_impl.h | 1 + drivers/common/sfc_efx/base/efx_mae.c | 24 ++++++++++++++++++++++++ drivers/common/sfc_efx/version.map | 1 + 4 files changed, 35 insertions(+) diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index e05261218b..c835b6749c 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -4507,6 +4507,15 @@ typedef struct efx_mae_rule_id_s { uint32_t id; } efx_mae_rule_id_t; +/* + * Set the initial recirculation ID. It goes to action rule (AR) lookup. + */ +LIBEFX_API +extern __checkReturn efx_rc_t +efx_mae_outer_rule_recirc_id_set( + __in efx_mae_match_spec_t *spec, + __in uint8_t recirc_id); + LIBEFX_API extern __checkReturn efx_rc_t efx_mae_outer_rule_insert( diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h index e0efbb8cdd..5dcdb9c78d 100644 --- a/drivers/common/sfc_efx/base/efx_impl.h +++ b/drivers/common/sfc_efx/base/efx_impl.h @@ -1733,6 +1733,7 @@ struct efx_mae_match_spec_s { MAE_FIELD_MASK_VALUE_PAIRS_V2_LEN]; uint8_t outer[MAE_ENC_FIELD_PAIRS_LEN]; } emms_mask_value_pairs; + uint8_t emms_outer_rule_recirc_id; }; typedef enum efx_mae_action_e { diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c index 110addd92d..d87949a6c5 100644 --- a/drivers/common/sfc_efx/base/efx_mae.c +++ b/drivers/common/sfc_efx/base/efx_mae.c @@ -2111,6 +2111,27 @@ efx_mae_match_specs_class_cmp( fail2: EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} + + __checkReturn efx_rc_t +efx_mae_outer_rule_recirc_id_set( + __in efx_mae_match_spec_t *spec, + __in uint8_t recirc_id) +{ + efx_rc_t rc; + + if (spec->emms_type != EFX_MAE_RULE_OUTER) { + rc = EINVAL; + goto fail1; + } + + spec->emms_outer_rule_recirc_id = recirc_id; + + return (0); + fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); @@ -2189,6 +2210,9 @@ efx_mae_outer_rule_insert( memcpy(payload + offset, spec->emms_mask_value_pairs.outer, MAE_ENC_FIELD_PAIRS_LEN); + MCDI_IN_SET_BYTE(req, MAE_OUTER_RULE_INSERT_IN_RECIRC_ID, + spec->emms_outer_rule_recirc_id); + efx_mcdi_execute(enp, &req); if (req.emr_rc != 0) { diff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map index 346deb4b12..e728ea3e02 100644 --- a/drivers/common/sfc_efx/version.map +++ b/drivers/common/sfc_efx/version.map @@ -132,6 +132,7 @@ INTERNAL { efx_mae_mport_id_by_selector; efx_mae_mport_invalid; efx_mae_outer_rule_insert; + efx_mae_outer_rule_recirc_id_set; efx_mae_outer_rule_remove; efx_mae_read_mport_journal; -- 2.20.1