From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CA9D82BFF for ; Fri, 9 Sep 2016 17:41:58 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 09 Sep 2016 08:41:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,305,1470726000"; d="scan'208";a="1027464005" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 09 Sep 2016 08:41:55 -0700 Date: Fri, 9 Sep 2016 23:42:29 +0800 From: Yuanhan Liu To: "Dey, Souvik" Cc: "Kavanagh, Mark B" , "dev@dpdk.org" , "stephen@networkplumber.org" Message-ID: <20160909154229.GT23158@yliu-dev.sh.intel.com> References: <20160907041832.35384-1-sodey@sonusnet.com> <20160909070009.GS23158@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v4]net/virtio: 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: Fri, 09 Sep 2016 15:41:59 -0000 On Fri, Sep 09, 2016 at 03:33:32PM +0000, Dey, Souvik wrote: > Hi Mark, > > Yes I thought I did that change. Sorry once again.. making too many mistakes. Changed it . Thanks. > The MTU here is L3 MTU. Setting this will help in reducing the fragmented/multi-segmented packets and also in case we want to reduce the MTU below 1500, to support VXLAN or GRE tunnel for the packets in openstack and cloud environments. > > --- > drivers/net/virtio/virtio_ethdev.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index 07d6449..da16ad4 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > > static int virtio_dev_queue_stats_mapping_set( > __rte_unused struct rte_eth_dev *eth_dev, > @@ -652,6 +653,16 @@ virtio_dev_allmulticast_disable(struct rte_eth_dev *dev) > PMD_INIT_LOG(ERR, "Failed to disable allmulticast"); > } > > +static int > +virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) > +{ > + struct virtio_hw *hw = dev->data->dev_private; > + if (mtu < VIRTIO_MIN_RX_BUFSIZE || mtu > VIRTIO_MAX_RX_PKTLEN) { > + PMD_INIT_LOG(ERR, "Mtu should be between VIRTIO_MIN_RX_BUFSIZE and VIRTIO_MAX_RX_PKTLEN \n"); Unfortunately, that is still broken, in two ways: - we should avoid long lines over 80 chars - the range will not be correctly showed in the message, because ... (well, you know it). --yliu