All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Kubecek <mkubecek@suse.cz>
To: David Ahern <dsahern@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Tom Herbert <tom@herbertland.com>
Subject: Re: [PATCH net] ipv6: omit traffic class when calculating flow hash
Date: Fri, 1 Jun 2018 19:51:50 +0200	[thread overview]
Message-ID: <20180601175150.jgmmdygb2pzjvmqo@unicorn.suse.cz> (raw)
In-Reply-To: <4c70b2ef-20c2-0e7c-d1f6-7d4c97e566f2@gmail.com>

On Fri, Jun 01, 2018 at 10:42:10AM -0600, David Ahern wrote:
> 
> Can you make an inline for the flowlabel conversion. Something like this:
> 
> diff --git a/include/net/ipv6.h b/include/net/ipv6.h
> index 798558fd1681..e36eca2f8531 100644
> --- a/include/net/ipv6.h
> +++ b/include/net/ipv6.h
> @@ -284,6 +284,11 @@ struct ip6_flowlabel {
>  #define IPV6_FLOWLABEL_MASK            cpu_to_be32(0x000FFFFF)
>  #define IPV6_FLOWLABEL_STATELESS_FLAG  cpu_to_be32(0x00080000)
> 
> +static inline u32 flowi6_get_flowlabel(const struct flowi6 *fl6)
> +{
> +       return (__force u32)(fl6->flowlabel & IPV6_FLOWLABEL_MASK);
> +}
> +
>  #define IPV6_TCLASS_MASK (IPV6_FLOWINFO_MASK & ~IPV6_FLOWLABEL_MASK)
>  #define IPV6_TCLASS_SHIFT      20
> 
> From there we can fix the flow struct to have flowinfo instead of
> flowlabel and use the macro to hide the conversion.

I'll send v2 with inline helper. I'm just not sure about including the
cast as this way the helper would be useful for hash key which is not
clear from the name. So it seems more appropriate to either introduce a
helper which just does the masking or helper which does also the copying
into struct flow_keys.

Michal Kubecek

  reply	other threads:[~2018-06-01 17:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01 10:34 [PATCH net] ipv6: omit traffic class when calculating flow hash Michal Kubecek
2018-06-01 12:25 ` Nicolas Dichtel
2018-06-01 16:42 ` David Ahern
2018-06-01 17:51   ` Michal Kubecek [this message]
2018-06-01 17:55     ` David Ahern
2018-06-01 18:19 ` Ido Schimmel
2018-06-02  7:54   ` Michal Kubecek

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=20180601175150.jgmmdygb2pzjvmqo@unicorn.suse.cz \
    --to=mkubecek@suse.cz \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=tom@herbertland.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.