All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Peng Zhang <peng.zhang@corigine.com>
Cc: dev@dpdk.org, heinrich.kuhn@corigine.com,
	Chaoyong He <chaoyong.he@corigine.com>,
	Louis Peens <louis.peens@corigine.com>
Subject: Re: [PATCH] net/nfp: add the restrict of setting the mtu
Date: Thu, 17 Mar 2022 11:29:54 -0700	[thread overview]
Message-ID: <20220317112954.7ead20af@hermes.local> (raw)
In-Reply-To: <20220317143917.499138-1-peng.zhang@corigine.com>

On Thu, 17 Mar 2022 16:39:17 +0200
Peng Zhang <peng.zhang@corigine.com> wrote:

> +	/* the setting mtu is in the range */
> +	if (mtu < 68 || mtu > hw->max_mtu) {
> +		PMD_DRV_LOG(ERR, "the setting mtu cannot be less than 68 or more than %d",
> +			    hw->max_mtu);
> +		return -ERANGE;
> +	}
> +
> +	/* the setting mtu is lower than flbufsz */
> +	if (mtu > hw->flbufsz) {
> +		PMD_DRV_LOG(ERR, "the setting mtu must be lower than current mbufsize of %d",
> +			    hw->flbufsz);
> +		return -ERANGE;

The ethdev layer already has min/max mtu checks, why is it needed inside common code?

It looks like nfp_net_infos_get() does not set these values.
Please fix it there instead.

PS: 68 is RTE_ETHER_MIN_MTU so please use that.

  reply	other threads:[~2022-03-17 18:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 14:39 [PATCH] net/nfp: add the restrict of setting the mtu Peng Zhang
2022-03-17 18:29 ` Stephen Hemminger [this message]
2022-03-18 11:38 ` [PATCH v2] net/nfp: fix mtu settings Peng Zhang
2022-03-30  3:17   ` [PATCH v3] " Peng Zhang
2022-04-20 18:54     ` Ferruh Yigit
2022-04-21  0:55       ` Nole Zhang
2022-05-11  1:15     ` [PATCH v4] net/nfp: make sure MTU is never larger than mbufsize Peng Zhang
2022-05-19  7:08       ` Andrew Rybchenko
  -- strict thread matches above, loose matches on Subject: below --
2022-03-17 12:52 [PATCH] net/nfp: add the restrict of setting the mtu Peng Zhang

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=20220317112954.7ead20af@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=heinrich.kuhn@corigine.com \
    --cc=louis.peens@corigine.com \
    --cc=peng.zhang@corigine.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.