From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 95F94A04BB; Thu, 17 Sep 2020 14:18:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BB1671D62D; Thu, 17 Sep 2020 14:18:17 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 1D8FF1D61D for ; Thu, 17 Sep 2020 14:18:15 +0200 (CEST) IronPort-SDR: 3rVQCwdTj6TH5rb0l9+XLg9PhA32shDd+Z9w7qLBYgciPPy7Yu54bIZIjks/PbaFnIfEAV+SeZ fzcInCUnS4Dg== X-IronPort-AV: E=McAfee;i="6000,8403,9746"; a="244518378" X-IronPort-AV: E=Sophos;i="5.76,436,1592895600"; d="scan'208";a="244518378" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2020 05:18:13 -0700 IronPort-SDR: itnEHkndwQHNLtwRKZtyTlK2Ud8Q3yLN19o85z8vH6FnHHA4LstMjG7Eh6Rc7vglmOUtDYbR0N F14FF/B3pDmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,436,1592895600"; d="scan'208";a="332131119" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga004.fm.intel.com with ESMTP; 17 Sep 2020 05:18:13 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 17 Sep 2020 05:18:12 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 17 Sep 2020 05:18:11 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 17 Sep 2020 05:18:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iPgLk5lk6k+xXSvm5SmDSM1y3hjhzX4JEcuwinb+x9ul3eI3z00OjeFhfTSOuN9Eu5CC8JnLBYSytyPIIQk62nEYHmI2WrrmC4JAHcY5nfsk9kw1xYIT8n2OnhsDgVSxOFjvR7/xV3B+hWixJ/6mELs5Omaza6eqPQZHmI6MpmitpMz+zskv3doSHfNOdWNydRVDT1RXW7a8GPqs11t3IMZyS4Nwi+S6xd1uN+v2uQAUryuPAPTx7ucorjh8nAzNqBUTmgdVGfGfjeT4Ci4yof8NVPf9Ml4HasUtTRQw5PwEZ1rziylU33KqeDWdsgtc1M6GWUpceloVIBHRwApqhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lhjp1z+qcloi1fIheBu/JYcO5Dph/izmYcrTK73GetM=; b=RWzD91soW3LxZpcd7PrjSo00BzY5KP/g9G0WsAnQX75AYyuAxVBOkgee4O1Kw+n5TfeRoo7T6Va/USJCY2SrnGnqKu3w0ZC0NbnrCkn07i+SI4ywG4A+3dRb88o418O0OwrMIdVCS94kZE+SwDXaiIAAfYvO+9Il7lXhE3LWtwo8IvL6P+wGX9EAnuemS+wTacR1kfux7OqdZrdMNoPbYJ0XfoPC3hXuWBRUaVc9eZ2khbKyhNidxcFBXJrAQwjbQ+neHho9qjxVD8oAXfl56e24B3F+G97mz5DMr9vuz0m+f+b5l0sraxhkW0WewoZh7pA+uM8pFr9uOJ1RXDGrBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lhjp1z+qcloi1fIheBu/JYcO5Dph/izmYcrTK73GetM=; b=fCh/7YYwRQ0+zdRrz+K6rpNPYBcPFUlmYTZeUW1XS6Mzl4vVmnSjsrYhN+jz7d7n5s3XBklF71ljqMUlBQUyyN4Lg8+zUEyDDyY20y7gZsmCPI3nEXTVYT0hecUD2MvNyLwe7CG5PPRv/kWxQaKynoll1C2kKChmY25NxMa72UM= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BYAPR11MB2632.namprd11.prod.outlook.com (2603:10b6:a02:c4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Thu, 17 Sep 2020 12:18:09 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f43b:a137:dab8:8b0b]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f43b:a137:dab8:8b0b%6]) with mapi id 15.20.3391.011; Thu, 17 Sep 2020 12:18:08 +0000 From: "Ananyev, Konstantin" To: "Yang, SteveX" , "dev@dpdk.org" CC: "Zhao1, Wei" , "Guo, Jia" , "Yang, Qiming" , "Zhang, Qi Z" , "Wu, Jingjing" , "Xing, Beilei" Thread-Topic: [dpdk-dev] [PATCH v1 5/5] net/i40e: fix max mtu size packets with vlan tag cannot be received by default Thread-Index: AQHWi+5w6RXvlWkN1UK8C/9pQs9TDalrVlJQgADBRwCAAKhd4A== Date: Thu, 17 Sep 2020 12:18:08 +0000 Message-ID: References: <20200916055212.25019-1-stevex.yang@intel.com> <20200916055212.25019-6-stevex.yang@intel.com> In-Reply-To: Accept-Language: en-GB, 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 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [46.7.39.127] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d4546a42-a92a-4620-d4f6-08d85b03bd2e x-ms-traffictypediagnostic: BYAPR11MB2632: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jFJH8J3rdksyAkrImsPRWETO5JpnyQqCEJpZsjYAwAdQDeT3BxPgsMWWXLKm6Uq/F+2tdy6KU4xzba8rK8hhXHO2ZLK0ggPoSHAbUHJUxtx1yR866cejRfP8hh6r5pfVUceyUm9b6qoDWqdljqQIBnIkYY9GIc0SO62lkm/8z/fP7osSjbex9MZUb/xOntBETMHX9Ai3Umb6BScei4AcMgmdp4JvRSZBLcs33MldUgBgPTq+I8SAYF9DdVMycXtkPVX2cn/ht9BbSp9Tq3H5kFCtLb2ghbk+32Oaala9bJscEqXyjrsFxQo/2i8WUia5 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(39860400002)(346002)(366004)(136003)(9686003)(83380400001)(55016002)(8936002)(66476007)(66946007)(316002)(66556008)(26005)(7696005)(186003)(110136005)(66446008)(54906003)(2906002)(5660300002)(478600001)(6506007)(52536014)(71200400001)(33656002)(4326008)(107886003)(76116006)(64756008)(86362001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: 4J2Q34usvF9b3N+bbuchiPouRGIVS0fXHrCYoi2Ssx1cIhpMpthRthGxJYXUApoFLFokZWHHWJQCOSTsNhM14b/FI+fwQogocG1gQtF0mHj+Y4UoukkW1s8Uswiwk6Z2EdFE/yKaDV2bcrjx549B1CZePyWncQ+O8rIR5jyyaME2jLZTRXypIxzDGQkyUvBh3iQpLuXaVFwfMy5K7lrJnygrf0iiY3JT6kLSBX93iy6h4eHU9j9Qkph9lpTLqdhf3Ofdk5X7ZoQPf9yzFF+hY2vvB91QcU+83AmnLM19riFkr6QOV2N26iQHN3aZnJVxaH9htf58TdqHoXIza3N1XwrVt4cjkVlJ2JYAR0GCa75lRtdwOHh5hpYx+1bgD3bS/VHz5ClDCJoqMucabGQnKCSdI3BqqYVaZazQieIvqA9bHd7PmG6l9iFUAyF2RxLhFTGz2HtVf6m3befwiUO2O+VsUaFo+NS9V+FBsVLxBo7WiKMccwrwTJs6bRGp+k5ISytYfODZumkgZZx0YUXwSn/eSAkfbDS1dFcnHaOy7oZZbmvVlCFZniwNKETIL+98b5hemE6HPAZEa+u99TOmwhKrBqiUWaIz+z2x7Wsbg7e9Ubux7baSrMv6vz/RwXOfp3tm+e5fwqBlPCqaubq6qQ== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3301.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4546a42-a92a-4620-d4f6-08d85b03bd2e X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Sep 2020 12:18:08.8108 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Fj4EcUjNWktnKD/GYSGqQ1jYVCqckKtbWonwCdPfuVjrM9pbDHBunKPh+L1bA1ldIrUv4HSs9ThoyBz7ZUPmdVn8PRElpi1iUPmGs9RQnQ4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2632 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v1 5/5] net/i40e: fix max mtu size packets with vlan tag cannot be received by default 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" > > Subject: RE: [dpdk-dev] [PATCH v1 5/5] net/i40e: fix max mtu size packe= ts > > with vlan tag cannot be received by default > > > > > testpmd will initialize default max packet length to 1518 which does'= t > > > include vlan tag size in ether overheader. Once, send the max mtu > > > length packet with vlan tag, the max packet length will exceed 1518 > > > that will cause packets dropped directly from NIC hw side. But for > > > i40e/i40evf, they should support dual vlan tags that need more 8 byte= s > > > for max packet size, so, configure the correct max packet size in dev= _config > > ops. > > > > > > Fixes: ff8282f4bbcd ("net/i40e: consider QinQ when setting MTU") > > > > > > Signed-off-by: SteveX Yang > > > --- > > > drivers/net/i40e/i40e_ethdev.c | 10 ++++++++++ > > > drivers/net/i40e/i40e_ethdev_vf.c | 11 +++++++++++ > > > 2 files changed, 21 insertions(+) > > > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > > b/drivers/net/i40e/i40e_ethdev.c index 841447228..787ff61c0 100644 > > > --- a/drivers/net/i40e/i40e_ethdev.c > > > +++ b/drivers/net/i40e/i40e_ethdev.c > > > @@ -1917,6 +1917,7 @@ i40e_dev_configure(struct rte_eth_dev *dev) > > > struct i40e_hw *hw =3D I40E_DEV_PRIVATE_TO_HW(dev->data- > > >dev_private); > > > enum rte_eth_rx_mq_mode mq_mode =3D dev->data- > > >dev_conf.rxmode.mq_mode; > > > int i, ret; > > > + struct rte_eth_rxmode *rxmode =3D &dev->data->dev_conf.rxmode; > > > > > > ret =3D i40e_dev_sync_phy_type(hw); > > > if (ret) > > > @@ -1930,6 +1931,15 @@ i40e_dev_configure(struct rte_eth_dev *dev) > > > ad->tx_simple_allowed =3D true; > > > ad->tx_vec_allowed =3D true; > > > > > > + /* Considering QinQ packet, max frame size should be MTU and > > > + * corresponding ether overhead. > > > + */ > > > + if (dev->data->mtu =3D=3D RTE_ETHER_MTU && > > > + rxmode->max_rx_pkt_len =3D=3D RTE_ETHER_MAX_LEN) { > > > > Wonder why that particular max_rx_pkt_len and mtu values are important? > > Shouldn't we always do here same calculations as we do in > > i40e_dev_mtu_set()? >=20 > The combination of RTE_ETHER_MTU (1500) & RTE_ETHER_MAX_LEN (1518) is > the generical default value from test-pmd or other apps. the RTE_ETHER_MA= X_LEN > doesn't include VLAN tag(s) size, hence, only need adjust frame size to h= old real mtu > size packet for the particular condition. Ok, but user can overwrite default values in dev_configure. What would happen if user would set rxmode.max_rx_pkt_len to RTE_ETHER_MAX_= LEN + 1 or RTE_ETHER_MAX_LEN - 1? >=20 > > > > > > > + rxmode->max_rx_pkt_len =3D RTE_ETHER_MTU + > > I40E_ETH_OVERHEAD; > > > + rxmode->offloads |=3D DEV_RX_OFFLOAD_JUMBO_FRAME; > > > + } > > > + > > > if (dev->data->dev_conf.rxmode.mq_mode & > > ETH_MQ_RX_RSS_FLAG) > > > dev->data->dev_conf.rxmode.offloads |=3D > > DEV_RX_OFFLOAD_RSS_HASH; > > > > > > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c > > > b/drivers/net/i40e/i40e_ethdev_vf.c > > > index b755350cd..7410563db 100644 > > > --- a/drivers/net/i40e/i40e_ethdev_vf.c > > > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > > > @@ -1669,6 +1669,7 @@ i40evf_dev_configure(struct rte_eth_dev *dev) > > > I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); > > > uint16_t num_queue_pairs =3D RTE_MAX(dev->data->nb_rx_queues, > > > dev->data->nb_tx_queues); > > > + struct rte_eth_rxmode *rxmode =3D &dev->data->dev_conf.rxmode; > > > > > > /* Initialize to TRUE. If any of Rx queues doesn't meet the bulk > > > * allocation or vector Rx preconditions we will reset it. > > > @@ -1681,6 +1682,16 @@ i40evf_dev_configure(struct rte_eth_dev *dev) > > > dev->data->dev_conf.intr_conf.lsc =3D > > > !!(dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC); > > > > > > + > > > + /* Considering QinQ packet, max frame size should be MTU and > > > + * corresponding ether overhead. > > > + */ > > > + if (dev->data->mtu =3D=3D RTE_ETHER_MTU && > > > + rxmode->max_rx_pkt_len =3D=3D RTE_ETHER_MAX_LEN) { > > > + rxmode->max_rx_pkt_len =3D RTE_ETHER_MTU + > > I40E_ETH_OVERHEAD; > > > + rxmode->offloads |=3D DEV_RX_OFFLOAD_JUMBO_FRAME; > > > + } > > > + > > > if (num_queue_pairs > vf->vsi_res->num_queue_pairs) { > > > struct i40e_hw *hw; > > > int ret; > > > -- > > > 2.17.1