Commit a62fdbbe authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

netdevsim: implement ndo_get_devlink_port

Implement ndo_get_devlink_port and allow switch_id and port_name to be
handled by devlink.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e05b2d14
......@@ -245,6 +245,13 @@ nsim_set_features(struct net_device *dev, netdev_features_t features)
return 0;
}
static struct devlink_port *nsim_get_devlink_port(struct net_device *dev)
{
struct netdevsim *ns = netdev_priv(dev);
return &ns->nsim_dev_port->devlink_port;
}
static const struct net_device_ops nsim_netdev_ops = {
.ndo_start_xmit = nsim_start_xmit,
.ndo_set_rx_mode = nsim_set_rx_mode,
......@@ -263,6 +270,7 @@ static const struct net_device_ops nsim_netdev_ops = {
.ndo_setup_tc = nsim_setup_tc,
.ndo_set_features = nsim_set_features,
.ndo_bpf = nsim_bpf,
.ndo_get_devlink_port = nsim_get_devlink_port,
};
static void nsim_setup(struct net_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment