From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eLEK0qNR/M8VwfXWmjpQ8396ysuTpgfCrWRMcGgr2IY=; b=MarE+zvXWCpmRrlO8sQBXsvgbnd2B7EAD+1mezLC4E13i/yRUMwozO8X1VBSxgeRTp Zj7N3OFPjmQY8c76VbEp6ZVbevMoPQnnq7/nWU5Nxp3352Z+D09rc9YOQb04RvRjUq27 apafpygo3n0A0sjhcqdpkxn1rZoe9PxIbYSTNx6ntSZR928gljSdyuGbpkPs/d3i/mVr f6woL5U/Pa2PaFq31ooLcCYLsJGa/IJqsXG9qPd7AUr8DBZ9SWGc+tWk28PJPuoa0JPq Yi42NvAcagz50IqT/2CwIY+FxqHusVB16VhOtrVtN0/GKivT4sGS320Hy/shs7LdN7IK OxTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eLEK0qNR/M8VwfXWmjpQ8396ysuTpgfCrWRMcGgr2IY=; b=R/KUyqi6OqohcSmZqIbOqp9On2KMM94s5vdKa1qP923TcSNKV015aalNN75wX94C88 u+JhzthD/0Dms69Pp81MAoQtWS2MkiCzf3IqlVG5V52fogqbomrOB0+TXHP/x4aPjaWk pDGQt7JIx82AoiSy9NvCyFkQyLAO4V9QyWydjr+LherdKAb4jiT4ldHE5AslTFh+yCjs qqEh6bPs5S1FyeE6pM9r35A6RXiZ0/gCLP+uXzAvyHxS8VgWF2sh220mDDEVdtMx9apr 0TaExLSAHXKLR5b9SvbU2IhcnJNRgqVbNpYS3RZlSxtN5ZdebEjTQYzmnCYRiXFPtJGq vckg== X-Gm-Message-State: AE9vXwMRQFhMONR7hGP30TP0WSlRt5gDm7QvUE6z8AaJRDJ6lbeiml0JcsI8VcBBl1I4hw== X-Received: by 10.98.130.137 with SMTP id w131mr18929838pfd.5.1472343328573; Sat, 27 Aug 2016 17:15:28 -0700 (PDT) Received: from xeon-e3 (static-50-53-69-251.bvtn.or.frontiernet.net. [50.53.69.251]) by smtp.gmail.com with ESMTPSA id uz4sm38625893pac.13.2016.08.27.17.15.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Aug 2016 17:15:28 -0700 (PDT) Date: Sat, 27 Aug 2016 17:15:41 -0700 From: Stephen Hemminger To: souvikdey33 Cc: , , Message-ID: <20160827171541.5f6b17c2@xeon-e3> In-Reply-To: <20160827005428.16556-1-sodey@sonusnet.com> References: <20160827005428.16556-1-sodey@sonusnet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v1] add mtu set in virtio X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2016 00:15:29 -0000 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.