Skip to content

Commit

Permalink
cxgb4vf: Forcefully link up virtual interfaces
Browse files Browse the repository at this point in the history
The Virtual Interfaces are connected to an internal switch on the chip
which allows VIs attached to the same port to talk to each other even
when the port link is down.  As a result, we generally want to always
report a VI's link as being "up".

Based on the original work by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Arjun Vynipadath <arjun@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arjun Vynipadath authored and David S. Miller committed Mar 4, 2018
1 parent 4130331 commit 0913667
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ void t4vf_os_link_changed(struct adapter *adapter, int pidx, int link_ok)
const char *fc;
const struct port_info *pi = netdev_priv(dev);

netif_carrier_on(dev);

switch (pi->link_cfg.speed) {
case 100:
s = "100Mbps";
Expand Down Expand Up @@ -202,7 +200,6 @@ void t4vf_os_link_changed(struct adapter *adapter, int pidx, int link_ok)

netdev_info(dev, "link up, %s, full-duplex, %s PAUSE\n", s, fc);
} else {
netif_carrier_off(dev);
netdev_info(dev, "link down\n");
}
}
Expand Down Expand Up @@ -278,6 +275,17 @@ static int link_start(struct net_device *dev)
*/
if (ret == 0)
ret = t4vf_enable_vi(pi->adapter, pi->viid, true, true);

/* The Virtual Interfaces are connected to an internal switch on the
* chip which allows VIs attached to the same port to talk to each
* other even when the port link is down. As a result, we generally
* want to always report a VI's link as being "up", provided there are
* no errors in enabling vi.
*/

if (ret == 0)
netif_carrier_on(dev);

return ret;
}

Expand Down

0 comments on commit 0913667

Please sign in to comment.