From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 2CF941B4CA for ; Fri, 23 Nov 2018 10:58:17 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Nov 2018 01:58:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,269,1539673200"; d="scan'208";a="91532375" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga007.jf.intel.com with ESMTP; 23 Nov 2018 01:58:13 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 23 Nov 2018 01:58:13 -0800 Received: from bgsmsx153.gar.corp.intel.com (10.224.23.4) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 23 Nov 2018 01:58:13 -0800 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.234]) by BGSMSX153.gar.corp.intel.com ([169.254.2.159]) with mapi id 14.03.0415.000; Fri, 23 Nov 2018 15:28:10 +0530 From: "Varghese, Vipin" To: "Lu, Wenzhuo" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Yang, Qiming" , "Li, Xiaoyun" , "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH 07/19] net/ice: support MTU setting Thread-Index: AQHUgvk6DESCMJBg80ynJa4HddNgaqVdH4cQ Date: Fri, 23 Nov 2018 09:58:09 +0000 Message-ID: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C1918@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> In-Reply-To: <1542956179-80951-8-git-send-email-wenzhuo.lu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmZhNTZkYmItM2EwYS00ZWNjLWFjYTAtMjQ0ODdhMjA3ZGEwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUVdzSzBiOUhLOWV5UnUwMDR5QzloeHcwM3gzU3B2NDRNSVRCSnUzVWs1NmN0bktyZEpINks5NXl2b3VycmpKSCJ9 dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 07/19] net/ice: support MTU setting X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 09:58:18 -0000 HI Wenzhou, Following is a thought but not an issue. Can you please let me know your th= ought? > +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; > + Should we set MTU > 1500 (Jumbo frame) if device is not configured to run w= ith jumbo frame? If no, should we check the jumbo config is enabled for the= current device? > + /* 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