提交 07810152 编写于 作者: V Vlad Buslov 提交者: Saeed Mahameed

net/mlx5e: Refactor mlx5e_eswitch_{*}rep() helpers

Change the helper to functions to accept constant pointer to struct
net_device. This is necessary for following patches in series that pass
mlx5e_eswitch_rep() as a callback to kernel bridge infrastructure code.
Signed-off-by: NVlad Buslov <vladbu@nvidia.com>
Reviewed-by: NJianbo Liu <jianbol@nvidia.com>
Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
上级 ec3be887
...@@ -536,13 +536,13 @@ static const struct net_device_ops mlx5e_netdev_ops_rep = { ...@@ -536,13 +536,13 @@ static const struct net_device_ops mlx5e_netdev_ops_rep = {
.ndo_change_carrier = mlx5e_rep_change_carrier, .ndo_change_carrier = mlx5e_rep_change_carrier,
}; };
bool mlx5e_eswitch_uplink_rep(struct net_device *netdev) bool mlx5e_eswitch_uplink_rep(const struct net_device *netdev)
{ {
return netdev->netdev_ops == &mlx5e_netdev_ops && return netdev->netdev_ops == &mlx5e_netdev_ops &&
mlx5e_is_uplink_rep(netdev_priv(netdev)); mlx5e_is_uplink_rep(netdev_priv(netdev));
} }
bool mlx5e_eswitch_vf_rep(struct net_device *netdev) bool mlx5e_eswitch_vf_rep(const struct net_device *netdev)
{ {
return netdev->netdev_ops == &mlx5e_netdev_ops_rep; return netdev->netdev_ops == &mlx5e_netdev_ops_rep;
} }
......
...@@ -231,9 +231,9 @@ void mlx5e_remove_sqs_fwd_rules(struct mlx5e_priv *priv); ...@@ -231,9 +231,9 @@ void mlx5e_remove_sqs_fwd_rules(struct mlx5e_priv *priv);
void mlx5e_rep_queue_neigh_stats_work(struct mlx5e_priv *priv); void mlx5e_rep_queue_neigh_stats_work(struct mlx5e_priv *priv);
bool mlx5e_eswitch_vf_rep(struct net_device *netdev); bool mlx5e_eswitch_vf_rep(const struct net_device *netdev);
bool mlx5e_eswitch_uplink_rep(struct net_device *netdev); bool mlx5e_eswitch_uplink_rep(const struct net_device *netdev);
static inline bool mlx5e_eswitch_rep(struct net_device *netdev) static inline bool mlx5e_eswitch_rep(const struct net_device *netdev)
{ {
return mlx5e_eswitch_vf_rep(netdev) || return mlx5e_eswitch_vf_rep(netdev) ||
mlx5e_eswitch_uplink_rep(netdev); mlx5e_eswitch_uplink_rep(netdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册