From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 6F947378E for ; Wed, 21 Sep 2016 04:20:50 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP; 20 Sep 2016 19:20:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,371,1470726000"; d="scan'208";a="11534485" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga005.fm.intel.com with ESMTP; 20 Sep 2016 19:20:47 -0700 Date: Wed, 21 Sep 2016 10:21:25 +0800 From: Yuanhan Liu To: "Dey, Souvik" Cc: "Kavanagh, Mark B" , "dev@dpdk.org" , "stephen@networkplumber.org" Message-ID: <20160921022125.GZ23158@yliu-dev.sh.intel.com> References: <20160920071152.GR23158@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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: Wed, 21 Sep 2016 02:20:51 -0000 On Tue, Sep 20, 2016 at 06:42:02PM +0000, Dey, Souvik wrote: > I have already taken care of this in v5 of the patch , If possible please review the same . I don't think so, otherwise I would not comment here. BTW, there is a format error: you used white space instead of TAB for indention. You might want to send another version, to fix above two issues. Or, if you don't mind, I could fix them for you and apply it. --yliu > > -----Original Message----- > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > Sent: Tuesday, September 20, 2016 3:12 AM > To: Kavanagh, Mark B > Cc: Dey, Souvik ; dev@dpdk.org; stephen@networkplumber.org > Subject: Re: [PATCH v4]net/virtio: add mtu set in virtio > > On Wed, Sep 14, 2016 at 12:15:37PM +0000, Kavanagh, Mark B wrote: > > > > > >>+{ > > >>+       struct rte_eth_dev_info dev_info; > > >>+       uint32_t ether_hdr_len = ETHER_HDR_LEN + ETHER_CRC_LEN + > > >>+VLAN_TAG_LEN; > > >>+       uint32_t frame_size = mtu + ether_hdr_len; > > >>+ > > >>+       virtio_dev_info_get(dev, &dev_info); > > >>+ > > >>+       if (mtu < dev_info.min_rx_bufsize || frame_size > > > >>+dev_info.max_rx_pktlen) { > > > > > >It's not clear to me whether 'mtu' in this case should be compared > > >with ETHER_MIN_MTU, as per other DPDK drivers, or alternatively > > >whether 'frame_size' should be compared with dev_info.min_rx_bufsize. > > >Any thoughts? > > >[Dey, Souvik] I am not sure why virtio min_rx_bufsize is less than > > >ETHER_MIN_MTU, i think it will be good to have the compare statement > > >as If(frame_size < ETHER_MIN_MTU || frame_size > > > >dev_info.max_rx_pktlen) , then error. What do you suggest ? > > > > Again, this all depends on what 'mtu' means in this context. > > > > Since you mentioned previously that it relates to the packet (i.e. L3) length, and not the frame (i.e. L2) length, I would suggest that the comparison should be: > > > > if (mtu < ETHER_MIN_MTU || frame_size > dev_info.max_rx_pktlen) > > > > Yuanhan, any thoughts on this? > > I think you are right. At least, that's how the ixgbe PMD driver code looks like. > > --yliu