From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Herbert Subject: [PATCH net-next 2/7] sched: Eliminate use of flow_keys in sch_fq_codel Date: Tue, 28 Apr 2015 21:27:36 -0700 Message-ID: <1430281661-2271966-3-git-send-email-tom@herbertland.com> References: <1430281661-2271966-1-git-send-email-tom@herbertland.com> Mime-Version: 1.0 Content-Type: text/plain Cc: To: , Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:39978 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752650AbbD2E2H (ORCPT ); Wed, 29 Apr 2015 00:28:07 -0400 Received: from pps.filterd (m0044010 [127.0.0.1]) by mx0a-00082601.pphosted.com (8.14.5/8.14.5) with SMTP id t3T4PGfd004735 for ; Tue, 28 Apr 2015 21:28:07 -0700 Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 1u2k1ygfmt-2 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Tue, 28 Apr 2015 21:28:07 -0700 Received: from facebook.com (2401:db00:20:702e:face:0:23:0) by mx-out.facebook.com (10.212.236.89) with ESMTP id 2199e6a2ee2811e48b1a0002c95209d8-e51c62c0 for ; Tue, 28 Apr 2015 21:28:05 -0700 In-Reply-To: <1430281661-2271966-1-git-send-email-tom@herbertland.com> Sender: netdev-owner@vger.kernel.org List-ID: Call qdisc_skb_get_hash instead of doing skb_flow_dissect and then jhash by hand. Signed-off-by: Tom Herbert --- net/sched/sch_fq_codel.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c index 1e52dec..a6fc53d 100644 --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c @@ -23,7 +23,6 @@ #include #include #include -#include #include /* Fair Queue CoDel. @@ -68,15 +67,9 @@ struct fq_codel_sched_data { }; static unsigned int fq_codel_hash(const struct fq_codel_sched_data *q, - const struct sk_buff *skb) + struct sk_buff *skb) { - struct flow_keys keys; - unsigned int hash; - - skb_flow_dissect(skb, &keys); - hash = jhash_3words((__force u32)keys.dst, - (__force u32)keys.src ^ keys.ip_proto, - (__force u32)keys.ports, q->perturbation); + u32 hash = skb_get_hash_perturb(skb, q->perturbation); return reciprocal_scale(hash, q->flows_cnt); } -- 1.8.1