From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [PATCH net-next,v3 09/12] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator Date: Wed, 21 Nov 2018 20:59:27 -0800 Message-ID: References: <20181121025132.14305-1-pablo@netfilter.org> <20181121025132.14305-10-pablo@netfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: davem@davemloft.net, thomas.lendacky@amd.com, ariel.elior@cavium.com, michael.chan@broadcom.com, santosh@chelsio.com, madalin.bucur@nxp.com, yisen.zhuang@huawei.com, salil.mehta@huawei.com, jeffrey.t.kirsher@intel.com, tariqt@mellanox.com, saeedm@mellanox.com, jiri@mellanox.com, idosch@mellanox.com, jakub.kicinski@netronome.com, peppe.cavallaro@st.com, grygorii.strashko@ti.com, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, alexandre.torgue@st.com, joabreu@synopsys.com, linux-net-drivers@solarflare.com, ganeshgr@chelsio.com, ogerlitz@mellanox.com, Manish.Chopra@cavium.com To: Pablo Neira Ayuso , netdev@vger.kernel.org Return-path: Received: from mail-pl1-f195.google.com ([209.85.214.195]:35030 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732537AbeKVPhR (ORCPT ); Thu, 22 Nov 2018 10:37:17 -0500 Received: by mail-pl1-f195.google.com with SMTP id v1-v6so8647846plo.2 for ; Wed, 21 Nov 2018 20:59:38 -0800 (PST) In-Reply-To: <20181121025132.14305-10-pablo@netfilter.org> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 11/20/2018 6:51 PM, Pablo Neira Ayuso wrote: > This patch adds a function to translate the ethtool_rx_flow_spec > structure to the flow_rule representation. > > This allows us to reuse code from the driver side given that both flower > and ethtool_rx_flow interfaces use the same representation. > > Signed-off-by: Pablo Neira Ayuso > --- > v3: Suggested by Jiri Pirko: > - Add struct ethtool_rx_flow_rule, keep placeholder to private > dissector information. > Reported by Manish Chopra: > - Fix incorrect dissector user_keys flags. > > include/linux/ethtool.h | 10 +++ > net/core/ethtool.c | 189 ++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 199 insertions(+) > > diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h > index afd9596ce636..99849e0858b2 100644 > --- a/include/linux/ethtool.h > +++ b/include/linux/ethtool.h > @@ -400,4 +400,14 @@ struct ethtool_ops { > void (*get_ethtool_phy_stats)(struct net_device *, > struct ethtool_stats *, u64 *); > }; > + > +struct ethtool_rx_flow_rule { > + struct flow_rule *rule; > + unsigned long priv[0]; This forces you to cast to/from that member, any reason this is just not a void *priv here? -- Florian