From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Varghese, Vipin" Subject: Re: [PATCH 07/19] net/ice: support MTU setting Date: Mon, 26 Nov 2018 03:58:45 +0000 Message-ID: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C1F9A@BGSMSX101.gar.corp.intel.com> References: <1542956179-80951-1-git-send-email-wenzhuo.lu@intel.com> <1542956179-80951-8-git-send-email-wenzhuo.lu@intel.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C1918@BGSMSX101.gar.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "Lu, Wenzhuo" , "Li, Xiaoyun" , "Wu, Jingjing" To: "Yang, Qiming" , "Lu, Wenzhuo" , "dev@dpdk.org" Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D8DEB1B5E4 for ; Mon, 26 Nov 2018 04:58:51 +0100 (CET) In-Reply-To: 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" Hi Qiming > -----Original Message----- > From: Yang, Qiming > Sent: Monday, November 26, 2018 9:09 AM > To: Varghese, Vipin ; Lu, Wenzhuo > ; dev@dpdk.org > Cc: Lu, Wenzhuo ; Li, Xiaoyun ; > Wu, Jingjing > Subject: RE: [dpdk-dev] [PATCH 07/19] net/ice: support MTU setting >=20 > Hi, Vipin > Not sure understand your question. > We have no need to configure jumbo frame, because jumbo frame offload wil= l be > enable when mtu>1500. Apologies if the question is not clear. Let me try to explain what I am try= ing to ask below >=20 > Qiming > -----Original Message----- > From: Varghese, Vipin > Sent: Friday, November 23, 2018 5:58 PM > To: Lu, Wenzhuo ; dev@dpdk.org > Cc: Lu, Wenzhuo ; Yang, Qiming > ; Li, Xiaoyun ; Wu, Jingjing > > Subject: RE: [dpdk-dev] [PATCH 07/19] net/ice: support MTU setting >=20 > HI Wenzhou, >=20 > Following is a thought but not an issue. Can you please let me know your > thought? >=20 > >=20 > > +static int > > +ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { > > + struct ice_pf *pf =3D ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); > > + struct rte_eth_dev_data *dev_data =3D pf->dev_data; > > + uint32_t frame_size =3D mtu + ETHER_HDR_LEN > > + + ETHER_CRC_LEN + ICE_VLAN_TAG_SIZE; > > + > > + if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY) > > + return -E_RTE_SECONDARY; > > + > > + /* check if mtu is within the allowed range */ > > + if ((mtu < ETHER_MIN_MTU) || (frame_size > ICE_FRAME_SIZE_MAX)) > > + return -EINVAL; > > + >=20 > Should we set MTU > 1500 (Jumbo frame) if device is not configured to run= with > jumbo frame? If no, should we check the jumbo config is enabled for the c= urrent > device? >=20 1. If by default JUMBO enabled for this device? 2. There is RX offload which is configured with value 'DEV_RX_OFFLOAD_JUMBO= _FRAME'. Should this be enabled for supporting JUMBO frames? 3. There is per RX queue offload flag too 'DEV_RX_OFFLOAD_JUMBO_FRAME'. If = port_conf is set for 'DEV_RX_OFFLOAD_JUMBO_FRAME' but disabled for specific= RX queue 'DEV_RX_OFFLOAD_JUMBO_FRAME', what is the JUMBO setting for the d= evice? Hence do we need to check 'mtu_set' for whether actually device is configur= ed for JUMBO processing or not? > > + /* mtu setting is forbidden if port is start */ > > + if (dev_data->dev_started) { > > + PMD_DRV_LOG(ERR, > > + "port %d must be stopped before configuration", > > + dev_data->port_id); > > + return -EBUSY; > > + } > > + > > + if (frame_size > ETHER_MAX_LEN) > > + dev_data->dev_conf.rxmode.offloads |=3D > > + DEV_RX_OFFLOAD_JUMBO_FRAME; > > + else > > + dev_data->dev_conf.rxmode.offloads &=3D > > + ~DEV_RX_OFFLOAD_JUMBO_FRAME; > > + > > + dev_data->dev_conf.rxmode.max_rx_pkt_len =3D frame_size; > > + > > + return 0; > > +} > > -- > > 1.9.3