From: Tom Herbert <therbert@google.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 02/17] net: Add function to set the rxhash
Date: Mon, 25 Nov 2013 21:48:17 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.02.1311252146100.22983@tomh.mtv.corp.google.com> (raw)
The function skb_set_rxash was added for drivers to call to set
the rxhash in an skb. The type of hash is also specified as
a parameter (L2, L3, L4, or unknown type).
Signed-off-by: Tom Herbert <therbert@google.com>
---
include/linux/skbuff.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 76d3aa9..25f190e 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -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;
+}
+
void __skb_get_rxhash(struct sk_buff *skb);
static inline __u32 skb_get_rxhash(struct sk_buff *skb)
{
--
1.8.4.1
reply other threads:[~2013-11-26 5:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=alpine.DEB.2.02.1311252146100.22983@tomh.mtv.corp.google.com \
--to=therbert@google.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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