aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOz Shlomo <ozsh@mellanox.com>2018-10-28 03:14:50 -0400
committerSaeed Mahameed <saeedm@mellanox.com>2018-12-10 18:53:04 -0500
commit71d82d2a90327c9c816e65471b7859b601993f89 (patch)
tree942d210581a1880dbcafa02772810377ee3c67d7
parentf5bc2c5de1015caf7e49b0bf9e7e97077736045a (diff)
net/mlx5e: Provide the TC filter netdev as parameter to flower callbacks
Currently the driver controls flower filters that are installed on its devices. However, with the introduction of the indirect block notifications platform the driver may receive control events for filters that are installed on higher level net devices (e.g. tunnel devices). Therefore, the driver filter control API will not be able to implicitly assume the filter's net device. Explicitly specify the filter's net device, no functional change Signed-off-by: Oz Shlomo <ozsh@mellanox.com> Reviewed-by: Eli Britstein <elibr@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_main.c9
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_rep.c9
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_tc.c6
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_tc.h6
4 files changed, 18 insertions, 12 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 06b1c0172a7b..88116a4750b0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3386,11 +3386,14 @@ static int mlx5e_setup_tc_cls_flower(struct mlx5e_priv *priv,
3386{ 3386{
3387 switch (cls_flower->command) { 3387 switch (cls_flower->command) {
3388 case TC_CLSFLOWER_REPLACE: 3388 case TC_CLSFLOWER_REPLACE:
3389 return mlx5e_configure_flower(priv, cls_flower, flags); 3389 return mlx5e_configure_flower(priv->netdev, priv, cls_flower,
3390 flags);
3390 case TC_CLSFLOWER_DESTROY: 3391 case TC_CLSFLOWER_DESTROY:
3391 return mlx5e_delete_flower(priv, cls_flower, flags); 3392 return mlx5e_delete_flower(priv->netdev, priv, cls_flower,
3393 flags);
3392 case TC_CLSFLOWER_STATS: 3394 case TC_CLSFLOWER_STATS:
3393 return mlx5e_stats_flower(priv, cls_flower, flags); 3395 return mlx5e_stats_flower(priv->netdev, priv, cls_flower,
3396 flags);
3394 default: 3397 default:
3395 return -EOPNOTSUPP; 3398 return -EOPNOTSUPP;
3396 } 3399 }
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 3aab3ce9119d..ab9c7ec77520 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -1007,11 +1007,14 @@ mlx5e_rep_setup_tc_cls_flower(struct mlx5e_priv *priv,
1007{ 1007{
1008 switch (cls_flower->command) { 1008 switch (cls_flower->command) {
1009 case TC_CLSFLOWER_REPLACE: 1009 case TC_CLSFLOWER_REPLACE:
1010 return mlx5e_configure_flower(priv, cls_flower, flags); 1010 return mlx5e_configure_flower(priv->netdev, priv, cls_flower,
1011 flags);
1011 case TC_CLSFLOWER_DESTROY: 1012 case TC_CLSFLOWER_DESTROY:
1012 return mlx5e_delete_flower(priv, cls_flower, flags); 1013 return mlx5e_delete_flower(priv->netdev, priv, cls_flower,
1014 flags);
1013 case TC_CLSFLOWER_STATS: 1015 case TC_CLSFLOWER_STATS:
1014 return mlx5e_stats_flower(priv, cls_flower, flags); 1016 return mlx5e_stats_flower(priv->netdev, priv, cls_flower,
1017 flags);
1015 default: 1018 default:
1016 return -EOPNOTSUPP; 1019 return -EOPNOTSUPP;
1017 } 1020 }
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index cb5bd3eaf738..b614513df127 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -3178,7 +3178,7 @@ mlx5e_tc_add_flow(struct mlx5e_priv *priv,
3178 return err; 3178 return err;
3179} 3179}
3180 3180
3181int mlx5e_configure_flower(struct mlx5e_priv *priv, 3181int mlx5e_configure_flower(struct net_device *dev, struct mlx5e_priv *priv,
3182 struct tc_cls_flower_offload *f, int flags) 3182 struct tc_cls_flower_offload *f, int flags)
3183{ 3183{
3184 struct netlink_ext_ack *extack = f->common.extack; 3184 struct netlink_ext_ack *extack = f->common.extack;
@@ -3224,7 +3224,7 @@ static bool same_flow_direction(struct mlx5e_tc_flow *flow, int flags)
3224 return false; 3224 return false;
3225} 3225}
3226 3226
3227int mlx5e_delete_flower(struct mlx5e_priv *priv, 3227int mlx5e_delete_flower(struct net_device *dev, struct mlx5e_priv *priv,
3228 struct tc_cls_flower_offload *f, int flags) 3228 struct tc_cls_flower_offload *f, int flags)
3229{ 3229{
3230 struct rhashtable *tc_ht = get_tc_ht(priv); 3230 struct rhashtable *tc_ht = get_tc_ht(priv);
@@ -3243,7 +3243,7 @@ int mlx5e_delete_flower(struct mlx5e_priv *priv,
3243 return 0; 3243 return 0;
3244} 3244}
3245 3245
3246int mlx5e_stats_flower(struct mlx5e_priv *priv, 3246int mlx5e_stats_flower(struct net_device *dev, struct mlx5e_priv *priv,
3247 struct tc_cls_flower_offload *f, int flags) 3247 struct tc_cls_flower_offload *f, int flags)
3248{ 3248{
3249 struct rhashtable *tc_ht = get_tc_ht(priv); 3249 struct rhashtable *tc_ht = get_tc_ht(priv);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.h b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
index 378507988a32..004e679a4f53 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.h
@@ -51,12 +51,12 @@ void mlx5e_tc_nic_cleanup(struct mlx5e_priv *priv);
51int mlx5e_tc_esw_init(struct rhashtable *tc_ht); 51int mlx5e_tc_esw_init(struct rhashtable *tc_ht);
52void mlx5e_tc_esw_cleanup(struct rhashtable *tc_ht); 52void mlx5e_tc_esw_cleanup(struct rhashtable *tc_ht);
53 53
54int mlx5e_configure_flower(struct mlx5e_priv *priv, 54int mlx5e_configure_flower(struct net_device *dev, struct mlx5e_priv *priv,
55 struct tc_cls_flower_offload *f, int flags); 55 struct tc_cls_flower_offload *f, int flags);
56int mlx5e_delete_flower(struct mlx5e_priv *priv, 56int mlx5e_delete_flower(struct net_device *dev, struct mlx5e_priv *priv,
57 struct tc_cls_flower_offload *f, int flags); 57 struct tc_cls_flower_offload *f, int flags);
58 58
59int mlx5e_stats_flower(struct mlx5e_priv *priv, 59int mlx5e_stats_flower(struct net_device *dev, struct mlx5e_priv *priv,
60 struct tc_cls_flower_offload *f, int flags); 60 struct tc_cls_flower_offload *f, int flags);
61 61
62struct mlx5e_encap_entry; 62struct mlx5e_encap_entry;