aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2017-06-05 17:01:49 -0700
committerDavid S. Miller <davem@davemloft.net>2017-06-07 12:51:39 -0400
commit5c0dbe9ecf02349490794a4205d61c6603390082 (patch)
treeeb86a5692abeb2bee497caccdda6a3d757ac0a41 /drivers/net/ethernet/netronome/nfp/nfp_net_common.c
parentnfp: allow allocation and initialization of netdev-less vNICs (diff)
downloadlinux-dev-5c0dbe9ecf02349490794a4205d61c6603390082.tar.xz
linux-dev-5c0dbe9ecf02349490794a4205d61c6603390082.zip
nfp: prepare config and enable for working without netdevs
Out of the three stages of ifup/ifdown (allocate, configure, start) - this commit prepares the configuration stage for working with control vNICs. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_net_common.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 1cc7425ffd27..c47705861a81 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -2236,9 +2236,10 @@ static int nfp_net_set_config_and_enable(struct nfp_net *nn)
nn_writeq(nn, NFP_NET_CFG_RXRS_ENABLE, nn->dp.num_rx_rings == 64 ?
0xffffffffffffffffULL : ((u64)1 << nn->dp.num_rx_rings) - 1);
- nfp_net_write_mac_addr(nn, nn->dp.netdev->dev_addr);
+ if (nn->dp.netdev)
+ nfp_net_write_mac_addr(nn, nn->dp.netdev->dev_addr);
- nn_writel(nn, NFP_NET_CFG_MTU, nn->dp.netdev->mtu);
+ nn_writel(nn, NFP_NET_CFG_MTU, nn->dp.mtu);
bufsz = nn->dp.fl_bufsz - nn->dp.rx_dma_off - NFP_NET_RX_BUF_NON_DATA;
nn_writel(nn, NFP_NET_CFG_FLBUFSZ, bufsz);