netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: shemminger@vyatta.com, brian.haley@hp.com, kaber@trash.net,
	jarkao2@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next-2.6] vlan: multiqueue vlan devices
Date: Thu, 03 Sep 2009 11:17:13 +0200	[thread overview]
Message-ID: <4A9F8999.1060404@gmail.com> (raw)
In-Reply-To: <20090902.180401.155663057.davem@davemloft.net>

David Miller a écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 02 Sep 2009 21:12:03 +0200
> 
>> [PATCH net-next-2.6] vlan: multiqueue vlan device
>>
>> vlan devices are currently not multi-queue capable.
>>
>> We can do that with a new rtnl_link_ops method,
>> get_tx_queues(), called from rtnl_create_link()
>>
>> This new method gets num_tx_queues/real_num_tx_queues
>> from real device.
>>
>> register_vlan_device() is also handled.
>>
>> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> 
> Applied, but now I need you to do an audit :-)
> 
> I believe that drivers will change the number of TX queues
> in use at times where we'll need to trigger an event or
> something so that vlan's can learn about the value changing.

Here is a followup to enable 'true' multiqueue vlan xmit.

I missed this in my first patch.

[PATCH net-next-2.6] vlan: enable multiqueue xmits

vlan_dev_hard_start_xmit() & vlan_dev_hwaccel_hard_start_xmit()
select txqueue number 0, instead of using index provided by
skb_get_queue_mapping().

This is not correct after commit 2e59af3dcbdf11635c03f
[vlan: multiqueue vlan device] because
txq->tx_packets  & txq->tx_bytes changes are performed on
a single location, and not the right locking.

Fix is to take the appropriate struct netdev_queue pointer

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 53f84c7..3938c3e 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -291,7 +291,8 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
 static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb,
 					    struct net_device *dev)
 {
-	struct netdev_queue *txq = netdev_get_tx_queue(dev, 0);
+	int i = skb_get_queue_mapping(skb);
+	struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
 	struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);
 
 	/* Handle non-VLAN frames if they are sent to us, for example by DHCP.
@@ -329,7 +330,8 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb,
 static netdev_tx_t vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb,
 						    struct net_device *dev)
 {
-	struct netdev_queue *txq = netdev_get_tx_queue(dev, 0);
+	int i = skb_get_queue_mapping(skb);
+	struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
 	u16 vlan_tci;
 
 	vlan_tci = vlan_dev_info(dev)->vlan_id;

  parent reply	other threads:[~2009-09-03  9:17 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01 23:52 [NET] Add proc file to display the state of all qdiscs Christoph Lameter
2009-09-02  8:14 ` Jarek Poplawski
2009-09-02  8:28   ` Eric Dumazet
2009-09-02  8:30     ` David Miller
2009-09-02 12:30       ` [PATCH net-next-2.6] tc: report informations for multiqueue devices Eric Dumazet
2009-09-02 12:48         ` Eric Dumazet
2009-09-02 16:23           ` Stephen Hemminger
2009-09-02 16:30             ` Patrick McHardy
2009-09-02 16:50               ` Eric Dumazet
2009-09-02 17:17                 ` [PATCH net-next-2.6] vlan: multiqueue vlan devices Eric Dumazet
2009-09-02 17:49                   ` Patrick McHardy
2009-09-02 18:37                   ` Brian Haley
2009-09-02 18:55                     ` Eric Dumazet
2009-09-02 19:01                       ` Stephen Hemminger
2009-09-02 19:12                         ` Eric Dumazet
2009-09-03  1:04                           ` David Miller
2009-09-03  1:05                             ` Eric Dumazet
2009-09-03  9:17                             ` Eric Dumazet [this message]
2009-09-03  9:20                               ` David Miller
2009-09-02 17:31               ` [PATCH net-next-2.6] tc: report informations for multiqueue devices Eric Dumazet
2009-09-02 17:50                 ` Patrick McHardy
2009-09-02 13:18         ` Patrick McHardy
2009-09-02 13:49           ` Eric Dumazet
2009-09-02 14:07             ` Patrick McHardy
2009-09-02 22:17               ` Jarek Poplawski
2009-09-02  9:18     ` [NET] Add proc file to display the state of all qdiscs Jarek Poplawski
2009-09-02  9:33       ` Jarek Poplawski
2009-09-02  9:37         ` Jarek Poplawski
2009-09-02 12:44           ` Patrick McHardy
2009-09-02 18:13     ` Christoph Lameter
2009-09-03 14:19       ` Jesper Dangaard Brouer
2009-09-03 14:29         ` Patrick McHardy
2009-09-03 14:43           ` Eric Dumazet
2009-09-03 17:30           ` Jesper Dangaard Brouer
2009-09-03 17:56             ` Patrick McHardy
2009-09-03 23:31               ` David Miller
2009-09-04  1:36                 ` Patrick McHardy
2009-09-04  1:43                   ` Patrick McHardy
2009-09-03 23:28             ` David Miller
2009-09-03 23:22         ` David Miller
2009-09-02 18:12   ` Christoph Lameter
2009-09-02 19:49     ` Jarek Poplawski
2009-09-02 21:27 ` Jarek Poplawski
2009-09-03 18:03   ` Christoph Lameter
2009-09-03 19:35     ` Jarek Poplawski
2009-09-03 19:38       ` Eric Dumazet
2009-09-03 19:54         ` Jarek Poplawski

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=4A9F8999.1060404@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=brian.haley@hp.com \
    --cc=davem@davemloft.net \
    --cc=jarkao2@gmail.com \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /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;
as well as URLs for NNTP newsgroup(s).