public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, gospo@redhat.com,
	Vasu Dev <vasu.dev@intel.com>
Subject: Re: [net-next-2.6 PATCH 1/3] vlan: adds vlan_dev_select_queue
Date: Wed, 17 Feb 2010 14:51:15 +0100	[thread overview]
Message-ID: <1266414675.3246.12.camel@edumazet-laptop> (raw)
In-Reply-To: <20100217123606.18210.13602.stgit@localhost.localdomain>

Le mercredi 17 février 2010 à 04:36 -0800, Jeff Kirsher a écrit :
> From: Vasu Dev <vasu.dev@intel.com>
> 
> This is required to correctly select vlan tx queue for a driver
> supporting multi tx queue with ndo_select_queue implemented since
> currently selected vlan tx queue is unaligned to selected queue by
> ndo_select_queue.
> 
> Unaligned vlan tx queue causes thrash with higher vlan tx lock
> contention for least fcoe traffic on ixgbe.
> 
> Added vlan_dev_select_queue adds only minimal required code from
> dev_pick_tx and preserves queue selection for the case ndo_select_queue
> is not implemented.
> 
> Also updates vlan real_num_tx_queues in case underlying device
> queues has changed.
> 
> Signed-off-by: Vasu Dev <vasu.dev@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
> 
>  net/8021q/vlan.c     |    1 +
>  net/8021q/vlan_dev.c |   23 +++++++++++++++++++++++
>  2 files changed, 24 insertions(+), 0 deletions(-)
> 
> diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
> index 4535122..6c70805 100644
> --- a/net/8021q/vlan.c
> +++ b/net/8021q/vlan.c
> @@ -378,6 +378,7 @@ static void vlan_transfer_features(struct net_device *dev,
>  #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
>  	vlandev->fcoe_ddp_xid = dev->fcoe_ddp_xid;
>  #endif
> +	vlandev->real_num_tx_queues = dev->real_num_tx_queues;

Hi Jeff

This is a bit dangerous and deserves a self contained patch IMHO.

I would add for example a
	BUG_ON(vlandev->real_num_tx_queues > vlandev->num_tx_queues)

------------------

For performance reason, we could avoid calling vlan_dev_select_queue()
for real devices without ndo_select_queue() handler, this would need to
mirror vlan_netdev_ops & vlan_netdev_accel_ops.

It would also make vlan_dev_select_queue shorter and not duplicates
internals of net/dev/core.c :

static u16 vlan_dev_select_queue(struct net_device *dev, struct sk_buff
*skb)
{
       struct net_device *rdev = vlan_dev_info(dev)->real_dev;
       const struct net_device_ops *ops = rdev->netdev_ops;

       return ops->ndo_select_queue(rdev, skb);
}





  parent reply	other threads:[~2010-02-17 13:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-17 12:36 [net-next-2.6 PATCH 1/3] vlan: adds vlan_dev_select_queue Jeff Kirsher
2010-02-17 12:36 ` [net-next-2.6 PATCH 2/3] ixgbe: fix real_num_tx_queues update issue Jeff Kirsher
2010-02-17 12:36 ` [net-next-2.6 PATCH 3/3] net: consolidate netif_needs_gso() checks Jeff Kirsher
2010-02-17 13:51 ` Eric Dumazet [this message]
2010-02-17 21:43   ` [net-next-2.6 PATCH 1/3] vlan: adds vlan_dev_select_queue David Miller
2010-02-17 22:40     ` Vasu Dev
2010-02-18  7:37       ` Eric Dumazet
2010-02-19  1:12         ` Vasu Dev

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=1266414675.3246.12.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=vasu.dev@intel.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