From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id B0220A0679 for ; Wed, 3 Apr 2019 04:26:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D54EC5B2C; Wed, 3 Apr 2019 04:26:13 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id EF3545B2A for ; Wed, 3 Apr 2019 04:26:11 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Apr 2019 19:26:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,302,1549958400"; d="scan'208";a="128153314" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by orsmga007.jf.intel.com with ESMTP; 02 Apr 2019 19:26:09 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.210]) by PGSMSX107.gar.corp.intel.com ([169.254.7.60]) with mapi id 14.03.0415.000; Wed, 3 Apr 2019 10:25:45 +0800 From: "Zhao1, Wei" To: David Harton , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Ananyev, Konstantin" , "Zhang, Qi Z" Thread-Topic: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation Thread-Index: AQHU6bs4bZ8IbRtIjU6eKbfptS5QWKYptABA Date: Wed, 3 Apr 2019 02:25:44 +0000 Message-ID: References: <20190403011833.20428-1-dharton@cisco.com> In-Reply-To: <20190403011833.20428-1-dharton@cisco.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190403022544.W4t_p3ONlXk9tAa7uap5q82RUK9nz8-p8AYyJyQq9is@z> HI,=20 Why not add some more code=20 " if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER) dev->data->scattered_rx =3D 1; "=20 Into ixgbevf_dev_rx_init() to enable scatter mode when start device? Reviewed-by: Wei Zhao > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton > Sent: Wednesday, April 3, 2019 9:19 AM > To: dev@dpdk.org > Cc: Lu, Wenzhuo ; Ananyev, Konstantin > ; David Harton > Subject: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation >=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 > Signed-off-by: David Harton > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > b/drivers/net/ixgbe/ixgbe_ethdev.c > index feec85634..0b962c8db 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -6346,20 +6346,22 @@ ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, > uint16_t mtu) { > struct ixgbe_hw *hw; > uint32_t max_frame =3D mtu + IXGBE_ETH_OVERHEAD; > - struct rte_eth_rxmode *rx_conf =3D &dev->data->dev_conf.rxmode; > + struct rte_eth_dev_data *dev_data =3D dev->data; >=20 > hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); >=20 > if ((mtu < ETHER_MIN_MTU) || (max_frame > > ETHER_MAX_JUMBO_FRAME_LEN)) > 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 (!(rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER) && > + if (dev_data->dev_started && !dev_data->scattered_rx && > (max_frame + 2 * IXGBE_VLAN_TAG_SIZE > > - dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) > + dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM)) { > + PMD_INIT_LOG(ERR, "Stop port first."); > return -EINVAL; > + } >=20 > /* > * When supported by the underlying PF driver, use the > IXGBE_VF_SET_MTU > -- > 2.19.1