All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Takamitsu Iwai <takamitz@amazon.co.jp>
Cc: Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>, <netdev@vger.kernel.org>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Vladimir Oltean <olteanv@gmail.com>, <takamitz@amazon.com>,
	<syzbot+398e1ee4ca2cac05fddb@syzkaller.appspotmail.com>
Subject: Re: [PATCH v2 net] net/sched: taprio: enforce minimum value for picos_per_byte
Date: Sat, 26 Jul 2025 11:37:43 -0700	[thread overview]
Message-ID: <20250726113743.0e9aad80@kernel.org> (raw)
In-Reply-To: <20250726010815.20198-1-takamitz@amazon.co.jp>

On Sat, 26 Jul 2025 10:08:15 +0900 Takamitsu Iwai wrote:
>  #define TAPRIO_FLAGS_INVALID U32_MAX
> +/* Minimum value for picos_per_byte to ensure non-zero duration
> + * for minimum-sized Ethernet frames (ETH_ZLEN = 60).
> + * 60 * 17 > PSEC_PER_NSEC (1000)
> + */
> +#define TAPRIO_PICOS_PER_BYTE_MIN 17
> +

unnecessary new line

>  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)
-- 
pw-bot: cr

  reply	other threads:[~2025-07-26 18:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-26  1:08 [PATCH v2 net] net/sched: taprio: enforce minimum value for picos_per_byte Takamitsu Iwai
2025-07-26 18:37 ` Jakub Kicinski [this message]
2025-07-27  7:22   ` Takamitsu Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250726113743.0e9aad80@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=syzbot+398e1ee4ca2cac05fddb@syzkaller.appspotmail.com \
    --cc=takamitz@amazon.co.jp \
    --cc=takamitz@amazon.com \
    --cc=vinicius.gomes@intel.com \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.