From: David Miller <davem@davemloft.net>
To: therbert@google.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v2 02/17] net: Add utility function to set the rxhash
Date: Fri, 29 Nov 2013 15:42:28 -0500 (EST) [thread overview]
Message-ID: <20131129.154228.1595262198220391193.davem@davemloft.net> (raw)
In-Reply-To: <alpine.DEB.2.02.1311260913480.21024@tomh.mtv.corp.google.com>
From: Tom Herbert <therbert@google.com>
Date: Tue, 26 Nov 2013 09:22:34 -0800 (PST)
> @@ -703,6 +703,20 @@ unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
> unsigned int to, struct ts_config *config,
> struct ts_state *state);
>
> +enum rxhash_types {
> + RXHASH_TYPE_NONE, /* Undefined type */
> + RXHASH_TYPE_L2, /* Uses L2 information (addresses) */
> + RXHASH_TYPE_L3, /* Uses L3 information */
> + RXHASH_TYPE_L4, /* Uses L4 information (ports) */
> +};
> +
> +static inline void
> +skb_set_rxhash(struct sk_buff *skb, __u32 hash, enum rxhash_types type)
> +{
> + skb->l4_rxhash = (type == RXHASH_TYPE_L4);
> + skb->rxhash = hash;
> +}
This looks fine but I want slightly more documentation in the
comments.
First of all, L2 is link layer "addresses" like ethernet, and L3 is
for protocol "addresses" such as for IPv4/IPv6. Make this explicit
in the comments.
Next, answer the question "Does RXHASH_TYPE_LN imply
RXHASH_TYPE_L{N-1}?"
I suspect it's variable, so for example L4 implies L3, but not
necessarily L2. Document this fully.
Finally, are there any serious negative consequences for not setting
the type correctly? Or is it just a minor performance issue? Either
way, document it.
Thanks.
prev parent reply other threads:[~2013-11-29 20:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-26 17:22 [PATCH v2 02/17] net: Add utility function to set the rxhash Tom Herbert
2013-11-29 20:42 ` David Miller [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=20131129.154228.1595262198220391193.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.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