From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next,v3 09/12] flow_dissector: add basic ethtool_rx_flow_spec to flow_rule structure translator Date: Thu, 22 Nov 2018 07:21:05 +0100 Message-ID: <20181122062105.GJ2264@nanopsycho> References: <20181121025132.14305-1-pablo@netfilter.org> <20181121025132.14305-10-pablo@netfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Pablo Neira Ayuso , netdev@vger.kernel.org, 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: Florian Fainelli Return-path: Received: from mail-wr1-f67.google.com ([209.85.221.67]:42954 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404654AbeKVRFl (ORCPT ); Thu, 22 Nov 2018 12:05:41 -0500 Received: by mail-wr1-f67.google.com with SMTP id q18so8001099wrx.9 for ; Wed, 21 Nov 2018 22:27:44 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Thu, Nov 22, 2018 at 05:59:27AM CET, f.fainelli@gmail.com wrote: > > >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? The reason is single alloc call for rule and its priv. Quite usual along the code. >-- >Florian