From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vlad Buslov Subject: [PATCH net-next 13/13] net: sched: add flags to Qdisc class ops struct Date: Thu, 6 Sep 2018 10:59:02 +0300 Message-ID: <1536220742-25650-14-git-send-email-vladbu@mellanox.com> References: <1536220742-25650-1-git-send-email-vladbu@mellanox.com> Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, stephen@networkplumber.org, ktkhai@virtuozzo.com, paulmck@linux.vnet.ibm.com, nicolas.dichtel@6wind.com, leon@kernel.org, gregkh@linuxfoundation.org, mark.rutland@arm.com, fw@strlen.de, dsahern@gmail.com, lucien.xin@gmail.com, jakub.kicinski@netronome.com, christian.brauner@ubuntu.com, jbenc@redhat.com, Vlad Buslov To: netdev@vger.kernel.org Return-path: Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:45992 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728098AbeIFMd3 (ORCPT ); Thu, 6 Sep 2018 08:33:29 -0400 In-Reply-To: <1536220742-25650-1-git-send-email-vladbu@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: Extend Qdisc_class_ops with flags. Create enum to hold possible class ops flag values. Add first class ops flags value QDISC_CLASS_OPS_DOIT_UNLOCKED to indicate that class ops functions can be called without taking rtnl lock. Signed-off-by: Vlad Buslov Acked-by: Jiri Pirko --- include/net/sch_generic.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 2b87b47c49f6..bc4082961726 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -174,6 +174,7 @@ static inline int qdisc_avail_bulklimit(const struct netdev_queue *txq) } struct Qdisc_class_ops { + unsigned int flags; /* Child qdisc manipulation */ struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *); int (*graft)(struct Qdisc *, unsigned long cl, @@ -205,6 +206,13 @@ struct Qdisc_class_ops { struct gnet_dump *); }; +/* Qdisc_class_ops flag values */ + +/* Implements API that doesn't require rtnl lock */ +enum qdisc_class_ops_flags { + QDISC_CLASS_OPS_DOIT_UNLOCKED = 1, +}; + struct Qdisc_ops { struct Qdisc_ops *next; const struct Qdisc_class_ops *cl_ops; -- 2.7.5