net: devlink: extend port attrs for switch ID

Extend devlink_port_attrs_set() to pass switch ID for ports which are
part of switch and store it in port attrs. For other ports, this is
NULL.

Note that this allows the driver to group devlink ports into one or more
switches according to the actual topology.

Signed-off-by: Jiri Pirko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Jiri Pirko 2019-04-03 14:24:16 +02:00 • committed by David S. Miller
commit bec5267cde
6 changed files with 26 additions and 7 deletions

View file

@ -286,7 +286,7 @@ static int dsa_port_setup(struct dsa_port *dp)
* independent from front panel port numbers.
*/
devlink_port_attrs_set(&dp->devlink_port, flavour,
dp->index, false, 0);
dp->index, false, 0, NULL, 0);
err = devlink_port_register(ds->devlink, &dp->devlink_port,
dp->index);
if (err)