From: Ivan Khoronzhuk > Sent: 13 October 2017 20:59 > On Thu, Oct 12, 2017 at 05:40:03PM -0700, Vinicius Costa Gomes wrote: > > This queueing discipline implements the shaper algorithm defined by > > the 802.1Q-2014 Section 8.6.8.2 and detailed in Annex L. > > > > It's primary usage is to apply some bandwidth reservation to user > > defined traffic classes, which are mapped to different queues via the > > mqprio qdisc. > > > > Only a simple software implementation is added for now. > > > > Signed-off-by: Vinicius Costa Gomes <vinicius.go...@intel.com> > > Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palen...@intel.com> > > --- > > include/uapi/linux/pkt_sched.h | 18 +++ > > net/sched/Kconfig | 11 ++ > > net/sched/Makefile | 1 + > > net/sched/sch_cbs.c | 314 > > +++++++++++++++++++++++++++++++++++++++++ > > 4 files changed, 344 insertions(+) > > create mode 100644 net/sched/sch_cbs.c > > > > diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h > > index 099bf5528fed..41e349df4bf4 100644 > > --- a/include/uapi/linux/pkt_sched.h > > +++ b/include/uapi/linux/pkt_sched.h > > @@ -871,4 +871,22 @@ struct tc_pie_xstats { > > __u32 maxq; /* maximum queue size */ > > __u32 ecn_mark; /* packets marked with ecn*/ > > }; > > + > > +/* CBS */ > > +struct tc_cbs_qopt { > > + __u8 offload;
You probably don't want unnamed padding in a uapi structure. > > + __s32 hicredit; > > + __s32 locredit; > > + __s32 idleslope; > > + __s32 sendslope; > > +}; > > + > > +enum { > > + TCA_CBS_UNSPEC, > > + TCA_CBS_PARMS, > > + __TCA_CBS_MAX, > > +}; > > + > > +#define TCA_CBS_MAX (__TCA_CBS_MAX - 1) Why not: TCA_CBS_PARMS, TCA_CBS_NEXT, TCA_CBS_MAX = TCA_CBS_NEXT - 1, ... David