nfp: pass switch ID through devlink_port_attrs_set()
authorJiri Pirko <jiri@mellanox.com>
Wed, 3 Apr 2019 12:24:23 +0000 (14:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Apr 2019 00:42:36 +0000 (17:42 -0700)
Pass the switch ID down the to devlink through devlink_port_attrs_set()
so it can be used by devlink_compat_switch_id_get().

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_devlink.c

index 15c4d2e0c86eb7a735c47eabc4fc2acd3b40f040..8e7591241e7ca587014842ad972e11286be862a2 100644 (file)
@@ -354,6 +354,8 @@ int nfp_devlink_port_register(struct nfp_app *app, struct nfp_port *port)
 {
        struct nfp_eth_table_port eth_port;
        struct devlink *devlink;
+       const u8 *serial;
+       int serial_len;
        int ret;
 
        rtnl_lock();
@@ -362,9 +364,10 @@ int nfp_devlink_port_register(struct nfp_app *app, struct nfp_port *port)
        if (ret)
                return ret;
 
+       serial_len = nfp_cpp_serial(port->app->cpp, &serial);
        devlink_port_attrs_set(&port->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL,
                               eth_port.label_port, eth_port.is_split,
-                              eth_port.label_subport, NULL, 0);
+                              eth_port.label_subport, serial, serial_len);
 
        devlink = priv_to_devlink(app->pf);