All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Myers, Charles" <Charles.Myers@spirent.com>
Cc: Yong Wang <yongwang@vmware.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] net/vmxnet3: Added mtu_set() function to allow setting MTU.
Date: Tue, 20 Aug 2019 08:12:11 -0700	[thread overview]
Message-ID: <20190820081211.146a09de@hermes.lan> (raw)
In-Reply-To: <1566273996-24368-1-git-send-email-charles.myers@spirent.com>

On Tue, 20 Aug 2019 04:06:53 +0000
"Myers, Charles" <Charles.Myers@spirent.com> wrote:

>  static int
> +vmxnet3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
> +{
> +	if (mtu < VMXNET3_MIN_MTU || mtu > VMXNET3_MAX_MTU) {
> +		PMD_DRV_LOG(ERR, "MTU should be between %d and %d",
> +			     VMXNET3_MIN_MTU, VMXNET3_MAX_MTU);
> +		return -EINVAL;
> +	}
> +

This is not the best way to handle checking validity of MTU value.

The device should report min/max MTU and then rte_eth_dev_set_mtu
will do enforcement there.

This allows application to know what MTU to use, and eliminates
guess/check behavior.


  reply	other threads:[~2019-08-20 15:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-17  4:53 [dpdk-dev] [PATCH] net/vmxnet3: Added mtu_set() function to allow setting MTU Myers, Charles
2019-08-20  4:06 ` [dpdk-dev] [PATCH v2] " Myers, Charles
2019-08-20 15:12   ` Stephen Hemminger [this message]
2019-09-03 20:10   ` Yong Wang
2019-08-21  2:16 ` [dpdk-dev] [PATCH v3] " Myers, Charles
2019-08-21  4:43   ` Stephen Hemminger
2019-08-21  5:19     ` Myers, Charles
2019-09-13 18:47   ` Ferruh Yigit
2019-09-13 18:59     ` Ferruh Yigit
2020-03-25 18:43   ` [dpdk-dev] [PATCH v4] " Eduard Serra
2020-03-25 18:46     ` [dpdk-dev] [PATCH v5] " Eduard Serra
2020-03-25 19:18       ` [dpdk-dev] [PATCH v6] " Eduard Serra
2020-03-31 17:31         ` Yong Wang
2020-04-01 16:07           ` Ferruh Yigit

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=20190820081211.146a09de@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=Charles.Myers@spirent.com \
    --cc=dev@dpdk.org \
    --cc=yongwang@vmware.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.