DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Dey, Souvik" <sodey@sonusnet.com>
Cc: "huawei.xie@intel.com" <huawei.xie@intel.com>,
	"yuanhan.liu@linux.intel.com" <yuanhan.liu@linux.intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1] add mtu set in virtio
Date: Mon, 29 Aug 2016 12:33:06 -0700	[thread overview]
Message-ID: <20160829123306.4e2bf00d@xeon-e3> (raw)
In-Reply-To: <BN6PR03MB2740F9921796A56FB6E06EE0DAEE0@BN6PR03MB2740.namprd03.prod.outlook.com>

On Sun, 28 Aug 2016 22:43:54 +0000
"Dey, Souvik" <sodey@sonusnet.com> wrote:

> Hi ,
> 	Currently as you have mentioned, I have changed the code to:
> static int 
>  virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) 
>  {
>     struct virtio_hw *hw = dev->data->dev_private;
> -   if (unlikely(mtu < (uint32_t)hw->vtnet_hdr_size + ETHER_HDR_LEN)) {
> -       return -1;
> +   if (unlikely(mtu < VIRTIO_MIN_RX_BUFSIZE || mtu > VIRTIO_MAX_RX_PKTLEN)) {
> +	   PMD_INIT_LOG(ERR,"Mtu should be between 64 and 9728."
> +       return -EINVAL;
>     }
>     return 0;
>  }
> 
> Yes, we should support till 64K as the kernel does , but I need to go through the changes and test it properly before submitting it for review. Moreover I was thinking with the changes in the mtu, we should also support multi-segment buffers in kni. What do you suggest ?

This looks good, but you really don't need likely/unlikely in this code.
It is not at all performance critical.

  reply	other threads:[~2016-08-29 19:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-27  0:54 souvikdey33
2016-08-28  0:15 ` Stephen Hemminger
2016-08-28 22:43   ` Dey, Souvik
2016-08-29 19:33     ` Stephen Hemminger [this message]
2016-08-29 22:49       ` Dey, Souvik

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=20160829123306.4e2bf00d@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=huawei.xie@intel.com \
    --cc=sodey@sonusnet.com \
    --cc=yuanhan.liu@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).