[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250727072227.22748-1-takamitz@amazon.co.jp>
Date: Sun, 27 Jul 2025 16:22:27 +0900
From: Takamitsu Iwai <takamitz@...zon.co.jp>
To: <kuba@...nel.org>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <horms@...nel.org>,
<jhs@...atatu.com>, <jiri@...nulli.us>, <kuniyu@...gle.com>,
<netdev@...r.kernel.org>, <olteanv@...il.com>, <pabeni@...hat.com>,
<syzbot+398e1ee4ca2cac05fddb@...kaller.appspotmail.com>,
<takamitz@...zon.co.jp>, <takamitz@...zon.com>, <vinicius.gomes@...el.com>,
<xiyou.wangcong@...il.com>
Subject: Re: [PATCH v2 net] net/sched: taprio: enforce minimum value for picos_per_byte
>On 2025/07/27, 3:38, "Jakub Kicinski" <kuba@...nel.org <mailto:kuba@...nel.org>> wrote:
>> struct sched_entry {
>> /* Durations between this GCL entry and the GCL entry where the
>> @@ -1300,6 +1306,11 @@ static void taprio_set_picos_per_byte(struct net_device *dev,
>>
>> skip:
>> picos_per_byte = (USEC_PER_SEC * 8) / speed;
>> + if (picos_per_byte < TAPRIO_PICOS_PER_BYTE_MIN) {
>> + pr_warn("Link speed %d is too high. Schedule may be inaccurate.\n",
>> + speed);
>> + picos_per_byte = TAPRIO_PICOS_PER_BYTE_MIN;
>
>for the path coming in from taprio_change() you should use the extack
>to report the warning (if return value is 0 but extack was set CLIs
>will print that message as a warning directly to the user)
Thank you for your review.
I decided to use pr_warn() only because taprio_set_picos_per_byte() is
called from two different paths:
1. From taprio_change() where extack is available
2. From taprio_dev_notifier() where extack is not available
I plan to modify the patch to handle both cases by:
1. Adding an optional extack parameter to taprio_set_picos_per_byte()
2. Using NL_SET_ERR_MSG_FMT_MOD when extack is provided
3. Falling back to pr_warn() only when extack is NULL
I'll submit an updated version with these changes.
Thanks,
Takamitsu
Powered by blists - more mailing lists