From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next 2/7] net: sched: add tcf_proto_op to offload a rule Date: Mon, 25 Jun 2018 22:43:42 +0200 Message-ID: <20180625204342.GF2161@nanopsycho> References: <20180625043431.13413-1-jakub.kicinski@netronome.com> <20180625043431.13413-3-jakub.kicinski@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: davem@davemloft.net, xiyou.wangcong@gmail.com, jhs@mojatatu.com, gerlitz.or@gmail.com, netdev@vger.kernel.org, oss-drivers@netronome.com, John Hurley To: Jakub Kicinski Return-path: Received: from mail-wr0-f193.google.com ([209.85.128.193]:39201 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934686AbeFYUpE (ORCPT ); Mon, 25 Jun 2018 16:45:04 -0400 Received: by mail-wr0-f193.google.com with SMTP id b8-v6so9546772wro.6 for ; Mon, 25 Jun 2018 13:45:03 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180625043431.13413-3-jakub.kicinski@netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: Mon, Jun 25, 2018 at 06:34:26AM CEST, jakub.kicinski@netronome.com wrote: >From: John Hurley > >Create a new tcf_proto_op called 'reoffload' that generates a new offload >message for each node in a tcf_proto. Pointers to the tcf_proto and >whether the offload request is to add or delete the node are included. >Also included is a callback function to send the offload message to and >the option of priv data to go with the cb. > >Signed-off-by: John Hurley >Signed-off-by: Jakub Kicinski >--- > include/net/act_api.h | 3 --- > include/net/sch_generic.h | 6 ++++++ > 2 files changed, 6 insertions(+), 3 deletions(-) > >diff --git a/include/net/act_api.h b/include/net/act_api.h >index 9e59ebfded62..5ff11adbe2a6 100644 >--- a/include/net/act_api.h >+++ b/include/net/act_api.h >@@ -190,9 +190,6 @@ static inline void tcf_action_stats_update(struct tc_action *a, u64 bytes, > #endif > } > >-typedef int tc_setup_cb_t(enum tc_setup_type type, >- void *type_data, void *cb_priv); >- > #ifdef CONFIG_NET_CLS_ACT > int tc_setup_cb_egdev_register(const struct net_device *dev, > tc_setup_cb_t *cb, void *cb_priv); >diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h >index 6488daa32f82..88ed64f60056 100644 >--- a/include/net/sch_generic.h >+++ b/include/net/sch_generic.h >@@ -20,6 +20,9 @@ struct qdisc_walker; > struct tcf_walker; > struct module; > >+typedef int tc_setup_cb_t(enum tc_setup_type type, >+ void *type_data, void *cb_priv); >+ > struct qdisc_rate_table { > struct tc_ratespec rate; > u32 data[256]; >@@ -256,6 +259,9 @@ struct tcf_proto_ops { > bool *last, > struct netlink_ext_ack *); > void (*walk)(struct tcf_proto*, struct tcf_walker *arg); >+ int (*reoffload)(struct tcf_proto *, bool, >+ tc_setup_cb_t *, void *, >+ struct netlink_ext_ack *); Please, name the args. Unnamed args are annoying... > void (*bind_class)(void *, u32, unsigned long); > > /* rtnetlink specific */ >-- >2.17.1 >