[dpdk-dev] [PATCH v1] add mtu set in virtio
Stephen Hemminger
stephen at networkplumber.org
Sun Aug 28 02:15:41 CEST 2016
On Fri, 26 Aug 2016 20:54:28 -0400
souvikdey33 <sodey at sonusnet.com> wrote:
> This functionality is required mostly in the cloud infrastructure.
> For example, if we use gre or vxlan network between compute and
> controller, then we should not use 1500 mtu in the guest as with
> encapsulation the sixe of the packet will be more and will get
> dropped in the infrastructure. So, in that case we should honor
> the mtu size sent by the dhcp server and configure the same on
> the virtual interfaces in the guest. This will also keep a
> consistent mtu through out the infrastructure.
>
> souvikdey33 (1):
> Signed-off-by: Souvik Dey <sodey at sonusnet.com>
>
> drivers/net/virtio/virtio_ethdev.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
Thanks for the patch, it is a good step forward but it looks
like more code is needed to do this safely. At a minimum,
need to check that MTU is not greater than VIRTIO_MAX_RX_PKTLEN.
And error return should be negative errno not -1.
Something like:
if (mtu < VIRTIO_MIN_MTU || mtu > VIRTIO_MAX_RX_PKTLEN)
return -EINVAL;
Looking at Linux driver, it allows MTU of up to 64K, yet DPDK
only allows 9728. That should probably be fixed.
More information about the dev
mailing list