Commit a5b64700 authored by Vedang Patel's avatar Vedang Patel Committed by David S. Miller

fix: taprio: Change type of txtime-delay parameter to u32

During the review of the iproute2 patches for txtime-assist mode, it was
pointed out that it does not make sense for the txtime-delay parameter to
be negative. So, change the type of the parameter from s32 to u32.

Fixes: 4cfd5779 ("taprio: Add support for txtime-assist mode")
Reported-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Signed-off-by: default avatarVedang Patel <vedang.patel@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db8051f3
...@@ -1174,7 +1174,7 @@ enum { ...@@ -1174,7 +1174,7 @@ enum {
TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME, /* s64 */ TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME, /* s64 */
TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, /* s64 */ TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME_EXTENSION, /* s64 */
TCA_TAPRIO_ATTR_FLAGS, /* u32 */ TCA_TAPRIO_ATTR_FLAGS, /* u32 */
TCA_TAPRIO_ATTR_TXTIME_DELAY, /* s32 */ TCA_TAPRIO_ATTR_TXTIME_DELAY, /* u32 */
__TCA_TAPRIO_ATTR_MAX, __TCA_TAPRIO_ATTR_MAX,
}; };
......
...@@ -75,7 +75,7 @@ struct taprio_sched { ...@@ -75,7 +75,7 @@ struct taprio_sched {
struct sched_gate_list __rcu *admin_sched; struct sched_gate_list __rcu *admin_sched;
struct hrtimer advance_timer; struct hrtimer advance_timer;
struct list_head taprio_list; struct list_head taprio_list;
int txtime_delay; u32 txtime_delay;
}; };
static ktime_t sched_base_time(const struct sched_gate_list *sched) static ktime_t sched_base_time(const struct sched_gate_list *sched)
...@@ -1113,7 +1113,7 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt, ...@@ -1113,7 +1113,7 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
goto unlock; goto unlock;
} }
q->txtime_delay = nla_get_s32(tb[TCA_TAPRIO_ATTR_TXTIME_DELAY]); q->txtime_delay = nla_get_u32(tb[TCA_TAPRIO_ATTR_TXTIME_DELAY]);
} }
if (!TXTIME_ASSIST_IS_ENABLED(taprio_flags) && if (!TXTIME_ASSIST_IS_ENABLED(taprio_flags) &&
...@@ -1430,7 +1430,7 @@ static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb) ...@@ -1430,7 +1430,7 @@ static int taprio_dump(struct Qdisc *sch, struct sk_buff *skb)
goto options_error; goto options_error;
if (q->txtime_delay && if (q->txtime_delay &&
nla_put_s32(skb, TCA_TAPRIO_ATTR_TXTIME_DELAY, q->txtime_delay)) nla_put_u32(skb, TCA_TAPRIO_ATTR_TXTIME_DELAY, q->txtime_delay))
goto options_error; goto options_error;
if (oper && dump_schedule(skb, oper)) if (oper && dump_schedule(skb, oper))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment