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 989DFA0547; Fri, 12 Mar 2021 12:08:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2700A1608A5; Fri, 12 Mar 2021 12:07:56 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 016D34067E for ; Fri, 12 Mar 2021 12:07:49 +0100 (CET) Received: from localhost.localdomain (unknown [188.242.7.54]) (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 B365F7F5B3; Fri, 12 Mar 2021 14:07:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru B365F7F5B3 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1615547268; bh=B+EfaYfS/EkgWEFMcaSOjKk6Pki4UHrjU8rMr1R2jjM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CaCtiWihmGAIPM7Zyb02NGvhxYpcOqRTNiQfVhitxcWkBWsPzgYKVi/Xp8N5mY69o ddPLD0oSP+dVShpUkv1QTIquMZ6J3bdN4nQtsrTX2EWRwUYSeTMJAgc6guzFJBtrDc 1OKy3bZbLGliMZmGgTz0uoVC4HQikY8tKa4KcvQc= From: Ivan Malov To: dev@dpdk.org Cc: Igor Romanov , Andrew Rybchenko , Andy Moreton Date: Fri, 12 Mar 2021 14:07:42 +0300 Message-Id: <20210312110745.31721-7-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210312110745.31721-1-ivan.malov@oktetlabs.ru> References: <20210312093143.28186-1-ivan.malov@oktetlabs.ru> <20210312110745.31721-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 07/10] net/sfc: change MAE rule actions parse API 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 Current API signature makes it hard to add other entities that belong to a flow specification. Pass the flow specification so that additional members can be accessed through the spec. Signed-off-by: Igor Romanov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton Reviewed-by: Ivan Malov --- drivers/net/sfc/sfc_flow.c | 3 +-- drivers/net/sfc/sfc_mae.c | 8 ++++---- drivers/net/sfc/sfc_mae.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c index ab1d2cc59..2c78473b5 100644 --- a/drivers/net/sfc/sfc_flow.c +++ b/drivers/net/sfc/sfc_flow.c @@ -2440,8 +2440,7 @@ sfc_flow_parse_rte_to_mae(struct rte_eth_dev *dev, if (rc != 0) return rc; - rc = sfc_mae_rule_parse_actions(sa, actions, &spec_mae->action_set, - error); + rc = sfc_mae_rule_parse_actions(sa, actions, spec_mae, error); if (rc != 0) return rc; diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index 15c5c3975..50efd47ad 100644 --- a/drivers/net/sfc/sfc_mae.c +++ b/drivers/net/sfc/sfc_mae.c @@ -2093,7 +2093,7 @@ sfc_mae_rule_parse_action(struct sfc_adapter *sa, int sfc_mae_rule_parse_actions(struct sfc_adapter *sa, const struct rte_flow_action actions[], - struct sfc_mae_action_set **action_setp, + struct sfc_flow_spec_mae *spec_mae, struct rte_flow_error *error) { struct sfc_mae_actions_bundle bundle = {0}; @@ -2127,13 +2127,13 @@ sfc_mae_rule_parse_actions(struct sfc_adapter *sa, if (rc != 0) goto fail_rule_parse_action; - *action_setp = sfc_mae_action_set_attach(sa, spec); - if (*action_setp != NULL) { + spec_mae->action_set = sfc_mae_action_set_attach(sa, spec); + if (spec_mae->action_set != NULL) { efx_mae_action_set_spec_fini(sa->nic, spec); return 0; } - rc = sfc_mae_action_set_add(sa, spec, action_setp); + rc = sfc_mae_action_set_add(sa, spec, &spec_mae->action_set); if (rc != 0) goto fail_action_set_add; diff --git a/drivers/net/sfc/sfc_mae.h b/drivers/net/sfc/sfc_mae.h index bf432638c..00987af61 100644 --- a/drivers/net/sfc/sfc_mae.h +++ b/drivers/net/sfc/sfc_mae.h @@ -197,7 +197,7 @@ int sfc_mae_rule_parse_pattern(struct sfc_adapter *sa, struct rte_flow_error *error); int sfc_mae_rule_parse_actions(struct sfc_adapter *sa, const struct rte_flow_action actions[], - struct sfc_mae_action_set **action_setp, + struct sfc_flow_spec_mae *spec_mae, struct rte_flow_error *error); sfc_flow_verify_cb_t sfc_mae_flow_verify; sfc_flow_insert_cb_t sfc_mae_flow_insert; -- 2.20.1