nfp: flower: obtain repr link state only from firmware
authorDirk van der Merwe <dirk.vandermerwe@netronome.com>
Wed, 3 Jan 2018 03:18:59 +0000 (19:18 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Jan 2018 17:17:30 +0000 (12:17 -0500)
Instead of starting up reprs assuming that there is link, only respond
to the link state reported by firmware.

Furthermore, ensure link is down after repr netdevs are created.

Signed-off-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/main.c
drivers/net/ethernet/netronome/nfp/nfp_net_repr.c

index 63160e9754d4afb478f742bfee5364af9326a144..252d19236ad851430bc31b38604cceb15bf7aa74 100644 (file)
@@ -110,7 +110,6 @@ nfp_flower_repr_netdev_open(struct nfp_app *app, struct nfp_repr *repr)
        if (err)
                return err;
 
-       netif_carrier_on(repr->netdev);
        netif_tx_wake_all_queues(repr->netdev);
 
        return 0;
@@ -119,7 +118,6 @@ nfp_flower_repr_netdev_open(struct nfp_app *app, struct nfp_repr *repr)
 static int
 nfp_flower_repr_netdev_stop(struct nfp_app *app, struct nfp_repr *repr)
 {
-       netif_carrier_off(repr->netdev);
        netif_tx_disable(repr->netdev);
 
        return nfp_flower_cmsg_portmod(repr, false);
index 78b36c67c232f661d5c2633034c5ada015bf1aeb..3c6cb381385de0cc966b7cca8033ce764186cd21 100644 (file)
@@ -336,6 +336,8 @@ struct net_device *nfp_repr_alloc(struct nfp_app *app)
        if (!netdev)
                return NULL;
 
+       netif_carrier_off(netdev);
+
        repr = netdev_priv(netdev);
        repr->netdev = netdev;
        repr->app = app;