Skip to content

Commit 36fe3a6

Browse files
neocturnedavem330
authored andcommitted
vxlan: implement get_link_ksettings ethtool method
Similar to VLAN and similar drivers, we can forward get_link_ksettings to the lower dev if we have one to get meaningful speed/duplex data. Signed-off-by: Matthias Schiffer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 129bd7c commit 36fe3a6

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

drivers/net/vxlan.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3175,9 +3175,29 @@ static void vxlan_get_drvinfo(struct net_device *netdev,
31753175
strlcpy(drvinfo->driver, "vxlan", sizeof(drvinfo->driver));
31763176
}
31773177

3178+
static int vxlan_get_link_ksettings(struct net_device *dev,
3179+
struct ethtool_link_ksettings *cmd)
3180+
{
3181+
struct vxlan_dev *vxlan = netdev_priv(dev);
3182+
struct vxlan_rdst *dst = &vxlan->default_dst;
3183+
struct net_device *lowerdev = __dev_get_by_index(vxlan->net,
3184+
dst->remote_ifindex);
3185+
3186+
if (!lowerdev) {
3187+
cmd->base.duplex = DUPLEX_UNKNOWN;
3188+
cmd->base.port = PORT_OTHER;
3189+
cmd->base.speed = SPEED_UNKNOWN;
3190+
3191+
return 0;
3192+
}
3193+
3194+
return __ethtool_get_link_ksettings(lowerdev, cmd);
3195+
}
3196+
31783197
static const struct ethtool_ops vxlan_ethtool_ops = {
3179-
.get_drvinfo = vxlan_get_drvinfo,
3180-
.get_link = ethtool_op_get_link,
3198+
.get_drvinfo = vxlan_get_drvinfo,
3199+
.get_link = ethtool_op_get_link,
3200+
.get_link_ksettings = vxlan_get_link_ksettings,
31813201
};
31823202

31833203
static struct socket *vxlan_create_sock(struct net *net, bool ipv6,

0 commit comments

Comments
 (0)