netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Herbert <tom@herbertland.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Amritha Nambiar <amritha.nambiar@intel.com>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Alexander Duyck <alexander.h.duyck@intel.com>,
	Sridhar Samudrala <sridhar.samudrala@intel.com>,
	Eric Dumazet <edumazet@google.com>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>
Subject: Re: [net-next PATCH v2 2/4] net: Enable Tx queue selection based on Rx queues
Date: Mon, 21 May 2018 07:51:27 -0700	[thread overview]
Message-ID: <CALx6S36h=gGb1LkLuJ80DUrE=m+FhbcQ0AD94AdtEUvxJfHf=g@mail.gmail.com> (raw)
In-Reply-To: <CAF=yD-JghZY5NN6cHGdHeOTs8xb9KF=mQ=J2P49ojrvp+MsD8w@mail.gmail.com>

On Sat, May 19, 2018 at 1:27 PM, Willem de Bruijn
<willemdebruijn.kernel@gmail.com> wrote:
> On Sat, May 19, 2018 at 4:13 PM, Willem de Bruijn
> <willemdebruijn.kernel@gmail.com> wrote:
>> On Fri, May 18, 2018 at 12:03 AM, Tom Herbert <tom@herbertland.com> wrote:
>>> On Tue, May 15, 2018 at 6:26 PM, Amritha Nambiar
>>> <amritha.nambiar@intel.com> wrote:
>>>> This patch adds support to pick Tx queue based on the Rx queue map
>>>> configuration set by the admin through the sysfs attribute
>>>> for each Tx queue. If the user configuration for receive
>>>> queue map does not apply, then the Tx queue selection falls back
>>>> to CPU map based selection and finally to hashing.
>>>>
>>>> Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
>>>> Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
>>>> ---
>
>>>> +static int get_xps_queue(struct net_device *dev, struct sk_buff *skb)
>>>> +{
>>>> +#ifdef CONFIG_XPS
>>>> +       enum xps_map_type i = XPS_MAP_RXQS;
>>>> +       struct xps_dev_maps *dev_maps;
>>>> +       struct sock *sk = skb->sk;
>>>> +       int queue_index = -1;
>>>> +       unsigned int tci = 0;
>>>> +
>>>> +       if (sk && sk->sk_rx_queue_mapping <= dev->real_num_rx_queues &&
>>>> +           dev->ifindex == sk->sk_rx_ifindex)
>>>> +               tci = sk->sk_rx_queue_mapping;
>>>> +
>>>> +       rcu_read_lock();
>>>> +       while (queue_index < 0 && i < __XPS_MAP_MAX) {
>>>> +               if (i == XPS_MAP_CPUS)
>>>
>>> This while loop typifies exactly why I don't think the XPS maps should
>>> be an array.
>>
>> +1
>
> as a matter of fact, as enabling both cpu and rxqueue map at the same
> time makes no sense, only one map is needed at any one time. The
> only difference is in how it is indexed. It should probably not be possible
> to configure both at the same time. Keeping a single map probably also
> significantly simplifies patch 1/4.

Willem,

I think it might makes sense to have them both. Maybe one application
is spin polling that needs this, where others might be happy with
normal CPU mappings as default.

Tom

  reply	other threads:[~2018-05-21 14:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16  1:26 [net-next PATCH v2 0/4] Symmetric queue selection using XPS for Rx queues Amritha Nambiar
2018-05-16  1:26 ` [net-next PATCH v2 1/4] net: Refactor XPS for CPUs and " Amritha Nambiar
2018-05-17 18:38   ` David Miller
2018-05-17 18:47     ` Nambiar, Amritha
2018-05-18  4:08   ` Tom Herbert
2018-05-23 18:59     ` Nambiar, Amritha
2018-05-21  5:38   ` [lkp-robot] [net] 3416099d53: net/core/dev.c:#suspicious_rcu_dereference_protected()usage kernel test robot
2018-05-16  1:26 ` [net-next PATCH v2 2/4] net: Enable Tx queue selection based on Rx queues Amritha Nambiar
2018-05-18  4:03   ` Tom Herbert
2018-05-19 20:13     ` Willem de Bruijn
2018-05-19 20:27       ` Willem de Bruijn
2018-05-21 14:51         ` Tom Herbert [this message]
2018-05-21 15:12           ` Willem de Bruijn
2018-05-22 14:09             ` Tom Herbert
2018-05-23 19:31               ` Nambiar, Amritha
2018-05-23 19:19       ` Nambiar, Amritha
2018-05-16  1:26 ` [net-next PATCH v2 3/4] net-sysfs: Add interface for Rx queue map per Tx queue Amritha Nambiar
2018-05-17 19:05   ` Florian Fainelli
2018-05-17 22:43     ` Nambiar, Amritha
2018-05-16  1:27 ` [net-next PATCH v2 4/4] Documentation: Add explanation for XPS using Rx-queue map Amritha Nambiar
2018-05-18  4:11 ` [net-next PATCH v2 0/4] Symmetric queue selection using XPS for Rx queues Tom Herbert

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='CALx6S36h=gGb1LkLuJ80DUrE=m+FhbcQ0AD94AdtEUvxJfHf=g@mail.gmail.com' \
    --to=tom@herbertland.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=amritha.nambiar@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hannes@stressinduktion.org \
    --cc=netdev@vger.kernel.org \
    --cc=sridhar.samudrala@intel.com \
    --cc=willemdebruijn.kernel@gmail.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).