From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 8FAE42BC9 for ; Mon, 8 Apr 2019 08:13:07 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Apr 2019 23:13:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,324,1549958400"; d="scan'208";a="313978244" Received: from kmsmsx157.gar.corp.intel.com ([172.21.138.134]) by orsmga005.jf.intel.com with ESMTP; 07 Apr 2019 23:13:05 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.111]) by kmsmsx157.gar.corp.intel.com ([169.254.5.17]) with mapi id 14.03.0415.000; Mon, 8 Apr 2019 14:13:04 +0800 From: "Zhao1, Wei" To: "David Harton (dharton)" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Ananyev, Konstantin" , "Zhang, Qi Z" Thread-Topic: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation Thread-Index: AQHU6bs4bZ8IbRtIjU6eKbfptS5QWKYptABAgAAmHoCAB+MI0A== Date: Mon, 8 Apr 2019 06:13:03 +0000 Message-ID: References: <20190403011833.20428-1-dharton@cisco.com> In-Reply-To: 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.206] Content-Type: text/plain; charset="us-ascii" 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: , X-List-Received-Date: Mon, 08 Apr 2019 06:13:08 -0000 Hi,=20 > -----Original Message----- > From: David Harton (dharton) [mailto:dharton@cisco.com] > Sent: Wednesday, April 3, 2019 8:36 PM > To: Zhao1, Wei ; dev@dpdk.org > Cc: Lu, Wenzhuo ; Ananyev, Konstantin > ; Zhang, Qi Z > Subject: RE: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitatio= n >=20 > Hi, >=20 > > -----Original Message----- > > From: Zhao1, Wei > > Sent: Tuesday, April 02, 2019 10:26 PM > > To: David Harton (dharton) ; dev@dpdk.org > > Cc: Lu, Wenzhuo ; Ananyev, Konstantin > > ; Zhang, Qi Z > > Subject: RE: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting > > limitation > > > > HI, > > > > Why not add some more code > > " > > if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER) > > dev->data->scattered_rx =3D 1; > > " > > > > Into ixgbevf_dev_rx_init() to enable scatter mode when start device? >=20 > I don't think it's necessary is it? >=20 > Doesn't this code in ixgbevf_dev_rx_init() handle it? Sorry, miss that code. >=20 > if (rxmode->offloads & DEV_RX_OFFLOAD_SCATTER || > /* It adds dual VLAN length for supporting dual VLAN */ > (rxmode->max_rx_pkt_len + > 2 * IXGBE_VLAN_TAG_SIZE) > buf_size) { > if (!dev->data->scattered_rx) > PMD_INIT_LOG(DEBUG, "forcing scatter mode"); > dev->data->scattered_rx =3D 1; > } >=20 > Regards, > Dave >=20 > > > > > > 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 > > > > > > Currently, if requested MTU is bigger than mbuf size and scattered > > > receive is not enabled, setting MTU to that value fails. > > > > > > This patch allows setting this special MTU when device is stopped, > > > because scattered_rx will be re-configured during next port start > > > and driver may enable scattered receive according new MTU value. > > > > > > After this patch, driver may select different receive function > > > automatically after MTU set, according MTU values selected. > > > > > > Signed-off-by: David Harton > > > --- > > > drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++----- > > > 1 file changed, 7 insertions(+), 5 deletions(-) > > > > > > 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; > > > > > > hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > > > > > > if ((mtu < ETHER_MIN_MTU) || (max_frame > > > > ETHER_MAX_JUMBO_FRAME_LEN)) > > > return -EINVAL; > > > > > > - /* 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; > > > + } > > > > > > /* > > > * When supported by the underlying PF driver, use the > > > IXGBE_VF_SET_MTU > > > -- > > > 2.19.1 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 AEC8DA0096 for ; Mon, 8 Apr 2019 08:13:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3B8EE2BD8; Mon, 8 Apr 2019 08:13:09 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 8FAE42BC9 for ; Mon, 8 Apr 2019 08:13:07 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Apr 2019 23:13:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,324,1549958400"; d="scan'208";a="313978244" Received: from kmsmsx157.gar.corp.intel.com ([172.21.138.134]) by orsmga005.jf.intel.com with ESMTP; 07 Apr 2019 23:13:05 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.111]) by kmsmsx157.gar.corp.intel.com ([169.254.5.17]) with mapi id 14.03.0415.000; Mon, 8 Apr 2019 14:13:04 +0800 From: "Zhao1, Wei" To: "David Harton (dharton)" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Ananyev, Konstantin" , "Zhang, Qi Z" Thread-Topic: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitation Thread-Index: AQHU6bs4bZ8IbRtIjU6eKbfptS5QWKYptABAgAAmHoCAB+MI0A== Date: Mon, 8 Apr 2019 06:13:03 +0000 Message-ID: References: <20190403011833.20428-1-dharton@cisco.com> In-Reply-To: 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.206] 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: <20190408061303.Z0aGlPX_lF5jLZeuO8Hfgbal9IlShoU5vAi_WPnahaY@z> Hi,=20 > -----Original Message----- > From: David Harton (dharton) [mailto:dharton@cisco.com] > Sent: Wednesday, April 3, 2019 8:36 PM > To: Zhao1, Wei ; dev@dpdk.org > Cc: Lu, Wenzhuo ; Ananyev, Konstantin > ; Zhang, Qi Z > Subject: RE: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting limitatio= n >=20 > Hi, >=20 > > -----Original Message----- > > From: Zhao1, Wei > > Sent: Tuesday, April 02, 2019 10:26 PM > > To: David Harton (dharton) ; dev@dpdk.org > > Cc: Lu, Wenzhuo ; Ananyev, Konstantin > > ; Zhang, Qi Z > > Subject: RE: [dpdk-dev] [PATCH] net/ixgbevf: remove MTU setting > > limitation > > > > HI, > > > > Why not add some more code > > " > > if (rx_conf->offloads & DEV_RX_OFFLOAD_SCATTER) > > dev->data->scattered_rx =3D 1; > > " > > > > Into ixgbevf_dev_rx_init() to enable scatter mode when start device? >=20 > I don't think it's necessary is it? >=20 > Doesn't this code in ixgbevf_dev_rx_init() handle it? Sorry, miss that code. >=20 > if (rxmode->offloads & DEV_RX_OFFLOAD_SCATTER || > /* It adds dual VLAN length for supporting dual VLAN */ > (rxmode->max_rx_pkt_len + > 2 * IXGBE_VLAN_TAG_SIZE) > buf_size) { > if (!dev->data->scattered_rx) > PMD_INIT_LOG(DEBUG, "forcing scatter mode"); > dev->data->scattered_rx =3D 1; > } >=20 > Regards, > Dave >=20 > > > > > > 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 > > > > > > Currently, if requested MTU is bigger than mbuf size and scattered > > > receive is not enabled, setting MTU to that value fails. > > > > > > This patch allows setting this special MTU when device is stopped, > > > because scattered_rx will be re-configured during next port start > > > and driver may enable scattered receive according new MTU value. > > > > > > After this patch, driver may select different receive function > > > automatically after MTU set, according MTU values selected. > > > > > > Signed-off-by: David Harton > > > --- > > > drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++----- > > > 1 file changed, 7 insertions(+), 5 deletions(-) > > > > > > 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; > > > > > > hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > > > > > > if ((mtu < ETHER_MIN_MTU) || (max_frame > > > > ETHER_MAX_JUMBO_FRAME_LEN)) > > > return -EINVAL; > > > > > > - /* 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; > > > + } > > > > > > /* > > > * When supported by the underlying PF driver, use the > > > IXGBE_VF_SET_MTU > > > -- > > > 2.19.1