diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2017-08-19 01:48:19 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-19 08:39:28 +0300 |
commit | ef0ec676a7181d418bb9051ccfe1cd13a1f47ab2 (patch) | |
tree | 5710425b5a08deb29fd6972cd919b48f4d737a7b /drivers/net/ethernet/netronome/nfp/flower/main.c | |
parent | 098ce840c9ef7b474437a766a0f9759b5c3e1ae6 (diff) | |
download | linux-ef0ec676a7181d418bb9051ccfe1cd13a1f47ab2.tar.xz |
nfp: add pointer to vNIC config memory to nfp_port structure
Simplify the statistics handling code by keeping pointer to vNIC's
config memory in nfp_port. Note that this is referring to the
representor side of vNICs, vNIC side has the pointer in nfp_net.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/flower/main.c')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/flower/main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.c b/drivers/net/ethernet/netronome/nfp/flower/main.c index 3088e959f2a3..126a6b5233bf 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/main.c +++ b/drivers/net/ethernet/netronome/nfp/flower/main.c @@ -159,12 +159,18 @@ nfp_flower_spawn_vnic_reprs(struct nfp_app *app, goto err_reprs_clean; } + /* For now we only support 1 PF */ + WARN_ON(repr_type == NFP_REPR_TYPE_PF && i); + port = nfp_port_alloc(app, port_type, reprs->reprs[i]); if (repr_type == NFP_REPR_TYPE_PF) { port->pf_id = i; + port->vnic = priv->nn->dp.ctrl_bar; } else { - port->pf_id = 0; /* For now we only support 1 PF */ + port->pf_id = 0; port->vf_id = i; + port->vnic = + app->pf->vf_cfg_mem + i * NFP_NET_CFG_BAR_SZ; } eth_hw_addr_random(reprs->reprs[i]); |