mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-28 05:34:13 -05:00
net/sched: Use TC_RTAB_SIZE instead of magic number
Replace magic number with TC_RTAB_SIZE to make it more informative. Signed-off-by: Yue Haibing <yuehaibing@huawei.com> Link: https://patch.msgid.link/20250813125526.853895-1-yuehaibing@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
4b6dc4c891
commit
eeea768863
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user