Skip to content

Commit ac019f0

Browse files
sf-hgkdavem330
authored andcommitted
sfc: implement ndo_get_phys_port_name
Output is of the form p<port-number>. Note that the port numbers don't necessarily map one-to-one to physical cages, partly because of 4x10G port modes on QSFP+ and partly because of hw/fw implementation details. Signed-off-by: Edward Cree <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 08a7b29 commit ac019f0

File tree

1 file changed

+11
-0
lines changed
  • drivers/net/ethernet/sfc

1 file changed

+11
-0
lines changed

drivers/net/ethernet/sfc/efx.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,6 +2345,16 @@ int efx_get_phys_port_id(struct net_device *net_dev,
23452345
return -EOPNOTSUPP;
23462346
}
23472347

2348+
static int efx_get_phys_port_name(struct net_device *net_dev,
2349+
char *name, size_t len)
2350+
{
2351+
struct efx_nic *efx = netdev_priv(net_dev);
2352+
2353+
if (snprintf(name, len, "p%u", efx->port_num) >= len)
2354+
return -EINVAL;
2355+
return 0;
2356+
}
2357+
23482358
static int efx_vlan_rx_add_vid(struct net_device *net_dev, __be16 proto, u16 vid)
23492359
{
23502360
struct efx_nic *efx = netdev_priv(net_dev);
@@ -2387,6 +2397,7 @@ static const struct net_device_ops efx_netdev_ops = {
23872397
.ndo_set_vf_link_state = efx_sriov_set_vf_link_state,
23882398
#endif
23892399
.ndo_get_phys_port_id = efx_get_phys_port_id,
2400+
.ndo_get_phys_port_name = efx_get_phys_port_name,
23902401
#ifdef CONFIG_NET_POLL_CONTROLLER
23912402
.ndo_poll_controller = efx_netpoll,
23922403
#endif

0 commit comments

Comments
 (0)