Skip to content

Commit

Permalink
net/mlx5e: Use generic name for the forwarding dev pointer
Browse files Browse the repository at this point in the history
Rename tun_dev to fwd_dev within mlx5e_tc_update_priv struct
since future implementation may introduce other device types
which the handler is forwarding to.

Signed-off-by: Ariel Levkovich <lariel@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
Ariel Levkovich authored and Saeed Mahameed committed Oct 29, 2021
1 parent 28e7606 commit 189ce08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ static bool mlx5e_restore_tunnel(struct mlx5e_priv *priv, struct sk_buff *skb,
return false;
}

/* Set tun_dev so we do dev_put() after datapath */
tc_priv->tun_dev = dev;
/* Set fwd_dev so we do dev_put() after datapath */
tc_priv->fwd_dev = dev;

skb->dev = dev;

Expand Down Expand Up @@ -655,8 +655,8 @@ static bool mlx5e_restore_skb_chain(struct sk_buff *skb, u32 chain, u32 reg_c1,

static void mlx5_rep_tc_post_napi_receive(struct mlx5e_tc_update_priv *tc_priv)
{
if (tc_priv->tun_dev)
dev_put(tc_priv->tun_dev);
if (tc_priv->fwd_dev)
dev_put(tc_priv->fwd_dev);
}

static void mlx5e_restore_skb_sample(struct mlx5e_priv *priv, struct sk_buff *skb,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
int mlx5e_tc_num_filters(struct mlx5e_priv *priv, unsigned long flags);

struct mlx5e_tc_update_priv {
struct net_device *tun_dev;
struct net_device *fwd_dev;
};

struct mlx5_nic_flow_attr {
Expand Down

0 comments on commit 189ce08

Please sign in to comment.