From: Tom Herbert <tom@herbertland.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Subject: [PATCH v2 net-next 0/5] net: Increase inputs to flow_keys hashing
Date: Mon, 11 May 2015 20:26:39 -0700 [thread overview]
Message-ID: <1431401204-731380-1-git-send-email-tom@herbertland.com> (raw)
This patch set adds new fields to the flow_keys structure and hashes
over these fields to get a better flow hash. In particular, these
patches now include hashing over the full IPv6 addresses in order
to defend against address spoofing that always results in the
same hash. The new input also includes the Ethertype, L4 protocol,
VLAN, flow label, GRE keyid, and MPLS entropy label.
In order to increase hash inputs, we switch to using jhash2
which operates an an array of u32's. jhash2 operates on multiples of
three words. The data in the hash is constructed for that, and there
are are two variants for IPv4 and Ipv6 addressing. For IPv4 addresses,
jhash is performed over six u32's and for IPv6 it is done over twelve.
flow_keys can store either IPv4 or IPv6 addresses (addr_proto field
is a selector). ipv6_addr_hash is no longer used to convert addresses
for setting in flow table. For legacy uses of flow keys outside of
flow_dissector the flow_get_u32_src and flow_get_u32_dst functions
have been added to get u32 representation representations of addresses
in flow_keys.
For flow lables we also eliminate the short circuit in flow_dissector
for non-zero flow label. The flow label is now considered additional
input to ports.
Testing: Ran netperf TCP_RR for 200 flows using IPv4 and IPv6 comparing
before the patches and with the patches. Did not detect nay performance
degradation.
v2:
- Took out MPLS entropy label. Will add this later.
Tom Herbert (5):
net: Get skb hash over flow_keys structure
net: Add full IPv6 addresses to flow_keys
net: Add VLAN ID to flow_keys
net: Add IPv6 flow label to flow_keys
net: Add GRE keyid in flow_keys
drivers/net/bonding/bond_main.c | 9 +-
drivers/net/ethernet/cisco/enic/enic_clsf.c | 8 +-
drivers/net/ethernet/cisco/enic/enic_ethtool.c | 4 +-
include/net/flow_keys.h | 44 ++++++-
include/net/ip.h | 21 +++-
include/net/ipv6.h | 21 +++-
net/core/flow_dissector.c | 159 +++++++++++++++++--------
net/sched/cls_flow.c | 14 ++-
8 files changed, 208 insertions(+), 72 deletions(-)
--
1.8.1
next reply other threads:[~2015-05-12 3:27 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 3:26 Tom Herbert [this message]
2015-05-12 3:26 ` [PATCH v2 net-next 1/5] net: Get skb hash over flow_keys structure Tom Herbert
2015-05-12 4:56 ` Eric Dumazet
2015-05-12 14:30 ` David Miller
2015-05-12 3:26 ` [PATCH v2 net-next 2/5] net: Add full IPv6 addresses to flow_keys Tom Herbert
2015-05-12 3:26 ` [PATCH v2 net-next 3/5] net: Add VLAN ID " Tom Herbert
2015-05-12 3:26 ` [PATCH v2 net-next 4/5] net: Add IPv6 flow label " Tom Herbert
2015-05-12 3:26 ` [PATCH v2 net-next 5/5] net: Add GRE keyid in flow_keys Tom Herbert
2015-05-12 4:33 ` Eric Dumazet
2015-05-12 4:50 ` Eric Dumazet
2015-05-12 14:51 ` Tom Herbert
2015-05-12 16:06 ` Eric Dumazet
2015-05-15 12:48 ` [PATCH net-next] net: fix two sparse errors Eric Dumazet
2015-05-15 14:35 ` Sabrina Dubroca
2015-05-15 14:52 ` Eric Dumazet
2015-05-15 15:23 ` Sabrina Dubroca
2015-05-15 16:14 ` Eric Dumazet
2015-05-15 15:27 ` Tom Herbert
2015-05-15 15:54 ` Sabrina Dubroca
2015-05-15 16:19 ` David Miller
2015-05-15 16:26 ` Sabrina Dubroca
2015-05-15 15:11 ` Tom Herbert
2015-05-17 18:11 ` David Miller
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=1431401204-731380-1-git-send-email-tom@herbertland.com \
--to=tom@herbertland.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;
as well as URLs for NNTP newsgroup(s).