Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cxgb4: fix reported state of interfaces without link

Currently tools like ip and ifconfig report incorrect state for cxgb4
interfaces that are up but do not have link and do so until first link
establishment. This is because the initial netif_carrier_off call is
before register_netdev and it needs to be after to be fully effective.
Fix this by moving netif_carrier_off into .ndo_open.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Dimitris Michailidis and committed by
David S. Miller
6a3c869a 4580ccc0

+2 -1
+2 -1
drivers/net/cxgb4/cxgb4_main.c
··· 2710 2710 struct port_info *pi = netdev_priv(dev); 2711 2711 struct adapter *adapter = pi->adapter; 2712 2712 2713 + netif_carrier_off(dev); 2714 + 2713 2715 if (!(adapter->flags & FULL_INIT_DONE)) { 2714 2716 err = cxgb_up(adapter); 2715 2717 if (err < 0) ··· 3663 3661 pi->xact_addr_filt = -1; 3664 3662 pi->rx_offload = RX_CSO; 3665 3663 pi->port_id = i; 3666 - netif_carrier_off(netdev); 3667 3664 netdev->irq = pdev->irq; 3668 3665 3669 3666 netdev->features |= NETIF_F_SG | TSO_FLAGS;