From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <qiming.yang@intel.com>
Received: from mga06.intel.com (mga06.intel.com [134.134.136.31])
 by dpdk.org (Postfix) with ESMTP id 094A31B5E4
 for <dev@dpdk.org>; Mon, 26 Nov 2018 04:38:36 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga005.fm.intel.com ([10.253.24.32])
 by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 25 Nov 2018 19:38:34 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.56,280,1539673200"; d="scan'208";a="282893692"
Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201])
 by fmsmga005.fm.intel.com with ESMTP; 25 Nov 2018 19:38:35 -0800
Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by
 FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS)
 id 14.3.408.0; Sun, 25 Nov 2018 19:38:35 -0800
Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by
 fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS)
 id 14.3.408.0; Sun, 25 Nov 2018 19:38:34 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.102]) by
 SHSMSX152.ccr.corp.intel.com ([169.254.6.214]) with mapi id 14.03.0415.000;
 Mon, 26 Nov 2018 11:38:33 +0800
From: "Yang, Qiming" <qiming.yang@intel.com>
To: "Varghese, Vipin" <vipin.varghese@intel.com>, "Lu, Wenzhuo"
 <wenzhuo.lu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
CC: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "Li, Xiaoyun"
 <xiaoyun.li@intel.com>, "Wu, Jingjing" <jingjing.wu@intel.com>
Thread-Topic: [dpdk-dev] [PATCH 07/19] net/ice: support MTU setting
Thread-Index: AQHUgvkKILWCOBnV8UyTY8xHT5leBKVcmgSAgATR3RA=
Date: Mon, 26 Nov 2018 03:38:32 +0000
Message-ID: <F5DF4F0E3AFEF648ADC1C3C33AD4DBF17A432843@SHSMSX101.ccr.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>
In-Reply-To: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2C1918@BGSMSX101.gar.corp.intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 26 Nov 2018 03:38:37 -0000

Hi, Vipin
Not sure understand your question.
We have no need to configure jumbo frame, because jumbo frame offload will =
be enable when mtu>1500.

Qiming
-----Original Message-----
From: Varghese, Vipin=20
Sent: Friday, November 23, 2018 5:58 PM
To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org
Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming <qiming.yang@intel.com=
>; Li, Xiaoyun <xiaoyun.li@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>
Subject: RE: [dpdk-dev] [PATCH 07/19] net/ice: support MTU setting

HI Wenzhou,

Following is a thought but not an issue. Can you please let me know your th=
ought?

<snipped>

> +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