Re: [PATCH net-next v2 1/7] net: devlink: Add unused port flavour

Andrew Lunn
2020-09-30T13:57:38Z

> I get it. But I as I wrote previously, I wonder if used/unused should
> not be another attribute. Then the flavour can be "undefined".

In the DSA world, it is not undefined. It is clear defined as
unused. And it cannot be on-the-fly changed. It is a property of the
PCB, in that the pins exist on the chip, but they simply don't go
anywhere on the PCB. This is quite common on appliances, e.g. The
switch has 7 ports, but the installation in the aircraft is a big
ring, so there is a 'left', 'right', 'aux' and the CPU port. That
leaves 3 ports totally unused.

> But, why do you want to show "unused" ports? Can the user do something
> with them? What is the value in showing them?

Because they are just ports, they can have regions. We can look at the
region and be sure they are powered off, the boot loader etc has not
left them in a funny state, bridged to other ports, etc.

Regions are a developers tool, not a 'user' tools. So the idea of
hiding them by default in 'devlink port show' does make some sense,
and have a flag like -d for details, which includes them. In 'devlink
region show' i would probably list all regions, independent of any -d
flag.

Andrew