[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190301180453.17778-8-jakub.kicinski@netronome.com>
Date: Fri, 1 Mar 2019 10:04:53 -0800
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: jiri@...nulli.us, davem@...emloft.net
Cc: netdev@...r.kernel.org, oss-drivers@...ronome.com,
Jakub Kicinski <jakub.kicinski@...ronome.com>
Subject: [PATCH net-next v2 7/7] nfp: expose PF peer netdevs
Expose PF netdevs as devlink port's peers.
Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
---
drivers/net/ethernet/netronome/nfp/abm/main.c | 1 +
drivers/net/ethernet/netronome/nfp/flower/main.c | 1 +
drivers/net/ethernet/netronome/nfp/nfp_devlink.c | 3 ++-
drivers/net/ethernet/netronome/nfp/nfp_port.h | 2 ++
4 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/netronome/nfp/abm/main.c b/drivers/net/ethernet/netronome/nfp/abm/main.c
index 4d4ff5844c47..8d7ff1200fd4 100644
--- a/drivers/net/ethernet/netronome/nfp/abm/main.c
+++ b/drivers/net/ethernet/netronome/nfp/abm/main.c
@@ -113,6 +113,7 @@ nfp_abm_spawn_repr(struct nfp_app *app, struct nfp_abm_link *alink,
port->pf_id = alink->abm->pf_id;
port->pf_split = app->pf->max_data_vnics > 1;
port->pf_split_id = alink->id;
+ port->peer = alink->vnic->dp.netdev;
port->vnic = alink->vnic->dp.ctrl_bar;
}
diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.c b/drivers/net/ethernet/netronome/nfp/flower/main.c
index 408089133599..13aa21923bf7 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/main.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/main.c
@@ -300,6 +300,7 @@ nfp_flower_spawn_vnic_reprs(struct nfp_app *app,
if (repr_type == NFP_REPR_TYPE_PF) {
port->pf_id = i;
port->vnic = priv->nn->dp.ctrl_bar;
+ port->peer = priv->nn->dp.netdev;
} else {
port->pf_id = 0;
port->vf_id = i;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_devlink.c b/drivers/net/ethernet/netronome/nfp/nfp_devlink.c
index 6ad2805f1efc..ced21a9951aa 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_devlink.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_devlink.c
@@ -377,7 +377,8 @@ int nfp_devlink_port_init(struct nfp_app *app, struct nfp_port *port)
case NFP_PORT_PHYS_PORT:
return nfp_devlink_port_init_phys(devlink, port);
case NFP_PORT_PF_PORT:
- devlink_port_type_eth_set(&port->dl_port, port->netdev);
+ devlink_port_type_eth_set_peer(&port->dl_port, port->netdev,
+ port->peer);
devlink_port_attrs_pci_pf_set(&port->dl_port, port->pf_id,
port->pf_split,
port->pf_split_id);
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_port.h b/drivers/net/ethernet/netronome/nfp/nfp_port.h
index 09c55ca2371a..c75a25cc5cea 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_port.h
+++ b/drivers/net/ethernet/netronome/nfp/nfp_port.h
@@ -51,6 +51,7 @@ enum nfp_port_flags {
* @eth_forced: for %NFP_PORT_PHYS_PORT port is forced UP or DOWN, don't change
* @eth_port: for %NFP_PORT_PHYS_PORT translated ETH Table port entry
* @eth_stats: for %NFP_PORT_PHYS_PORT MAC stats if available
+ * @peer: for %NFP_PORT_PF_PORT netdev of the actual vNIC, if reachable
* @pf_id: for %NFP_PORT_PF_PORT, %NFP_PORT_VF_PORT ID of the PCI PF (0-3)
* @vf_id: for %NFP_PORT_VF_PORT ID of the PCI VF within @pf_id
* @pf_split: for %NFP_PORT_PF_PORT %true if PCI PF has more than one vNIC
@@ -79,6 +80,7 @@ struct nfp_port {
};
/* NFP_PORT_PF_PORT, NFP_PORT_VF_PORT */
struct {
+ struct net_device *peer;
unsigned int pf_id;
unsigned int vf_id;
bool pf_split;
--
2.19.2
Powered by blists - more mailing lists