From: Igor Romanov Date: Fri, 12 Mar 2021 11:07:42 +0000 (+0300) Subject: net/sfc: change MAE rule actions parsing parameter X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=923a96b844cdfe4663b1a60d9b53cc90c4f28305;p=dpdk.git net/sfc: change MAE rule actions parsing parameter 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 --- diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c index 9cb7ade9db..848669cb8e 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 32b88f92e0..bbf328b2cb 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 aa1b63bd84..379055b87a 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;