Message ID | 20231201204314.220543-3-pctammela@mojatatu.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net/sched: conditional notification of events for cls and act | expand |
On Fri, 1 Dec 2023 17:43:12 -0300 Pedro Tammela wrote: > +static inline bool tc_should_notify(const struct net *net, u16 nlflags) nit: tc_notify_needed() ? doesn't matter > +{ > + return (nlflags & NLM_F_ECHO) || rtnl_has_listeners(net, RTNLGRP_TC); I think it'd be nice to have an rtnl_* helper which looks at the flags as well. With a proper kdoc. Maybe someone will notice that and remember to implement F_ECHO for their command?
On 02/12/2023 16:18, Jakub Kicinski wrote: >> +{ >> + return (nlflags & NLM_F_ECHO) || rtnl_has_listeners(net, RTNLGRP_TC); > > I think it'd be nice to have an rtnl_* helper which looks at the flags > as well. With a proper kdoc. Maybe someone will notice that and remember > to implement F_ECHO for their command? Ack, will change this to a generic rtnl helper
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index a76c9171db0e..39c24cf30984 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -1065,4 +1065,9 @@ static inline void tc_skb_ext_tc_disable(void) { } #define tc_skb_ext_tc_enabled() false #endif +static inline bool tc_should_notify(const struct net *net, u16 nlflags) +{ + return (nlflags & NLM_F_ECHO) || rtnl_has_listeners(net, RTNLGRP_TC); +} + #endif