[PATCH] qdisc: add hfsc qdisc support

Thomas Haller thaller at redhat.com
Sat Jul 26 08:22:28 PDT 2014


Hi Cong,




> diff --git a/include/netlink/route/qdisc/hfsc.h b/include/netlink/route/qdisc/hfsc.h
> new file mode 100644
> index 0000000..7cf1c76
> --- /dev/null
> +extern uint32_t	rtnl_hfsc_get_defcls(struct rtnl_qdisc *);
> +extern int	rtnl_hfsc_set_defcls(struct rtnl_qdisc *, uint32_t);
> +
> +extern int rtnl_hfsc_get_rsc(struct rtnl_class *class, struct tc_service_curve *tsc);
> +extern int rtnl_hfsc_set_rsc(struct rtnl_class *class, const struct tc_service_curve *tsc);
> +extern int rtnl_hfsc_get_fsc(struct rtnl_class *class, struct tc_service_curve *tsc);
> +extern int rtnl_hfsc_set_fsc(struct rtnl_class *class, const struct tc_service_curve *tsc);
> +extern int rtnl_hfsc_get_usc(struct rtnl_class *class, struct tc_service_curve *tsc);
> +extern int rtnl_hfsc_set_usc(struct rtnl_class *class, const struct tc_service_curve *tsc);


I wonder, is it correct that all functions have rtnl_hfsc_* as prefix,
but some operate on rtnl_qdisc, others on rtnl_class.

How about a separate prefix for the function names?





> diff --git a/lib/route/qdisc/hfsc.c b/lib/route/qdisc/hfsc.c
> new file mode 100644
> index 0000000..c83f1fa
> --- /dev/null
> +++ b/lib/route/qdisc/hfsc.c

> +/** @cond SKIP */
> +#define SCH_HFSC_HAS_RSC		0x001
> +#define SCH_HFSC_HAS_FSC		0x002
> +#define SCH_HFSC_HAS_USC		0x004
> +
> +#define SCH_HFSC_HAS_DEFCLS		0x01
> +/** @endcond */


Same here. How about different prefixes for these names?



> +int rtnl_hfsc_set_defcls(struct rtnl_qdisc *qdisc, uint32_t defcls)
> +{
> +	struct rtnl_hfsc_qdisc *hfsc;
> +
> +	if (!(hfsc = hfsc_qdisc_data(qdisc)))
> +		return -NLE_OPNOTSUPP;

shouldn't the set function allocate some data if it is not allocated yet
(and possibly fail with -NLE_NOMEM)?

And the same for other _set_ functions.




The rest looks good to me,
Thomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20140726/cc3fdf1f/attachment.sig>


More information about the libnl mailing list