diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2017-05-26 11:03:34 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-26 18:01:49 +0300 |
commit | 53e7a08f0da16eb67daf616405b0579e98565cdc (patch) | |
tree | c3adadc95bf6fdee31f019c734c8edce8c3f74d0 /drivers/net/ethernet/netronome/nfp/nfp_net_main.c | |
parent | 71f8a116b5c4b4957c56a2f1a5bd2a7e19d6d400 (diff) | |
download | linux-53e7a08f0da16eb67daf616405b0579e98565cdc.tar.xz |
nfp: register ports as devlink ports
Extend nfp_port to contain devlink_port structures. Register the
ports to allow users inspecting device ports.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfp_net_main.c')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c index b0a6ec4fe097..b733c97677fb 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c @@ -354,9 +354,20 @@ nfp_net_pf_init_vnic(struct nfp_pf *pf, struct nfp_net *nn, unsigned int id) nfp_net_debugfs_vnic_add(nn, pf->ddir, id); + if (nn->port) { + err = nfp_devlink_port_register(pf->app, nn->port); + if (err) + goto err_dfs_clean; + } + nfp_net_info(nn); return 0; + +err_dfs_clean: + nfp_net_debugfs_dir_clean(&nn->debugfs_dir); + nfp_net_clean(nn); + return err; } static int @@ -420,6 +431,8 @@ err_free_prev: static void nfp_net_pf_clean_vnic(struct nfp_pf *pf, struct nfp_net *nn) { + if (nn->port) + nfp_devlink_port_unregister(nn->port); nfp_net_debugfs_dir_clean(&nn->debugfs_dir); nfp_net_clean(nn); } |