From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v1] add mtu set in virtio Date: Sat, 27 Aug 2016 17:15:41 -0700 Message-ID: <20160827171541.5f6b17c2@xeon-e3> References: <20160827005428.16556-1-sodey@sonusnet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: , , To: souvikdey33 Return-path: Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) by dpdk.org (Postfix) with ESMTP id 591F32142 for ; Sun, 28 Aug 2016 02:15:29 +0200 (CEST) Received: by mail-pf0-f179.google.com with SMTP id h186so39819830pfg.3 for ; Sat, 27 Aug 2016 17:15:29 -0700 (PDT) In-Reply-To: <20160827005428.16556-1-sodey@sonusnet.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 26 Aug 2016 20:54:28 -0400 souvikdey33 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 > > 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.