From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v4]net/virtio: add mtu set in virtio Date: Fri, 9 Sep 2016 23:42:29 +0800 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 Cc: "Kavanagh, Mark B" , "dev@dpdk.org" , "stephen@networkplumber.org" To: "Dey, Souvik" 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) Content-Disposition: inline In-Reply-To: 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, 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