* [RFC net-2.6 PATCH] ixgbe: need to purge skb qdisc lists when changing real_num_tx_queues
@ 2010-06-21 5:25 John Fastabend
2010-06-29 4:19 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: John Fastabend @ 2010-06-21 5:25 UTC (permalink / raw)
To: netdev; +Cc: john.r.fastabend, davem, jeffrey.t.kirsher
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().
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
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(-)
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index 71da325..0d6854c 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -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;
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c
index 45182ab..181f158 100644
--- a/drivers/net/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ixgbe/ixgbe_fcoe.c
@@ -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);
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index a63029e..53ca3ac 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -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,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RFC net-2.6 PATCH] ixgbe: need to purge skb qdisc lists when changing real_num_tx_queues
2010-06-21 5:25 [RFC net-2.6 PATCH] ixgbe: need to purge skb qdisc lists when changing real_num_tx_queues John Fastabend
@ 2010-06-29 4:19 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-06-29 4:19 UTC (permalink / raw)
To: john.r.fastabend; +Cc: netdev, jeffrey.t.kirsher
From: John Fastabend <john.r.fastabend@intel.com>
Date: Sun, 20 Jun 2010 22:25:20 -0700
> 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().
>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-29 4:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-21 5:25 [RFC net-2.6 PATCH] ixgbe: need to purge skb qdisc lists when changing real_num_tx_queues John Fastabend
2010-06-29 4:19 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).