From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1A7E7A034F; Wed, 24 Feb 2021 04:40:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C00D1607A0; Wed, 24 Feb 2021 04:40:43 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 8F4B24069B; Wed, 24 Feb 2021 04:40:41 +0100 (CET) IronPort-SDR: qN3IVVJp2DCVUG2A9SaexdcoS7yBF+FIljiU8DbUiuqOsBqx1v9g08jINy9Op2FzHIlL6LHHkI QHgED955UCpg== X-IronPort-AV: E=McAfee;i="6000,8403,9904"; a="204491618" X-IronPort-AV: E=Sophos;i="5.81,201,1610438400"; d="scan'208";a="204491618" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2021 19:40:40 -0800 IronPort-SDR: kKHoKB00T/g96hrLbKxAYvovI7C4Fi68RvBpGURqSuiwxi8ANG6aVX3Kbxy5kWaGSWFsQbY4ym cIVt/b9n+LrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,201,1610438400"; d="scan'208";a="593488109" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga006.fm.intel.com with ESMTP; 23 Feb 2021 19:40:40 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 23 Feb 2021 19:40:39 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX601.ccr.corp.intel.com (10.109.6.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 24 Feb 2021 11:40:37 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.2106.002; Wed, 24 Feb 2021 11:40:37 +0800 From: "Guo, Jia" To: "Yu, DapengX" , "Wang, Haiyue" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v2] net/igc: remove MTU setting limitation Thread-Index: AQHXBqYxYmBZxQm+JEmw4ZjPjVvqUapmr31A Date: Wed, 24 Feb 2021 03:40:37 +0000 Message-ID: <3502785c0855451aae90c74426a64ecb@intel.com> References: <220210219085407.97265-1-dapengx.yu@intel.com> <20210219100107.101938-1-dapengx.yu@intel.com> In-Reply-To: <20210219100107.101938-1-dapengx.yu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/igc: remove MTU setting limitation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Seems that v2 is the same as v1, but v1 exposure the coding style issue.=20 Anyway please add the change when update new version. Thanks. Acked-by: Jeff Guo > -----Original Message----- > From: Yu, DapengX > Sent: Friday, February 19, 2021 6:01 PM > To: Guo, Jia ; Wang, Haiyue > Cc: dev@dpdk.org; Yu, DapengX ; stable@dpdk.org > Subject: [PATCH v2] net/igc: remove MTU setting limitation >=20 > From: Dapeng Yu >=20 > Currently, if requested MTU is bigger than mbuf size and scattered receiv= e is > not enabled, setting MTU to that value fails. >=20 > This patch allows setting this special MTU when device is stopped, becaus= e > scattered_rx will be re-configured during next port start and driver may > enable scattered receive according new MTU value. >=20 > After this patch, driver may select different receive function automatica= lly > after MTU set, according MTU values selected. >=20 > Fixes: a5aeb2b9e225 ("net/igc: support Rx and Tx") > Cc: stable@dpdk.org >=20 > Signed-off-by: Dapeng Yu > --- > drivers/net/igc/igc_ethdev.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c = index > dbaa7a83e..0ea6e2a04 100644 > --- a/drivers/net/igc/igc_ethdev.c > +++ b/drivers/net/igc/igc_ethdev.c > @@ -1590,12 +1590,14 @@ eth_igc_mtu_set(struct rte_eth_dev *dev, > uint16_t mtu) > return -EINVAL; >=20 > /* > - * refuse mtu that requires the support of scattered packets when > - * this feature has not been enabled before. > + * If device is started, refuse mtu that requires the support of > + * scattered packets when this feature has not been enabled before. > */ > - if (!dev->data->scattered_rx && > - frame_size > dev->data->min_rx_buf_size - > RTE_PKTMBUF_HEADROOM) > + if (dev->data->dev_started && !dev->data->scattered_rx && > + frame_size > dev->data->min_rx_buf_size - > RTE_PKTMBUF_HEADROOM) { > + PMD_INIT_LOG(ERR, "Stop port first."); > return -EINVAL; > + } >=20 > rctl =3D IGC_READ_REG(hw, IGC_RCTL); >=20 > -- > 2.27.0