Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jarkao2@gmail.com
Cc: netdev@vger.kernel.org
Subject: Re: [net-tx-2.6 PATCH]: Push TX lock down into drivers
Date: Fri, 27 Jun 2008 04:19:17 -0700 (PDT)	[thread overview]
Message-ID: <20080627.041917.193698243.davem@davemloft.net> (raw)
In-Reply-To: <4864C9B7.4070003@gmail.com>

From: Jarek Poplawski <jarkao2@gmail.com>
Date: Fri, 27 Jun 2008 13:06:31 +0200

> David Miller wrote, On 06/26/2008 11:35 AM:
> ...
> 
> > I've also written up a blog
> > entry about netdev TX locking at the usual spot:
> > 
> >       http://vger.kernel.org/~davem/cgi-bin/blog.cgi/index.html
> 
> ...So, why exactly this nice lady didn't like new TX locking?

Actually that photo is from a trip to cut down a Christmas tree at a
local tree farm up in the Cascade mountains 2 years ago :-)

And this lady would have good reason to not like the new TX locking I
had proposed, it was completely the wrong approach.

I have a new set of patches which already seems a lot saner and
should be in a state I can publish in a few days.

The new idea is to replicate the qdisc state and the TX lock
into an array of per-queue state blobs.  So we now have:

--------------------
enum netdev_tx_state_t
{
	__LINK_TX_STATE_XOFF=0,
	__LINK_TX_STATE_QDISC_RUNNING,
};

struct netdev_tx_queue {
	spinlock_t		lock;
	unsigned long		state;
	spinlock_t		_xmit_lock;
	struct Qdisc		*qdisc;
	struct netdev_tx_queue	*next_sched;
	struct net_device	*dev;
	struct Qdisc		*qdisc_sleeping;
	struct list_head	qdisc_list;
};
--------------------

And struct net_device gets:

____________________
	struct netdev_tx_queue	*_tx ____cacheline_aligned_in_smp;
	unsigned short		num_tx_queues;
	unsigned short		real_num_tx_queues;
	unsigned int		tx_queue_len;
--------------------

It's done in such a way that non-multiqueue drivers simply keep on
working out of the box.  For example, all the existing
non-multiqueue-aware interfaces simply operate on queue 0.

The part I haven't coded up yet is the qdisc replication bits.  But
once that's done all I really need to do is grind through the patch
set with allmodconfig/allyesconfig test builds before posting a first
draft.

Not having to touch 400 drivers this time around is a good initial
sign :)

      reply	other threads:[~2008-06-27 11:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-25  8:33 [net-tx-2.6 PATCH]: Push TX lock down into drivers David Miller
2008-06-26  9:35 ` David Miller
2008-06-27 11:06   ` Jarek Poplawski
2008-06-27 11:19     ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080627.041917.193698243.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jarkao2@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox