Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp865790imm; Fri, 1 Jun 2018 10:52:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKINU44zAAJh2zoJRYctwqel14lNaA3yGKHSK/+kK7pkfLsj+rTOQ96Bp847ItmjlcW7H6lV X-Received: by 2002:a17:902:76c9:: with SMTP id j9-v6mr586120plt.15.1527875555137; Fri, 01 Jun 2018 10:52:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527875555; cv=none; d=google.com; s=arc-20160816; b=gnGq4KD0E+LUwtWd/3ROi2uBzKAXJvgT0LlZrN3B+3wMuC0LLhnpxNhuqY2OkO7Aga oomVFv6XWo53n8GOWmTp7lswG+N1hW+nt28Y8lh8AUwd2q1Ch4d7SR/Q0vibrSWJbjif BrDe9saB+l3z/RvrrxgYBT5v7iMne7yn/ZqtgfDg8OIRc3wsUMJg4tx0AU7WJumDvLyt 9A4XRryoI94pCcnhesy9yw9GLywNYpJr4XyOsksuXRjfUpfm9GWbMTn5bUdOLT9S/GMe +bXTBCxola6HDspnPDooTVpsL/h0MUXWDHw7F7h823mdjP5TiCAESGvXQGLjtShcf4cC 46sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=SPicS1aK1bz4i1ZyZRbhCrr/gBkTLenaHXAsw+Tlacs=; b=lG7FHKCGTPUO3GwavfjIJfy78JIYTba0wDgw+eUEN0VlRvn0la0Bx3mPrMsw21epCE 74kJ4d8plDzprP9rlPYtUBDpORO9Z2TLWiD2mf2tNJopnui3qpZLTpHDuoy1H+Or5PG6 qLNXocoC7b1w5Dvnhj6CoxkaGPa417EilHbWI6wiUcPoBRurnd73E3GTWa+TmNOnb8gV bK6A36ScAs3x5B3CuHZK1P19v9s7bAwViOviBYKqj7nlAIICVX+Jul4ODilgXfNhmrNZ sGxmO0yi0yVyTqbXJWO9u98y2Bf+TMFemfXLB8stv01UOA1C/Zc1QYuDA8YO8U9CfMRb yt9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si7450967ply.344.2018.06.01.10.52.20; Fri, 01 Jun 2018 10:52:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752485AbeFARvy (ORCPT + 99 others); Fri, 1 Jun 2018 13:51:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:58067 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751835AbeFARvx (ORCPT ); Fri, 1 Jun 2018 13:51:53 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B3FE5AE71; Fri, 1 Jun 2018 17:51:51 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 0070CA0C48; Fri, 1 Jun 2018 19:51:50 +0200 (CEST) Date: Fri, 1 Jun 2018 19:51:50 +0200 From: Michal Kubecek To: David Ahern Cc: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Dichtel , Tom Herbert Subject: Re: [PATCH net] ipv6: omit traffic class when calculating flow hash Message-ID: <20180601175150.jgmmdygb2pzjvmqo@unicorn.suse.cz> References: <20180601112948.93BE7A0C48@unicorn.suse.cz> <4c70b2ef-20c2-0e7c-d1f6-7d4c97e566f2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4c70b2ef-20c2-0e7c-d1f6-7d4c97e566f2@gmail.com> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 01, 2018 at 10:42:10AM -0600, David Ahern wrote: > > Can you make an inline for the flowlabel conversion. Something like this: > > diff --git a/include/net/ipv6.h b/include/net/ipv6.h > index 798558fd1681..e36eca2f8531 100644 > --- a/include/net/ipv6.h > +++ b/include/net/ipv6.h > @@ -284,6 +284,11 @@ struct ip6_flowlabel { > #define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) > #define IPV6_FLOWLABEL_STATELESS_FLAG cpu_to_be32(0x00080000) > > +static inline u32 flowi6_get_flowlabel(const struct flowi6 *fl6) > +{ > + return (__force u32)(fl6->flowlabel & IPV6_FLOWLABEL_MASK); > +} > + > #define IPV6_TCLASS_MASK (IPV6_FLOWINFO_MASK & ~IPV6_FLOWLABEL_MASK) > #define IPV6_TCLASS_SHIFT 20 > > From there we can fix the flow struct to have flowinfo instead of > flowlabel and use the macro to hide the conversion. I'll send v2 with inline helper. I'm just not sure about including the cast as this way the helper would be useful for hash key which is not clear from the name. So it seems more appropriate to either introduce a helper which just does the masking or helper which does also the copying into struct flow_keys. Michal Kubecek