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 A0740A0C41; Tue, 5 Oct 2021 01:56:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9575441276; Tue, 5 Oct 2021 01:56:14 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id E9A7040688 for ; Tue, 5 Oct 2021 01:56:11 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.120.137]) (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 9255C7F6CD; Tue, 5 Oct 2021 02:56:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 9255C7F6CD DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1633391771; bh=iwLXxS5JZQtZFz2Na2pqwLB8P1V+vkoKTbSzXMef8BA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RVY1uC/xgUAnwd2RfKWqd0wON8cSgRw78jNGD7KI4QLCirP526gKyStnbBe8xM/pL yh0L70dlSXK7h8qEgYmNK6Px8bIW/qn1UuEu2H+M022DRISBPyq6QMRrqMSlxkgDeW /mU/vs2f/FNiGysJYFBC71xH6iLWhuQHSZImp61w= From: Ivan Malov To: dev@dpdk.org Cc: Andrew Rybchenko , Ray Kinsella Date: Tue, 5 Oct 2021 02:55:50 +0300 Message-Id: <20211004235558.14593-3-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211004235558.14593-1-ivan.malov@oktetlabs.ru> References: <20210929205730.775-1-ivan.malov@oktetlabs.ru> <20211004235558.14593-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 02/10] common/sfc_efx/base: add API to set RECIRC 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 bed1029f59..ca747de7a4 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -4385,6 +4385,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 992edbabe3..45dc7803db 100644 --- a/drivers/common/sfc_efx/base/efx_impl.h +++ b/drivers/common/sfc_efx/base/efx_impl.h @@ -1727,6 +1727,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 c22206e227..c37e90831f 100644 --- a/drivers/common/sfc_efx/base/efx_mae.c +++ b/drivers/common/sfc_efx/base/efx_mae.c @@ -1945,6 +1945,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); @@ -2023,6 +2044,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 0c5bcdfa84..d4878dfb9a 100644 --- a/drivers/common/sfc_efx/version.map +++ b/drivers/common/sfc_efx/version.map @@ -127,6 +127,7 @@ INTERNAL { efx_mae_mport_by_pcie_function; efx_mae_mport_by_phy_port; efx_mae_outer_rule_insert; + efx_mae_outer_rule_recirc_id_set; efx_mae_outer_rule_remove; efx_mcdi_fini; -- 2.20.1