Skip to contentSkip to conversation

ixgbe: need to purge skb qdisc lists when changing real_num_tx_queues

RFC PATCH In review John Fastabend 2 participants 2 messages Jun 21, 2010 – Jun 29, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 ixgbe: need to purge skb qdisc lists when changing real_num_tx_queues

This patch exports dev_deactivate() symbol.

The qdisc needs to be purged when real_num_tx_queues is changed so that skbs do not hit ndo_start_xmit with queue_mappings corresponding to tx_rings already freed.

real_num_tx_queues is changed when dynamically enabling or disabling DCB or FCoE. To purge the qdisc use dev_deactivate().

---

 drivers/net/ixgbe/ixgbe_dcb_nl.c |    9 +++++++--
 drivers/net/ixgbe/ixgbe_fcoe.c   |    9 +++++++--
 net/sched/sch_generic.c          |    1 +
 3 files changed, 15 insertions(+), 4 deletions(-)
drivers/net/ixgbe/ixgbe_dcb_nl.c +7 -2
index 71da325..0d6854c 100644
@@ -28,6 +28,7 @@
 
 #include "ixgbe.h"
 #include <linux/dcbnl.h>
+#include <net/pkt_sched.h>
 #include "ixgbe_dcb_82598.h"
 #include "ixgbe_dcb_82599.h"
 
@@ -126,8 +127,10 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
 			goto out;
 		}
 
-		if (netif_running(netdev))
+		if (netif_running(netdev)) {
+			dev_deactivate(netdev);
 			netdev->netdev_ops->ndo_stop(netdev);
+		}
 		ixgbe_clear_interrupt_scheme(adapter);
 
 		if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
@@ -146,8 +149,10 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
 	} else {
 		/* Turn off DCB */
 		if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
-			if (netif_running(netdev))
+			if (netif_running(netdev)) {
+				dev_deactivate(netdev);
 				netdev->netdev_ops->ndo_stop(netdev);
+			}
 			ixgbe_clear_interrupt_scheme(adapter);
 
 			adapter->hw.fc.requested_mode = adapter->last_lfc_mode;
drivers/net/ixgbe/ixgbe_fcoe.c +7 -2
index 45182ab..181f158 100644
@@ -33,6 +33,7 @@
 #include <linux/if_ether.h>
 #include <linux/gfp.h>
 #include <linux/if_vlan.h>
+#include <net/sch_generic.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
 #include <scsi/fc/fc_fs.h>
@@ -615,8 +616,10 @@ int ixgbe_fcoe_enable(struct net_device *netdev)
 		goto out_enable;
 
 	DPRINTK(DRV, INFO, "Enabling FCoE offload features.\n");
-	if (netif_running(netdev))
+	if (netif_running(netdev)) {
+		dev_deactivate(netdev);
 		netdev->netdev_ops->ndo_stop(netdev);
+	}
 
 	ixgbe_clear_interrupt_scheme(adapter);
 
@@ -661,8 +664,10 @@ int ixgbe_fcoe_disable(struct net_device *netdev)
 		goto out_disable;
 
 	DPRINTK(DRV, INFO, "Disabling FCoE offload features.\n");
-	if (netif_running(netdev))
+	if (netif_running(netdev)) {
+		dev_deactivate(netdev);
 		netdev->netdev_ops->ndo_stop(netdev);
+	}
 
 	ixgbe_clear_interrupt_scheme(adapter);
 
net/sched/sch_generic.c +1 -0
index a63029e..53ca3ac 100644
@@ -804,6 +804,7 @@ void dev_deactivate(struct net_device *dev)
 	while (some_qdisc_is_busy(dev))
 		yield();
 }
+EXPORT_SYMBOL(dev_deactivate);
 
 static void dev_init_scheduler_queue(struct net_device *dev,
 				     struct netdev_queue *dev_queue,
maintainer
#1 lore raw

From: John Fastabend <[email protected]>
Date: Sun, 20 Jun 2010 22:25:20 -0700

Quoted 10 lines

This patch exports dev_deactivate() symbol.

The qdisc needs to be purged when real_num_tx_queues is changed so that skbs do not hit ndo_start_xmit with queue_mappings corresponding to tx_rings already freed.

real_num_tx_queues is changed when dynamically enabling or disabling DCB or FCoE. To purge the qdisc use dev_deactivate().

Whatever it is that needs to happen when real_num_tx_queues changes outght to be transparent to drivers.

Therefore we should hide all of these details behind a well named interface drivers can call when they need to change real_num_tx_queues.