Netdev List
 help / color / mirror / Atom feed
* [PATCH ethtool-next 0/2] ethtool: Introduce the --show-ports command
@ 2026-11-18 15:05 Maxime Chevallier
  2026-11-18 15:05 ` [PATCH ethtool-next 1/2] update UAPI header copies Maxime Chevallier
  2026-11-18 15:05 ` [PATCH ethtool-next 2/2] ethtool: Introduce a command to list an interface's ports Maxime Chevallier
  0 siblings, 2 replies; 3+ messages in thread
From: Maxime Chevallier @ 2026-11-18 15:05 UTC (permalink / raw)
  To: Michal Kubecek, Andrew Lunn, Jakub Kicinski, davem, Eric Dumazet,
	Paolo Abeni, Simon Horman
  Cc: Maxime Chevallier, netdev, Christophe Leroy, thomas.petazzoni

Hi everyone,

Following the merge of the phy_port GET ethnl command into net-next,
here's the ethtool counterpart that uses that commande to enumerate the
ports and their capabilities. This is queued for v7.4.

The output looks like this:

# ethtool --show-ports *

Port for eth0:
        Port id: 1
        Port type: mdi
        Supported link modes:  10baseT/Half 10baseT/Full
                               100baseT/Half 100baseT/Full
                               1000baseT/Full
                               10000baseT/Full
                               2500baseT/Full
                               5000baseT/Full

Port for eth0:
        Port id: 2
        Port type: sfp
        Supported MII interfaces: 10gbase-r

Port for eth2:
        Port id: 1
        Port type: mdi
        Supported link modes:  10baseT/Half 10baseT/Full
                               100baseT/Half 100baseT/Full
                               1000baseT/Half 1000baseT/Full

Port for eth3:
        Port id: 1
        Port type: sfp
        Supported MII interfaces: sgmii 1000base-x 2500base-x

Port for eth3:
        Port id: 2
        Port type: mdi
        Supported link modes:  10baseT/Half 10baseT/Full
                               100baseT/Half 100baseT/Full
                               1000baseT/Half 1000baseT/Full
                               1000baseX/Full
        Upstream port id: 1

Patch 1 syncs the kernel headers, and patch 2 implements the
--show-ports command.

Thanks,

Maxime

Maxime Chevallier (2):
  update UAPI header copies
  ethtool: Introduce a command to list an interface's ports

 Makefile.am                            |   1 +
 ethtool.8.in                           |  30 ++++++
 ethtool.c                              |   6 ++
 netlink/extapi.h                       |   2 +
 netlink/port.c                         | 134 +++++++++++++++++++++++++
 uapi/linux/ethtool.h                   |   2 +
 uapi/linux/ethtool_netlink_generated.h |  22 ++++
 uapi/linux/if_addr.h                   |   1 +
 uapi/linux/if_link.h                   |   1 +
 uapi/linux/netlink.h                   |  14 +++
 10 files changed, 213 insertions(+)
 create mode 100644 netlink/port.c

-- 
2.56.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-18 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 15:05 [PATCH ethtool-next 0/2] ethtool: Introduce the --show-ports command Maxime Chevallier
2026-11-18 15:05 ` [PATCH ethtool-next 1/2] update UAPI header copies Maxime Chevallier
2026-11-18 15:05 ` [PATCH ethtool-next 2/2] ethtool: Introduce a command to list an interface's ports Maxime Chevallier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox