From patchwork Thu Sep 3 09:17:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 32872 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 85B86B70B0 for ; Thu, 3 Sep 2009 19:17:30 +1000 (EST) Received: by ozlabs.org (Postfix) id 7ADBADDD0B; Thu, 3 Sep 2009 19:17:30 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 0D429DDD04 for ; Thu, 3 Sep 2009 19:17:30 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754757AbZICJRW (ORCPT ); Thu, 3 Sep 2009 05:17:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754749AbZICJRV (ORCPT ); Thu, 3 Sep 2009 05:17:21 -0400 Received: from gw1.cosmosbay.com ([212.99.114.194]:34879 "EHLO gw1.cosmosbay.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754725AbZICJRV (ORCPT ); Thu, 3 Sep 2009 05:17:21 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by gw1.cosmosbay.com (8.13.7/8.13.7) with ESMTP id n839HDPG016360; Thu, 3 Sep 2009 11:17:13 +0200 Message-ID: <4A9F8999.1060404@gmail.com> Date: Thu, 03 Sep 2009 11:17:13 +0200 From: Eric Dumazet User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: David Miller 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 References: <4A9EBF9C.2030904@gmail.com> <20090902120107.15146e4e@nehalam> <4A9EC383.4070304@gmail.com> <20090902.180401.155663057.davem@davemloft.net> In-Reply-To: <20090902.180401.155663057.davem@davemloft.net> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (gw1.cosmosbay.com [0.0.0.0]); Thu, 03 Sep 2009 11:17:13 +0200 (CEST) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org David Miller a écrit : > From: Eric Dumazet > 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 > > 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 --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;