Skip to content

Commit 4a25730

Browse files
hadarhenziondavem330
authored andcommitted
net/mlx5e: Add ndo_udp_tunnel_add to VF representors
By implementing this ndo, the host stack will set the vxlan udp port also to VF representor netdevices. This will allow the TC offload code in the driver when it gets a tunnel key set action to identify the UDP port as vxlan, and hence the rule will be a candidate for offloading. Signed-off-by: Hadar Hen Zion <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bbd00f7 commit 4a25730

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,5 +893,9 @@ void mlx5e_detach_netdev(struct mlx5_core_dev *mdev, struct net_device *netdev);
893893
struct rtnl_link_stats64 *
894894
mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats);
895895
u32 mlx5e_choose_lro_timeout(struct mlx5_core_dev *mdev, u32 wanted_timeout);
896+
void mlx5e_add_vxlan_port(struct net_device *netdev,
897+
struct udp_tunnel_info *ti);
898+
void mlx5e_del_vxlan_port(struct net_device *netdev,
899+
struct udp_tunnel_info *ti);
896900

897901
#endif /* __MLX5_EN_H__ */

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2995,8 +2995,8 @@ static int mlx5e_get_vf_stats(struct net_device *dev,
29952995
vf_stats);
29962996
}
29972997

2998-
static void mlx5e_add_vxlan_port(struct net_device *netdev,
2999-
struct udp_tunnel_info *ti)
2998+
void mlx5e_add_vxlan_port(struct net_device *netdev,
2999+
struct udp_tunnel_info *ti)
30003000
{
30013001
struct mlx5e_priv *priv = netdev_priv(netdev);
30023002

@@ -3009,8 +3009,8 @@ static void mlx5e_add_vxlan_port(struct net_device *netdev,
30093009
mlx5e_vxlan_queue_work(priv, ti->sa_family, be16_to_cpu(ti->port), 1);
30103010
}
30113011

3012-
static void mlx5e_del_vxlan_port(struct net_device *netdev,
3013-
struct udp_tunnel_info *ti)
3012+
void mlx5e_del_vxlan_port(struct net_device *netdev,
3013+
struct udp_tunnel_info *ti)
30143014
{
30153015
struct mlx5e_priv *priv = netdev_priv(netdev);
30163016

drivers/net/ethernet/mellanox/mlx5/core/en_rep.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ static const struct net_device_ops mlx5e_netdev_ops_rep = {
256256
.ndo_get_phys_port_name = mlx5e_rep_get_phys_port_name,
257257
.ndo_setup_tc = mlx5e_rep_ndo_setup_tc,
258258
.ndo_get_stats64 = mlx5e_get_stats,
259+
.ndo_udp_tunnel_add = mlx5e_add_vxlan_port,
260+
.ndo_udp_tunnel_del = mlx5e_del_vxlan_port,
259261
};
260262

261263
static void mlx5e_build_rep_netdev_priv(struct mlx5_core_dev *mdev,

0 commit comments

Comments
 (0)