From patchwork Wed Sep 29 20:57:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 100022 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EA436A0032; Wed, 29 Sep 2021 22:57:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C85FE41101; Wed, 29 Sep 2021 22:57:47 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id EAC0E410EF for ; Wed, 29 Sep 2021 22:57:44 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.122.192]) (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 8215C7F6D0; Wed, 29 Sep 2021 23:57:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 8215C7F6D0 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1632949064; bh=Dgq79iVupfr6ns8tPilkD/wdMaP1Usb9Hsy0jj/AwgM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Cpy+0E/B9atYckHb6wPnNrSXMAWbAR+JRJh9G9Dfbvgx0FDH0T7uAlW8/iMRIxyB1 zy+DlOD4Ii5eeMrC4aE1hEeUVyMa9oWxlgN+bbO1MMsU9c5ABsW+TqYOmhPL/k9JBF bp5dId6xMKNu8GTvyGL9KjeArdfy6l6BUEljnTuU= From: Ivan Malov To: dev@dpdk.org Cc: Andrew Rybchenko , Ray Kinsella Date: Wed, 29 Sep 2021 23:57:22 +0300 Message-Id: <20210929205730.775-3-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210929205730.775-1-ivan.malov@oktetlabs.ru> References: <20210929205730.775-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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;