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 E1BD0A04B7; Wed, 16 Sep 2020 16:41:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C49FF1C2B3; Wed, 16 Sep 2020 16:41:20 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 907671C2A9 for ; Wed, 16 Sep 2020 16:41:17 +0200 (CEST) IronPort-SDR: ctjOE1h7m+jONGGTH+Uku+0ueDk9RyWgswFWg1AUkk+Zf575elc8T5nGm7SDqBjgl++6ntSlLZ /aq2h2/tr21g== X-IronPort-AV: E=McAfee;i="6000,8403,9746"; a="158759030" X-IronPort-AV: E=Sophos;i="5.76,433,1592895600"; d="scan'208";a="158759030" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2020 07:41:16 -0700 IronPort-SDR: yEH/GoliIESMaXTcSOlQlCjIyQu+s4ByEkMum9LCSHrelFEGDut0X3APud7CpCWBBEPCqMJDdy MAGivKwZPX4w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,433,1592895600"; d="scan'208";a="302574727" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga003.jf.intel.com with ESMTP; 16 Sep 2020 07:41:15 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) 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; Wed, 16 Sep 2020 07:41:15 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 16 Sep 2020 07:41:15 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 16 Sep 2020 07:41:14 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.58) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 16 Sep 2020 07:41:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dg997sql+Np1OABvKJF6fHUGFkq1hLYaqDc/SdsUBRYf4J1y6DtW6Q7X05Q6ZF9PzahKXhmgCDMrcrqkSHZDhrEDT0PwkLWmwO0MoSI6z6GHcB9JdyxEhD+8P7qNWz7WmTg8k1X8ELisVI6AG7+MMc7BFdUIJGz+6JvDvICEnPe/kzfqY+XJo1eJH3Op+oFwscwANQYFmedEMjT+dh6H/BNCfzM0881OWHeesP/LhCTdklK06U2Fyg+biVd9QR1k78e8WRNtDbh/vdaF7cN/OO9qqw3I9H07pW35+DixOafo8HvtgDNvp1yUdLyqlntf/vFj3Sore98zx7tS00j/Fw== 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=j6KRJHoOSAidcfxfeBOTgn//99lGrPhAiRdPOK5WV+U=; b=DDD3PqNve6wfrEm9oMvtw0FASKQRzJ1Qk31nEJxbd+F9OhZmx/bvdgJ/f3N0DGerDeskFM5XQZ2ANipHVDzPTCQijLfEZPtv7Us19fFKu+X7GwyItK5DzC1hDnI8AE+1AVl/vwq2PdGNqiDwDqHOPZLYL/x8c49sbE1wyJdZF37u25nIaFuO09bLUNqXGtHctGMXgtPpo3VsyAtI52hvuoO1xWiOzZz2D9kPqjV+cni2JD8ClCqbGzpZ+BgIyZff7x1x7l/nsYXQZ5pBKa39Iy/IVVLc2qMmy7Hehs20YytG0hogTi/0YqpFCuUogztb75BJ7n5Y6HYucM85w98wKw== 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=j6KRJHoOSAidcfxfeBOTgn//99lGrPhAiRdPOK5WV+U=; b=o7XWNwItnqilTKvfa1zFRTdMnpVknkij7u3AdTZRnRKxBZ/Cxbys2yH/18y4Qm+x9qNSnMfHQmN6hctYgFe00GEBQI1YhW+ng8r/IOEOo8ZCj4EgZDRpxCHE8oOgCQ5IS0kl7wMNQ+ELwVer8Zl70qXC8w2AYFsT/OB7Z1XRHBU= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BYAPR11MB3191.namprd11.prod.outlook.com (2603:10b6:a03:79::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Wed, 16 Sep 2020 14:41:12 +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; Wed, 16 Sep 2020 14:41:12 +0000 From: "Ananyev, Konstantin" To: "Yang, SteveX" , "dev@dpdk.org" CC: "Zhao1, Wei" , "Guo, Jia" , "Yang, Qiming" , "Zhang, Qi Z" , "Wu, Jingjing" , "Xing, Beilei" , "Yang, SteveX" 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/9pQs9TDalrVlJQ Date: Wed, 16 Sep 2020 14:41:12 +0000 Message-ID: References: <20200916055212.25019-1-stevex.yang@intel.com> <20200916055212.25019-6-stevex.yang@intel.com> In-Reply-To: <20200916055212.25019-6-stevex.yang@intel.com> 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: cd60d859-1428-4c5e-6969-08d85a4e8f18 x-ms-traffictypediagnostic: BYAPR11MB3191: 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:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: U5JRy4KuEBs9IjuJuuS4tv77x8LcftcQnk+shj318P7g7j96tY1rbAWxhthoqWLNU165NdbxrJ9QM21+9FBMb0C3bFmmISS6G5zsRFVJsh3CBY9Cgph4Uuuug15al6ZrHd9unlovZiPuAeNydeDKrMJmq0w88my4ez3yHeTz+7ip/oVRCBIe559ZzryO2qA4q8UKje3dy0v8BamnJpNWXRg0TdWDBNd1BtuGDATwjQDKpzooE1l//tq0V+80kbntKrkTLcy+l/iGv9PX6btnXf5uuXbxekq5Jb86P+72KoAhMg9w53q6Emmcgw3yllLG 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)(346002)(376002)(136003)(366004)(39860400002)(396003)(86362001)(6506007)(66446008)(64756008)(83380400001)(54906003)(8936002)(66556008)(7696005)(2906002)(316002)(33656002)(110136005)(107886003)(478600001)(5660300002)(76116006)(26005)(4326008)(71200400001)(66946007)(52536014)(55016002)(66476007)(186003)(9686003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: mwuKBXtmXaRVJupf3ieTX/PugK3bAdrhR/aolwEA8RQi48BVh4pglojes6zoC4FghCevpiiQfS8Aadj8+ZnuDl6hihX0Wf+ms0OYl7JsT4A3gUfy7vpRFVKYFYCQ042VyCsFEqQ9IK8b7P+2r/rMrvB9woaLEL868Ev3T+DlwXK8OElepy06d32pQrDn54AoYgDXNxbnMGuLDsX+FDsXHkSmlkigF7LW76v+XcqakwcpcEgw+T5m3WEpL8f6FQCNF1tdT0htQgcKH/rIXGXHQoIBv/95G3tO0IjHkgPpB0gxuTJy41Rg1mXdIFfOW0KVS/h1rS9YdZiMMbjOMkMMK5zumHv1F6BXngxJzdeSgPPnQxO7EAEi/AdtxrJ44xWVuCABlbC6d5LeDWmkB5g4NXZIIRK7mMsOH6FiPNX7aLQdm7BbMpTwjVWX7zq20948uoDBIwnTSaHCyxtoko8vKF+FCnk9xrABAKcNkh3uY8gaiWyWgeqIWLHfUudlClyJF2NCMS5dI/SgjCZIrum76hIuyckZJ1t6DLgIjFvFMRB3tDGcIqtiVfSsRg3GdkEyS3Uj8VgoK5f/M91fzfkejrUi878+keKJoWrhWezNG1FpV6PZEOpyZdZyPzyR1FBv7Csvb6UFwQkivRFX8fP6BQ== 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: cd60d859-1428-4c5e-6969-08d85a4e8f18 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Sep 2020 14:41:12.5557 (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: 5sUPGrMmNwav6GAtgR56U9da2P9vWIeBleAZKNpQQvgGTZpDTLL2XRPx9JiCIgkESOG32kwkTNsvv9/stz0wi8vLbjIQbekQCX+GOBuHcCU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3191 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" > 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 bytes for max packet > size, so, configure the correct max packet size in dev_config ops. >=20 > Fixes: ff8282f4bbcd ("net/i40e: consider QinQ when setting MTU") >=20 > 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(+) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.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; >=20 > 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; >=20 > + /* 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(= )? > + 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; >=20 > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_et= hdev_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; >=20 > /* 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); >=20 > + > + /* 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