[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2527cab9-e952-9f69-4f06-06f23ec4a212@gmail.com>
Date: Thu, 14 Dec 2017 13:02:26 -0700
From: David Ahern <dsahern@...il.com>
To: Alexander Aring <aring@...atatu.com>, jhs@...atatu.com
Cc: xiyou.wangcong@...il.com, jiri@...nulli.us, davem@...emloft.net,
netdev@...r.kernel.org, kernel@...atatu.com,
David Ahern <dsahern@...il.com>
Subject: Re: [PATCHv2 net-next 09/15] net: sch: api: add extack support in
qdisc_get_rtab
On 12/14/17 11:38 AM, Alexander Aring wrote:
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index 816e8b0c2609..24b286d763b7 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -393,13 +393,16 @@ static __u8 __detect_linklayer(struct tc_ratespec *r, __u32 *rtab)
> static struct qdisc_rate_table *qdisc_rtab_list;
>
> struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
> - struct nlattr *tab)
> + struct nlattr *tab,
> + struct netlink_ext_ack *extack)
> {
> struct qdisc_rate_table *rtab;
>
> if (tab == NULL || r->rate == 0 || r->cell_log == 0 ||
> - nla_len(tab) != TC_RTAB_SIZE)
> + nla_len(tab) != TC_RTAB_SIZE) {
> + NL_SET_ERR_MSG(extack, "Invalid rtab parameters for searching");
What is rtab short for? Can you expand that to something meaningful to
the user?
> return NULL;
> + }
>
> for (rtab = qdisc_rtab_list; rtab; rtab = rtab->next) {
> if (!memcmp(&rtab->rate, r, sizeof(struct tc_ratespec)) &&
> @@ -418,6 +421,8 @@ struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
> r->linklayer = __detect_linklayer(r, rtab->data);
> rtab->next = qdisc_rtab_list;
> qdisc_rtab_list = rtab;
> + } else {
> + NL_SET_ERR_MSG(extack, "Failed to allocate new qdisc rtab");
ditto here
Powered by blists - more mailing lists