netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 11/39]: netdev: Move next_sched into struct netdev_queue.
@ 2008-07-03  7:03 David Miller
       [not found] ` <20080703.000333.199735542.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2008-07-03  7:03 UTC (permalink / raw)
  To: netdev; +Cc: vinay, krkumar2, mchan, Matheos.Worku, linux-wireless


We schedule queues, not the device, for output queue
processing in BH.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 include/linux/netdevice.h |    5 ++---
 net/core/dev.c            |   15 +++++++--------
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 1151d17..60f7665 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -454,6 +454,7 @@ struct netdev_queue {
 	struct Qdisc		*qdisc;
 	struct Qdisc		*qdisc_sleeping;
 	struct list_head	qdisc_list;
+	struct netdev_queue	*next_sched;
 };
 
 /*
@@ -545,8 +546,6 @@ struct net_device
 #define NETIF_F_V6_CSUM		(NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
 #define NETIF_F_ALL_CSUM	(NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
 
-	struct net_device	*next_sched;
-
 	/* Interface index. Unique device identifier	*/
 	int			ifindex;
 	int			iflink;
@@ -938,7 +937,7 @@ static inline int unregister_gifconf(unsigned int family)
  */
 struct softnet_data
 {
-	struct net_device	*output_queue;
+	struct netdev_queue	*output_queue;
 	struct sk_buff_head	input_pkt_queue;
 	struct list_head	poll_list;
 	struct sk_buff		*completion_queue;
diff --git a/net/core/dev.c b/net/core/dev.c
index 8e38948..c5e3532 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1323,13 +1323,14 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
 void __netif_schedule(struct net_device *dev)
 {
 	if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) {
+		struct netdev_queue *txq = &dev->tx_queue;
 		unsigned long flags;
 		struct softnet_data *sd;
 
 		local_irq_save(flags);
 		sd = &__get_cpu_var(softnet_data);
-		dev->next_sched = sd->output_queue;
-		sd->output_queue = dev;
+		txq->next_sched = sd->output_queue;
+		sd->output_queue = txq;
 		raise_softirq_irqoff(NET_TX_SOFTIRQ);
 		local_irq_restore(flags);
 	}
@@ -1912,7 +1913,7 @@ static void net_tx_action(struct softirq_action *h)
 	}
 
 	if (sd->output_queue) {
-		struct net_device *head;
+		struct netdev_queue *head;
 
 		local_irq_disable();
 		head = sd->output_queue;
@@ -1920,12 +1921,10 @@ static void net_tx_action(struct softirq_action *h)
 		local_irq_enable();
 
 		while (head) {
-			struct net_device *dev = head;
-			struct netdev_queue *txq;
+			struct netdev_queue *txq = head;
+			struct net_device *dev = txq->dev;
 			head = head->next_sched;
 
-			txq = &dev->tx_queue;
-
 			smp_mb__before_clear_bit();
 			clear_bit(__LINK_STATE_SCHED, &dev->state);
 
@@ -4346,7 +4345,7 @@ static int dev_cpu_callback(struct notifier_block *nfb,
 			    void *ocpu)
 {
 	struct sk_buff **list_skb;
-	struct net_device **list_net;
+	struct netdev_queue **list_net;
 	struct sk_buff *skb;
 	unsigned int cpu, oldcpu = (unsigned long)ocpu;
 	struct softnet_data *sd, *oldsd;
-- 
1.5.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 11/39]: netdev: Move next_sched into struct netdev_queue.
       [not found] ` <20080703.000333.199735542.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
@ 2008-07-14 11:49   ` Jarek Poplawski
  2008-07-14 12:00     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Jarek Poplawski @ 2008-07-14 11:49 UTC (permalink / raw)
  To: David Miller
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	vinay-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	krkumar2-xthvdsQ13ZrQT0dZR+AlfA, mchan-dY08KVG/lbpWk0Htik3J/w,
	Matheos.Worku-UdXhSnd/wVw, linux-wireless-u79uwXL29TY76Z2rM5mHXA

On 03-07-2008 09:03, David Miller wrote:
> We schedule queues, not the device, for output queue
> processing in BH.
> 
...
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 8e38948..c5e3532 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -1323,13 +1323,14 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
>  void __netif_schedule(struct net_device *dev)
>  {
>  	if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) {

Isn't this bit supposed to be set/tested per queue as well, or do I
miss something?

Jarek P.

> +		struct netdev_queue *txq = &dev->tx_queue;
>  		unsigned long flags;
>  		struct softnet_data *sd;
>  
>  		local_irq_save(flags);
>  		sd = &__get_cpu_var(softnet_data);
> -		dev->next_sched = sd->output_queue;
> -		sd->output_queue = dev;
> +		txq->next_sched = sd->output_queue;
> +		sd->output_queue = txq;
>  		raise_softirq_irqoff(NET_TX_SOFTIRQ);
>  		local_irq_restore(flags);
>  	}
> @@ -1912,7 +1913,7 @@ static void net_tx_action(struct softirq_action *h)
>  	}
>  
>  	if (sd->output_queue) {
> -		struct net_device *head;
> +		struct netdev_queue *head;
>  
>  		local_irq_disable();
>  		head = sd->output_queue;
> @@ -1920,12 +1921,10 @@ static void net_tx_action(struct softirq_action *h)
>  		local_irq_enable();
>  
>  		while (head) {
> -			struct net_device *dev = head;
> -			struct netdev_queue *txq;
> +			struct netdev_queue *txq = head;
> +			struct net_device *dev = txq->dev;
>  			head = head->next_sched;
>  
> -			txq = &dev->tx_queue;
> -
>  			smp_mb__before_clear_bit();
>  			clear_bit(__LINK_STATE_SCHED, &dev->state);
>  
> @@ -4346,7 +4345,7 @@ static int dev_cpu_callback(struct notifier_block *nfb,
>  			    void *ocpu)
>  {
>  	struct sk_buff **list_skb;
> -	struct net_device **list_net;
> +	struct netdev_queue **list_net;
>  	struct sk_buff *skb;
>  	unsigned int cpu, oldcpu = (unsigned long)ocpu;
>  	struct softnet_data *sd, *oldsd;
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 11/39]: netdev: Move next_sched into struct netdev_queue.
  2008-07-14 11:49   ` Jarek Poplawski
@ 2008-07-14 12:00     ` David Miller
       [not found]       ` <20080714.050011.186100773.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2008-07-14 12:00 UTC (permalink / raw)
  To: jarkao2; +Cc: netdev, vinay, krkumar2, mchan, Matheos.Worku, linux-wireless

From: Jarek Poplawski <jarkao2@gmail.com>
Date: Mon, 14 Jul 2008 11:49:13 +0000

> On 03-07-2008 09:03, David Miller wrote:
> > We schedule queues, not the device, for output queue
> > processing in BH.
> > 
> ...
> > diff --git a/net/core/dev.c b/net/core/dev.c
> > index 8e38948..c5e3532 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -1323,13 +1323,14 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
> >  void __netif_schedule(struct net_device *dev)
> >  {
> >  	if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) {
> 
> Isn't this bit supposed to be set/tested per queue as well, or do I
> miss something?

That shoule not happen until my later patches which switch that all
over.

See patch 5/13 which I posted on Thursday, Jul 10.  That's when the
transition from "global queue state + per-queue state" into "only
per-queue state" happens.

Until that point, we have to keep the existing quasi-multi-queue
semantics in order to not break drivers etc.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 11/39]: netdev: Move next_sched into struct netdev_queue.
       [not found]       ` <20080714.050011.186100773.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
@ 2008-07-14 12:27         ` Jarek Poplawski
  0 siblings, 0 replies; 4+ messages in thread
From: Jarek Poplawski @ 2008-07-14 12:27 UTC (permalink / raw)
  To: David Miller
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	vinay-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	krkumar2-xthvdsQ13ZrQT0dZR+AlfA, mchan-dY08KVG/lbpWk0Htik3J/w,
	Matheos.Worku-UdXhSnd/wVw, linux-wireless-u79uwXL29TY76Z2rM5mHXA

On Mon, Jul 14, 2008 at 05:00:11AM -0700, David Miller wrote:
> From: Jarek Poplawski <jarkao2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Date: Mon, 14 Jul 2008 11:49:13 +0000
> 
> > On 03-07-2008 09:03, David Miller wrote:
> > > We schedule queues, not the device, for output queue
> > > processing in BH.
> > > 
> > ...
> > > diff --git a/net/core/dev.c b/net/core/dev.c
> > > index 8e38948..c5e3532 100644
> > > --- a/net/core/dev.c
> > > +++ b/net/core/dev.c
> > > @@ -1323,13 +1323,14 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
> > >  void __netif_schedule(struct net_device *dev)
> > >  {
> > >  	if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) {
> > 
> > Isn't this bit supposed to be set/tested per queue as well, or do I
> > miss something?
> 
> That shoule not happen until my later patches which switch that all
> over.
> 
> See patch 5/13 which I posted on Thursday, Jul 10.  That's when the
> transition from "global queue state + per-queue state" into "only
> per-queue state" happens.
> 
> Until that point, we have to keep the existing quasi-multi-queue
> semantics in order to not break drivers etc.

I've just wondered how this 1-13/13 step can work without this...

Jarek P.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-14 12:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-03  7:03 [PATCH 11/39]: netdev: Move next_sched into struct netdev_queue David Miller
     [not found] ` <20080703.000333.199735542.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-07-14 11:49   ` Jarek Poplawski
2008-07-14 12:00     ` David Miller
     [not found]       ` <20080714.050011.186100773.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-07-14 12:27         ` Jarek Poplawski

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).