From: David Ahern <dsahern@kernel.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, David Ahern <dsahern@gmail.com>
Subject: [PATCH net-next 3/7] net/ipv4: Move arp_hashfn into arp_hash
Date: Wed, 5 Dec 2018 15:34:10 -0800 [thread overview]
Message-ID: <20181205233414.1386-4-dsahern@kernel.org> (raw)
In-Reply-To: <20181205233414.1386-1-dsahern@kernel.org>
From: David Ahern <dsahern@gmail.com>
There are no more direct references to arp_hashfn so fold it into
arp_hash, the hash callback for arp.
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/net/arp.h | 8 --------
net/ipv4/arp.c | 5 ++++-
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/include/net/arp.h b/include/net/arp.h
index a5091f13cd3e..9f433c077b67 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -10,14 +10,6 @@
extern struct neigh_table arp_tbl;
-static inline u32 arp_hashfn(const void *pkey, const struct net_device *dev, u32 *hash_rnd)
-{
- u32 key = *(const u32 *)pkey;
- u32 val = key ^ hash32_ptr(dev);
-
- return val * hash_rnd[0];
-}
-
static inline struct neighbour *__ipv4_neigh_lookup_noref(struct net_device *dev, u32 key)
{
if (dev->flags & (IFF_LOOPBACK | IFF_POINTOPOINT))
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 850a6f13a082..6b88211287ae 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -213,7 +213,10 @@ static u32 arp_hash(const void *pkey,
const struct net_device *dev,
__u32 *hash_rnd)
{
- return arp_hashfn(pkey, dev, hash_rnd);
+ u32 key = *(const u32 *)pkey;
+ u32 val = key ^ hash32_ptr(dev);
+
+ return val * hash_rnd[0];
}
static bool arp_key_eq(const struct neighbour *neigh, const void *pkey)
--
2.11.0
next prev parent reply other threads:[~2018-12-05 23:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 23:34 [PATCH net-next 0/7] neighbor: cleanups plus extack for add and delete David Ahern
2018-12-05 23:34 ` [PATCH net-next 1/7] neighbor: Remove open coding of key and hash functions David Ahern
2018-12-05 23:34 ` [PATCH net-next 2/7] neighbor: Fold ___neigh_lookup_noref into __neigh_lookup_noref David Ahern
2018-12-06 0:44 ` David Miller
2018-12-06 0:46 ` David Ahern
2018-12-06 0:48 ` David Ahern
2018-12-06 0:50 ` David Miller
2018-12-05 23:34 ` David Ahern [this message]
2018-12-05 23:34 ` [PATCH net-next 4/7] net/ipv6: Move ndisc_hashfn to ndisc_hash David Ahern
2018-12-05 23:34 ` [PATCH net-next 5/7] neighbor: Create a neigh_hash helper David Ahern
2018-12-05 23:34 ` [PATCH net-next 6/7] neighbor: Skip the duplicate lookup in neigh_add David Ahern
2018-12-05 23:34 ` [PATCH net-next 7/7] neighbor: Add extack messages for add and delete commands David Ahern
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=20181205233414.1386-4-dsahern@kernel.org \
--to=dsahern@kernel.org \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--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 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.