netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next 1/1] taprio: fix wrong for loop condition in add_tc_entries()
@ 2022-12-02  6:25 Tan Tee Min
  2022-12-02 16:00 ` patchwork-bot+netdevbpf
  2022-12-05 17:23 ` Vladimir Oltean
  0 siblings, 2 replies; 3+ messages in thread
From: Tan Tee Min @ 2022-12-02  6:25 UTC (permalink / raw)
  To: netdev
  Cc: David Ahern, Stephen Hemminger, Vladimir Oltean,
	Vinicius Costa Gomes, Muhammad Husaini Zulkifli

The for loop in add_tc_entries() mistakenly included the last entry
index+1. Fix it to correctly loop the max_sdu entry between tc=0 and
num_max_sdu_entries-1.

Fixes: b10a6509c195 ("taprio: support dumping and setting per-tc max SDU")
Signed-off-by: Tan Tee Min <tee.min.tan@linux.intel.com>
---
 tc/q_taprio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tc/q_taprio.c b/tc/q_taprio.c
index ded385ca..a7c01ae0 100644
--- a/tc/q_taprio.c
+++ b/tc/q_taprio.c
@@ -157,7 +157,7 @@ static void add_tc_entries(struct nlmsghdr *n, __u32 max_sdu[TC_QOPT_MAX_QUEUE],
 	struct rtattr *l;
 	__u32 tc;
 
-	for (tc = 0; tc <= num_max_sdu_entries; tc++) {
+	for (tc = 0; tc < num_max_sdu_entries; tc++) {
 		l = addattr_nest(n, 1024, TCA_TAPRIO_ATTR_TC_ENTRY | NLA_F_NESTED);
 
 		addattr_l(n, 1024, TCA_TAPRIO_TC_ENTRY_INDEX, &tc, sizeof(tc));
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2-next 1/1] taprio: fix wrong for loop condition in add_tc_entries()
  2022-12-02  6:25 [PATCH iproute2-next 1/1] taprio: fix wrong for loop condition in add_tc_entries() Tan Tee Min
@ 2022-12-02 16:00 ` patchwork-bot+netdevbpf
  2022-12-05 17:23 ` Vladimir Oltean
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-12-02 16:00 UTC (permalink / raw)
  To: Tan Tee Min
  Cc: netdev, dsahern, stephen, vladimir.oltean, vinicius.gomes,
	muhammad.husaini.zulkifli

Hello:

This patch was applied to iproute2/iproute2-next.git (main)
by David Ahern <dsahern@kernel.org>:

On Fri,  2 Dec 2022 14:25:42 +0800 you wrote:
> The for loop in add_tc_entries() mistakenly included the last entry
> index+1. Fix it to correctly loop the max_sdu entry between tc=0 and
> num_max_sdu_entries-1.
> 
> Fixes: b10a6509c195 ("taprio: support dumping and setting per-tc max SDU")
> Signed-off-by: Tan Tee Min <tee.min.tan@linux.intel.com>
> 
> [...]

Here is the summary with links:
  - [iproute2-next,1/1] taprio: fix wrong for loop condition in add_tc_entries()
    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=43aa9d9ce7f8

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH iproute2-next 1/1] taprio: fix wrong for loop condition in add_tc_entries()
  2022-12-02  6:25 [PATCH iproute2-next 1/1] taprio: fix wrong for loop condition in add_tc_entries() Tan Tee Min
  2022-12-02 16:00 ` patchwork-bot+netdevbpf
@ 2022-12-05 17:23 ` Vladimir Oltean
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Oltean @ 2022-12-05 17:23 UTC (permalink / raw)
  To: Tan Tee Min
  Cc: netdev, David Ahern, Stephen Hemminger, Vinicius Costa Gomes,
	Muhammad Husaini Zulkifli

On Fri, Dec 02, 2022 at 02:25:42PM +0800, Tan Tee Min wrote:
> The for loop in add_tc_entries() mistakenly included the last entry
> index+1. Fix it to correctly loop the max_sdu entry between tc=0 and
> num_max_sdu_entries-1.
> 
> Fixes: b10a6509c195 ("taprio: support dumping and setting per-tc max SDU")
> Signed-off-by: Tan Tee Min <tee.min.tan@linux.intel.com>
> ---

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-05 17:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-02  6:25 [PATCH iproute2-next 1/1] taprio: fix wrong for loop condition in add_tc_entries() Tan Tee Min
2022-12-02 16:00 ` patchwork-bot+netdevbpf
2022-12-05 17:23 ` Vladimir Oltean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).