]> www.infradead.org Git - users/willy/xarray.git/commitdiff
net/mlx5e: Remove redundant parse_attr arg
authorRoi Dayan <roid@nvidia.com>
Mon, 26 Jul 2021 12:11:43 +0000 (15:11 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 3 Aug 2021 02:26:28 +0000 (19:26 -0700)
Passing parse_attr is redundant in parse_tc_nic_actions() and
mlx5e_tc_add_nic_flow() as we can get it from flow.
This is the same as with parse_tc_fdb_actions() and mlx5e_tc_add_fdb_flow().

Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

index 3453f37a0741c905a35b7a4e4e42dd2e563fcff4..472c0c756a69280b41b40b377f9cf8824c05f6bc 100644 (file)
@@ -1031,15 +1031,17 @@ err_ft_get:
 
 static int
 mlx5e_tc_add_nic_flow(struct mlx5e_priv *priv,
-                     struct mlx5e_tc_flow_parse_attr *parse_attr,
                      struct mlx5e_tc_flow *flow,
                      struct netlink_ext_ack *extack)
 {
+       struct mlx5e_tc_flow_parse_attr *parse_attr;
        struct mlx5_flow_attr *attr = flow->attr;
        struct mlx5_core_dev *dev = priv->mdev;
        struct mlx5_fc *counter = NULL;
        int err;
 
+       parse_attr = attr->parse_attr;
+
        if (flow_flag_test(flow, HAIRPIN)) {
                err = mlx5e_hairpin_flow_add(priv, flow, parse_attr, extack);
                if (err)
@@ -3327,10 +3329,10 @@ static int validate_goto_chain(struct mlx5e_priv *priv,
 
 static int parse_tc_nic_actions(struct mlx5e_priv *priv,
                                struct flow_action *flow_action,
-                               struct mlx5e_tc_flow_parse_attr *parse_attr,
                                struct mlx5e_tc_flow *flow,
                                struct netlink_ext_ack *extack)
 {
+       struct mlx5e_tc_flow_parse_attr *parse_attr;
        struct mlx5_flow_attr *attr = flow->attr;
        struct pedit_headers_action hdrs[2] = {};
        const struct flow_action_entry *act;
@@ -3346,8 +3348,8 @@ static int parse_tc_nic_actions(struct mlx5e_priv *priv,
                return -EOPNOTSUPP;
 
        nic_attr = attr->nic_attr;
-
        nic_attr->flow_tag = MLX5_FS_DEFAULT_FLOW_TAG;
+       parse_attr = attr->parse_attr;
 
        flow_action_for_each(i, act, flow_action) {
                switch (act->id) {
@@ -4418,11 +4420,11 @@ mlx5e_add_nic_flow(struct mlx5e_priv *priv,
        if (err)
                goto err_free;
 
-       err = parse_tc_nic_actions(priv, &rule->action, parse_attr, flow, extack);
+       err = parse_tc_nic_actions(priv, &rule->action, flow, extack);
        if (err)
                goto err_free;
 
-       err = mlx5e_tc_add_nic_flow(priv, parse_attr, flow, extack);
+       err = mlx5e_tc_add_nic_flow(priv, flow, extack);
        if (err)
                goto err_free;