* [PATCH net-next] net/sched: Use TC_RTAB_SIZE instead of magic number
@ 2025-08-13 12:55 Yue Haibing
2025-08-15 0:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Yue Haibing @ 2025-08-13 12:55 UTC (permalink / raw)
To: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, horms,
sdf
Cc: netdev, linux-kernel
Replace magic number with TC_RTAB_SIZE to make it more informative.
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
---
net/sched/sch_api.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index d7c767b861a4..1e058b46d3e1 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -431,7 +431,7 @@ struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
for (rtab = qdisc_rtab_list; rtab; rtab = rtab->next) {
if (!memcmp(&rtab->rate, r, sizeof(struct tc_ratespec)) &&
- !memcmp(&rtab->data, nla_data(tab), 1024)) {
+ !memcmp(&rtab->data, nla_data(tab), TC_RTAB_SIZE)) {
rtab->refcnt++;
return rtab;
}
@@ -441,7 +441,7 @@ struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
if (rtab) {
rtab->rate = *r;
rtab->refcnt = 1;
- memcpy(rtab->data, nla_data(tab), 1024);
+ memcpy(rtab->data, nla_data(tab), TC_RTAB_SIZE);
if (r->linklayer == TC_LINKLAYER_UNAWARE)
r->linklayer = __detect_linklayer(r, rtab->data);
rtab->next = qdisc_rtab_list;
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net/sched: Use TC_RTAB_SIZE instead of magic number
2025-08-13 12:55 [PATCH net-next] net/sched: Use TC_RTAB_SIZE instead of magic number Yue Haibing
@ 2025-08-15 0:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-15 0:50 UTC (permalink / raw)
To: Yue Haibing
Cc: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, horms,
sdf, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 13 Aug 2025 20:55:26 +0800 you wrote:
> Replace magic number with TC_RTAB_SIZE to make it more informative.
>
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
> ---
> net/sched/sch_api.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Here is the summary with links:
- [net-next] net/sched: Use TC_RTAB_SIZE instead of magic number
https://git.kernel.org/netdev/net-next/c/eeea7688632e
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] 2+ messages in thread
end of thread, other threads:[~2025-08-15 0:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13 12:55 [PATCH net-next] net/sched: Use TC_RTAB_SIZE instead of magic number Yue Haibing
2025-08-15 0:50 ` patchwork-bot+netdevbpf
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).