[net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Emil Tantilov <emil.s.tantilov@xxxxxxxxx>

This patch prevents reset/s on ifdown/up which can happen if
ixgbe_xmit_frame is invoked (netconsole) while the interface is down and
there are Tx rings to clean:

     kworker/6:0-11169 [006] d..2 75290.700064: ixgbe_xmit_frame <-netpoll_send_skb_on_dev
     kworker/6:0-11169 [006] d..2 75290.700064: ixgbe_xmit_frame_ring <-ixgbe_xmit_frame
     kworker/6:0-11169 [006] .N.. 75290.700097: ixgbe_get_link_capabilities_82599 <-ixgbe_service_task
     kworker/6:0-11169 [006] .N.. 75290.700097: ixgbe_setup_mac_link_82599 <-ixgbe_service_task
     kworker/6:0-11169 [006] .N.. 75290.700099: ixgbe_get_link_capabilities_82599 <-ixgbe_setup_mac_link_82599
     kworker/6:0-11169 [006] .N.. 75290.700100: ixgbe_check_mac_link_generic <-ixgbe_service_task
     kworker/6:0-11169 [006] .N.. 75290.700103: ixgbe_update_stats <-ixgbe_service_task
     kworker/6:0-11169 [006] .N.. 75290.700289: ixgbe_service_task: initiating reset to clear Tx work after link loss

CC: Arun Sharma <asharma@xxxxxx>
CC: stable-kernel <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Emil Tantilov <emil.s.tantilov@xxxxxxxxx>
Tested-by: Phil Schmitt <phillip.j.schmitt@xxxxxxxxx>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@xxxxxxxxx>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 851c413..8bea6ca 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7121,6 +7121,11 @@ static netdev_tx_t __ixgbe_xmit_frame(struct sk_buff *skb,
 	struct ixgbe_adapter *adapter = netdev_priv(netdev);
 	struct ixgbe_ring *tx_ring;
 
+	if (!netif_carrier_ok(netdev)) {
+		dev_kfree_skb_any(skb);
+		return NETDEV_TX_OK;
+	}
+
 	/*
 	 * The minimum packet size for olinfo paylen is 17 so pad the skb
 	 * in order to meet this minimum size requirement.
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]