From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v1 2/6] net/i40e: set min and max MTU for i40e devices Date: Tue, 19 Mar 2019 16:18:09 +0000 Message-ID: <2784e21c-51f2-c18f-6f26-3586fb4a5133@intel.com> References: <1551303948-19746-1-git-send-email-ian.stokes@intel.com> <1551303948-19746-3-git-send-email-ian.stokes@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: stephen@networkplumber.org, Qi Zhang , Helin Zhang , Beilei Xing To: Ian Stokes , dev@dpdk.org Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 6F70E1B19 for ; Tue, 19 Mar 2019 17:18:14 +0100 (CET) In-Reply-To: <1551303948-19746-3-git-send-email-ian.stokes@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 2/27/2019 9:45 PM, Ian Stokes wrote: > This commit sets the min and max supported MTU values for i40e devices > via the i40e_dev_info_get() function. Min MTU supported is set to > ETHER_MIN_MTU and max mtu is calculated as the max packet length > supported minus the transport overhead. > > Signed-off-by: Ian Stokes > --- > drivers/net/i40e/i40e_ethdev.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c > index dca61f03a..caab1624f 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -3499,6 +3499,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) > dev_info->max_rx_pktlen = I40E_FRAME_SIZE_MAX; > dev_info->max_mac_addrs = vsi->max_macaddrs; > dev_info->max_vfs = pci_dev->max_vfs; > + dev_info->max_mtu = dev_info->max_rx_pktlen - I40E_ETH_OVERHEAD; 'I40E_ETH_OVERHEAD' [1] is the max overhead, when VLAN and QINQ is not configured, we are wasting 8 bytes, should we try to be more fine grained when setting the max_mtu? Does it worth the complexity? [1] (ETHER_HDR_LEN + ETHER_CRC_LEN + I40E_VLAN_TAG_SIZE * 2) > + dev_info->min_mtu = ETHER_MIN_MTU; > dev_info->rx_queue_offload_capa = 0; > dev_info->rx_offload_capa = > DEV_RX_OFFLOAD_VLAN_STRIP | >