All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Yonglong Li <liyonglong@chinatelecom.cn>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, alexanderduyck@fb.com
Subject: Re: [PATCH v2] net: sort queues in xps maps
Date: Thu, 14 Jul 2022 21:57:48 -0700	[thread overview]
Message-ID: <20220714215748.7699b361@kernel.org> (raw)
In-Reply-To: <1657852318-33812-1-git-send-email-liyonglong@chinatelecom.cn>

On Fri, 15 Jul 2022 10:31:58 +0800 Yonglong Li wrote:
> It is more reasonable that pacekts in the same stream be hashed to the same
> tx queue when all tx queue bind with the same CPUs.
> 
> ---
> v1 -> v2:
> Jakub suggestion: factor out the second loop in __netif_set_xps_queue() -
> starting from the "add tx-queue to CPU/rx-queue maps" comment into a helper
> ---

Please put the changelog under the --- after your s-o-b.
git am will cut off the commit message at the first ---
it finds which means right now it'll cut off before the 
changelog, and also discard your s-o-b.

> Signed-off-by: Yonglong Li <liyonglong@chinatelecom.cn>
> ---
>  net/core/dev.c | 49 ++++++++++++++++++++++++++++++++-----------------
>  1 file changed, 32 insertions(+), 17 deletions(-)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 978ed06..b9ae5d5 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -150,6 +150,7 @@
>  #include <linux/pm_runtime.h>
>  #include <linux/prandom.h>
>  #include <linux/once_lite.h>
> +#include <linux/sort.h>
>  
>  #include "dev.h"
>  #include "net-sysfs.h"
> @@ -199,6 +200,11 @@ static int call_netdevice_notifiers_extack(unsigned long val,
>  
>  static DECLARE_RWSEM(devnet_rename_sem);
>  
> +static int cmp_u16(const void *a, const void *b)
> +{
> +	return *(u16 *)a - *(u16 *)b;
> +}
> +
>  static inline void dev_base_seq_inc(struct net *net)
>  {
>  	while (++net->dev_base_seq == 0)
> @@ -2537,6 +2543,31 @@ static void xps_copy_dev_maps(struct xps_dev_maps *dev_maps,
>  	}
>  }
>  
> +static void update_xps_map(struct xps_map *map, int cpu, u16 index,
> +			   bool *skip_tc, int *numa_node_id,
> +			   enum xps_map_type type)
> +{
> +	int pos = 0;
> +
> +	*skip_tc = true;

Maybe let's keep the skip_tc in the main function, output arguments are
not universally liked in the kernel, and it's just a single line.

Otherwise looks good, thank you!

      reply	other threads:[~2022-07-15  4:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15  2:31 [PATCH v2] net: sort queues in xps maps Yonglong Li
2022-07-15  4:57 ` Jakub Kicinski [this message]

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=20220714215748.7699b361@kernel.org \
    --to=kuba@kernel.org \
    --cc=alexanderduyck@fb.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=liyonglong@chinatelecom.cn \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.