From patchwork Sun Mar 22 08:04:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 453098 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BF8A11400DD for ; Sun, 22 Mar 2015 19:04:37 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751832AbbCVIEd (ORCPT ); Sun, 22 Mar 2015 04:04:33 -0400 Received: from ringil.hengli.com.au ([178.18.16.133]:60226 "EHLO ringil.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762AbbCVIEX (ORCPT ); Sun, 22 Mar 2015 04:04:23 -0400 Received: from gondolin.me.apana.org.au ([192.168.0.6]) by norbury.hengli.com.au with esmtp (Exim 4.80 #3 (Debian)) id 1YZara-0000bO-MX; Sun, 22 Mar 2015 19:04:02 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 4.80) (envelope-from ) id 1YZara-0000vP-C0; Sun, 22 Mar 2015 19:04:02 +1100 Subject: [v2 PATCH 4/10] netlink: Use default rhashtable hashfn References: <20150322080330.GA3416@gondor.apana.org.au> To: "David S. Miller" , Thomas Graf , Eric Dumazet , Patrick McHardy , Josh Triplett , "Paul E. McKenney" , netdev@vger.kernel.org Message-Id: From: Herbert Xu Date: Sun, 22 Mar 2015 19:04:02 +1100 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch removes the explicit jhash value for the hashfn parameter of rhashtable. The default is now jhash so removing the setting makes no difference apart from making one less copy of jhash in the kernel. Signed-off-by: Herbert Xu Acked-by: Thomas Graf --- net/netlink/af_netlink.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 6517921..e2f7f28 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -3133,13 +3133,12 @@ static inline u32 netlink_hash(const void *data, u32 seed) struct netlink_compare_arg arg; netlink_compare_arg_init(&arg, sock_net(&nlk->sk), nlk->portid); - return jhash(&arg, netlink_compare_arg_len, seed); + return jhash2((u32 *)&arg, netlink_compare_arg_len / sizeof(u32), seed); } static const struct rhashtable_params netlink_rhashtable_params = { .head_offset = offsetof(struct netlink_sock, node), .key_len = netlink_compare_arg_len, - .hashfn = jhash, .obj_hashfn = netlink_hash, .obj_cmpfn = netlink_compare, .max_size = 65536,