From: David Miller <davem@davemloft.net>
To: netdev@vger.kernel.org
Subject: Re: [net-tx-2.6 PATCH]: Push TX lock down into drivers
Date: Thu, 26 Jun 2008 02:35:55 -0700 (PDT) [thread overview]
Message-ID: <20080626.023555.71060613.davem@davemloft.net> (raw)
In-Reply-To: <20080625.013355.229057310.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Wed, 25 Jun 2008 01:33:55 -0700 (PDT)
> Here is the patch I've been crunching on the past few days.
So after spending all of that time hand-editing 350+ drivers I realize
that my approach is all wrong :-) 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
I tried today to take the next step and actually remove the
netdev->_xmit_lock and the problems became clear.
My new plan is to move the qdisc state down into the drivers too. And
also perhaps provide a better transition path.
There is, of course, the question of semantics.
Currently I think we should:
1) By default do pure replication. If qdisc X is configured for
device Y, then X is configured for each of device Y'd transmit
queues.
2) A "TX queue index" attribute is added for qdisc netlink config
messages. If present, the request applies only to the qdisc of a
specific transmit queue of the device. Otherwise we replicate the
request onto all transmit queues.
This would mean that old tools work and do something mostly sane on
multiqueue devices.
Maybe in the end this is nicer. All the qdisc management can move
under the driver's ->tx_lock. Or even, the qdisc can be the locked
element. The idea being we stick a lock in there and that's what the
driver holds across ->hard_start_xmit().
Qdisc running will thus be naturally batched, rather than the ad-hoc
scheme we have now where we set some "running the queue" state bit
since we can't hold the qdisc lock and the TX lock at the same time.
In this manner the qdisc object works sort of like a NAPI context. It
provides the synchronization and packet processing locking semantics.
The only part I haven't figured out is how to glue the scheduler
API bits down into the per-queue qdiscs.
Another thing I noticed in all of this is that we perhaps want to
replicate the ingress qdisc bits when there are multiple receive
queues.
One thing I want to avoid, for the TX qdiscs, is having some array of
pointers and a TX queue count stored in the netdev struct.
Anyways, I'll see if this works out.
next prev parent reply other threads:[~2008-06-26 9:35 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 [this message]
2008-06-27 11:06 ` Jarek Poplawski
2008-06-27 11:19 ` David Miller
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=20080626.023555.71060613.davem@davemloft.net \
--to=davem@davemloft.net \
--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