From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 32A1741DF1; Mon, 6 Mar 2023 07:53:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2500340A8A; Mon, 6 Mar 2023 07:53:58 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id C1C314067B; Mon, 6 Mar 2023 07:53:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678085636; x=1709621636; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+84v7FJQqxtxdc7nH3DD/Qa+lBmPSlJllo8B7Ddw/i0=; b=cmAVmz3ygBbYMt0Eyy4+rnlikIVB2TJ2bIjzema+eIaOIZ5cl0whj9AB PlALcd9MskNSElMOYMgK2UkbNPoZDLH91rUIhjfG/B/m2eeolQoRfOxr5 pFin3AhQB2N7euk0xi8HgVAzgpCpMagEe5VJl1i9+JHwSTKY8aLWs2e3D 9sN6E+4sNxPZFoJ7u63H0W0IeztgQNeDnwKjxJ+1s6atKqR//rOJuyCcs PpR4GEynBvxs6IuS9Hjpoxi14qcaZndvRtm6FQqRY203kNK1uxEfI1QzA KXBS/GDKl6LOuqlGtLRt698dSC0hTmLJoj/E70eMAuMRw0HLd39Jbf1ob A==; X-IronPort-AV: E=McAfee;i="6500,9779,10640"; a="421760661" X-IronPort-AV: E=Sophos;i="5.98,236,1673942400"; d="scan'208";a="421760661" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Mar 2023 22:53:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10640"; a="626059142" X-IronPort-AV: E=Sophos;i="5.98,236,1673942400"; d="scan'208";a="626059142" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga003.jf.intel.com with ESMTP; 05 Mar 2023 22:53:54 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Sun, 5 Mar 2023 22:53:54 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Sun, 5 Mar 2023 22:53:54 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Sun, 5 Mar 2023 22:53:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GyIOzqoydrQJx9v546F4ViN3L5bQ1+w92Sgja1Bjwv1Sis3+C7o0wiwALVEPmmfFdrNHXL7ZN1ijCDkACDd+YFYFf4WjYLJpG9rzGsTFWXSEBY+2qYwXAmUvCv7bBNOzrp1uCxcqp5LVDdysn8qV4b7hPBFR+pvq17rg/7Njundzpkxaf5ZNIw29anALZ5zMiRu66aRkwRuiufIhkPVQM/VkAbG+fttB0Zfj0Fl+WrAPWSM62ALhGl+iZWZh6Z1jI98DJ35VF/Ryf6KQQTVkfcnFVvlCa3fh0Z1OFVjk172ZShDk+paI/g4ARjpQGyzSJxE/p4pI7fgqWe4xADp6vg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=R/U/ifpwsTY0ZSiJuy+duVCoR+2iIxVkpyyaI1ou3Dc=; b=MwLz4CZF04/yml0zodfGecwVJ1NAH8i/pUgV/DIANtRifFJw/vMwGnXwuXkvhTz3gVbxUL7LLxB/4yWM6N0ZRJ91hi2lm6zuERz/epfMXxHrPFMaWm9s2ZZDWIwY+5kyQyPPQ1ekLy+EU5y4q38OoMgI13sxHkvazLF00hj+vzoL3NrYMjPLhDBoxxftIDsgTY6nkXh/DqCe67KN9iyhprgMVxcqbOGdHhhNH/g2OYtj52cmv/Tfhr4Oawvfh2fCsc61XcO2yewXFjHajxM2qhedvQdIvILoGkygiEDQiZgbzQWjil/z+BlxRVU+1QAruZNBj7pjBs+Pbr9R2ov3Hg== 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 Received: from SA1PR11MB6613.namprd11.prod.outlook.com (2603:10b6:806:254::9) by CO1PR11MB4929.namprd11.prod.outlook.com (2603:10b6:303:6d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.25; Mon, 6 Mar 2023 06:53:50 +0000 Received: from SA1PR11MB6613.namprd11.prod.outlook.com ([fe80::b820:ab95:f6fb:6f10]) by SA1PR11MB6613.namprd11.prod.outlook.com ([fe80::b820:ab95:f6fb:6f10%4]) with mapi id 15.20.6134.019; Mon, 6 Mar 2023 06:53:50 +0000 From: "Su, Simei" To: David Marchand , "dev@dpdk.org" CC: "stable@dpdk.org" , "Zhang, Yuying" , "Xing, Beilei" , "Zhang, Qi Z" Subject: RE: [PATCH v2] net/i40e: don't check link status on device start Thread-Topic: [PATCH v2] net/i40e: don't check link status on device start Thread-Index: AQHZDtQHozGiwTsNnUuO3cxqDrMNGK7t0jQA Date: Mon, 6 Mar 2023 06:53:49 +0000 Message-ID: References: <20221212143715.29649-1-david.marchand@redhat.com> <20221213091837.87953-1-david.marchand@redhat.com> In-Reply-To: <20221213091837.87953-1-david.marchand@redhat.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA1PR11MB6613:EE_|CO1PR11MB4929:EE_ x-ms-office365-filtering-correlation-id: 8b4a057a-e175-41f0-5b67-08db1e0f8a73 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vNvYereQMlKS/k0U4hjr8KNLlE48zby1rhiPQNFs+EZ7ritBR0NUV8w6+jscQGju7Zt4yafjJhT2kHRMJITSx6CZsFyttP2h8cIZ5g9zLXZfpRs8T5s8suOHtGkUt0NzcQFit7JLQJVbeNkV6/MPO+IkeQwsap4xRB9kVXeP9EXk02nA9P+PLTksqBgR/H53sIveuVDP0z/WCbt/24XqN5kNtUc7eihDdsnqtA0reUj38rhxBq9dOTCTn0pDYWvwJILlIUtQ4X5VdqQvKzpTMjIUB8g4AONST1yqn1n0Jp/5wGVdI2GfvYE1zv/igau8lhYrvV24M5buXdRX63AnBjjek+PbkggcEnP4z7RuNZ4zvstDQY4/X6hBrXQp4q2l9VaVoEVIINzNtDmwsDcQaIN1nt5dzzi2mgjPOYHHSPmHqQ71U1DkdOPx0M0HCRaVwHryHISzGuScCdtmCpZ1v4vBfoMjbWxMnJ8Ig9mLAoTMPWdNsenoJmo+QWRoI+R+4U5woW02VvISbnxqTo3zkd4O4GAUrDyyNAO0jYJsTwBpg/pz/z78T1vsmG5dORKU1qfinSfoxRRGJ+w3JYZ+2rq4GnPKvLy+O7SWI3z6dq1QT1wEhyjLuQKzInuPrNWqpn4YfpVXXBeQQ0R/LWP0+HO6YzcNm026jjqeWEkqxy97EPSBHQAY2HyExj8BuQi6ympGvBvtLKPbh/l9mqqct26MIQw3HZ5Oc2D1BwBGzoo= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA1PR11MB6613.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(346002)(376002)(396003)(136003)(366004)(39860400002)(451199018)(33656002)(86362001)(186003)(9686003)(41300700001)(4326008)(53546011)(26005)(5660300002)(8936002)(52536014)(71200400001)(110136005)(478600001)(66446008)(54906003)(6506007)(64756008)(55016003)(66476007)(76116006)(107886003)(8676002)(66556008)(66946007)(7696005)(122000001)(38100700002)(82960400001)(38070700005)(83380400001)(2906002)(316002)(309714004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?zWIb748c6rzzvtBc7BpfpF/Rxa1enWYkN/DR1hR3nIHMiLI13APsY6gMkdy7?= =?us-ascii?Q?TK7ln97DYsMMvyN//l/3mQqhGB26TUrT9Fq7EjSiICr5BRhb44TKnH7Ftv0L?= =?us-ascii?Q?hED2IZMeaFKUHDiY0x+fH6al3HSbCV5RXoSEHRZhFXnFXlvlz6PCfFnPhyqQ?= =?us-ascii?Q?wbr9VwaMWUZcicbLBe7toUhB19f7K6QvkCUxfzSbAT/pVWPpTPsodIo2AuTj?= =?us-ascii?Q?25Qf4Z/6gxTSKI/cD9Sb+eVMOD6o81YNVpX1y3Dduq5kISQ7iKFCxjYiH9rr?= =?us-ascii?Q?7EubTwyEJ45jaRtnKHSV512R0rLllMaExkQP+6v8LHf5whijjLCWoscheOjx?= =?us-ascii?Q?YTquoYWTC/rd5yXkLx2IdJcB3eAvRklDp3iDw2ousZlMi3QyGM9hETw6Bw6R?= =?us-ascii?Q?rd6edUleykuPQr5G+OIYHDQEsAGVVnLY+KHZk40hWzHMR6KuCU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jOFF8ZIwHoNmob/ocv3KH4q5p6?= =?us-ascii?Q?2ZbYnj3OuiTQ7TWvB4WRx9fnPkVNBRox1Dd3CtYw3YQmSKWPAYaQlbLthE0m?= =?us-ascii?Q?1o3jHLsMKZ3AFWZcXCIXzaUvOvJulA11iAO+7RBjVtNJYmA5VZCWnKqymwV/?= =?us-ascii?Q?0GI5Y363KM3AZPJWEUWIf+CaBkSOJz0TyAtNhLqE+rRFgF2CwV7iQvx91G6M?= =?us-ascii?Q?SuvIF7UN/Rpo1nt4o8wwRCU3csAsgcjTcvJ+R7pv?= 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: SA1PR11MB6613.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b4a057a-e175-41f0-5b67-08db1e0f8a73 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Mar 2023 06:53:49.9059 (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: iPo4oHj9SDMzq4EtGSeou45c2CnFUfYrM8nmt+SwyGz+Q3X9hi2pMyahZys7Jtdc56vpc09d5RdYB+aeQ+v6Jw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4929 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: David Marchand > Sent: Tuesday, December 13, 2022 5:19 PM > To: dev@dpdk.org > Cc: stable@dpdk.org; Zhang, Yuying ; Xing, Beilei > ; Zhang, Qi Z ; Dapeng Yu > ; Wenxuan Wu ; Wang, > Jie1X > Subject: [PATCH v2] net/i40e: don't check link status on device start >=20 > The mentioned changes broke existing applications when the link status of > i40e ports is down at the time the port is started. > Revert those changes, the original issue will need a different fix. >=20 > Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at port level") > Fixes: 2184f7cdeeaa ("net/i40e: fix max frame size config at port level") > Fixes: 719469f13b11 ("net/i40e: fix jumbo frame Rx with X722") > Cc: stable@dpdk.org >=20 > Signed-off-by: David Marchand > --- > Changes since v1: > - since the CI reports a failure on v1, simplified the fix by only > reverting commits, >=20 > --- > drivers/net/i40e/i40e_ethdev.c | 50 +++++----------------------------- > 1 file changed, 7 insertions(+), 43 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 7726a89d99..a982e42264 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -387,7 +387,6 @@ static int i40e_set_default_mac_addr(struct > rte_eth_dev *dev, > struct rte_ether_addr *mac_addr); >=20 > static int i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); -sta= tic > void i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size); >=20 > static int i40e_ethertype_filter_convert( > const struct rte_eth_ethertype_filter *input, @@ -1711,6 +1710,11 @@ > eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused= ) > */ > i40e_add_tx_flow_control_drop_filter(pf); >=20 > + /* Set the max frame size to 0x2600 by default, > + * in case other drivers changed the default value. > + */ > + i40e_aq_set_mac_config(hw, I40E_FRAME_SIZE_MAX, TRUE, false, 0, > NULL); > + > /* initialize RSS rule list */ > TAILQ_INIT(&pf->rss_config_list); >=20 > @@ -2328,7 +2332,6 @@ i40e_dev_start(struct rte_eth_dev *dev) > uint32_t intr_vector =3D 0; > struct i40e_vsi *vsi; > uint16_t nb_rxq, nb_txq; > - uint16_t max_frame_size; >=20 > hw->adapter_stopped =3D 0; >=20 > @@ -2467,9 +2470,6 @@ i40e_dev_start(struct rte_eth_dev *dev) > "please call hierarchy_commit() " > "before starting the port"); >=20 > - max_frame_size =3D dev->data->mtu + I40E_ETH_OVERHEAD; > - i40e_set_mac_max_frame(dev, max_frame_size); > - > return I40E_SUCCESS; >=20 > tx_err: > @@ -2809,9 +2809,6 @@ i40e_dev_set_link_down(struct rte_eth_dev *dev) > return i40e_phy_conf_link(hw, abilities, speed, false); } >=20 > -#define CHECK_INTERVAL 100 /* 100ms */ > -#define MAX_REPEAT_TIME 10 /* 1s (10 * 100ms) in total */ > - > static __rte_always_inline void > update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link) { @@ > -2878,6 +2875,8 @@ static __rte_always_inline void update_link_aq(struct > i40e_hw *hw, struct rte_eth_link *link, > bool enable_lse, int wait_to_complete) { > +#define CHECK_INTERVAL 100 /* 100ms */ > +#define MAX_REPEAT_TIME 10 /* 1s (10 * 100ms) in total */ > uint32_t rep_cnt =3D MAX_REPEAT_TIME; > struct i40e_link_status link_status; > int status; > @@ -6738,7 +6737,6 @@ i40e_dev_handle_aq_msg(struct rte_eth_dev *dev) > if (!ret) > rte_eth_dev_callback_process(dev, > RTE_ETH_EVENT_INTR_LSC, NULL); > - > break; > default: > PMD_DRV_LOG(DEBUG, "Request %u is not supported yet", @@ > -12123,40 +12121,6 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf) > return ret; > } >=20 > -static void > -i40e_set_mac_max_frame(struct rte_eth_dev *dev, uint16_t size) -{ > - struct i40e_hw *hw =3D > I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); > - uint32_t rep_cnt =3D MAX_REPEAT_TIME; > - struct rte_eth_link link; > - enum i40e_status_code status; > - bool can_be_set =3D true; > - > - /* > - * I40E_MEDIA_TYPE_BASET link up can be ignored > - * I40E_MEDIA_TYPE_BASET link down that hw->phy.media_type > - * is I40E_MEDIA_TYPE_UNKNOWN > - */ > - if (hw->phy.media_type !=3D I40E_MEDIA_TYPE_BASET && > - hw->phy.media_type !=3D I40E_MEDIA_TYPE_UNKNOWN) { > - do { > - update_link_reg(hw, &link); > - if (link.link_status) > - break; > - rte_delay_ms(CHECK_INTERVAL); > - } while (--rep_cnt); > - can_be_set =3D !!link.link_status; > - } > - > - if (can_be_set) { > - status =3D i40e_aq_set_mac_config(hw, size, TRUE, 0, false, NULL); > - if (status !=3D I40E_SUCCESS) > - PMD_DRV_LOG(ERR, "Failed to set max frame size at port > level"); > - } else { > - PMD_DRV_LOG(ERR, "Set max frame size at port level not applicable > on link down"); > - } > -} > - > RTE_LOG_REGISTER_SUFFIX(i40e_logtype_init, init, NOTICE); > RTE_LOG_REGISTER_SUFFIX(i40e_logtype_driver, driver, NOTICE); #ifdef > RTE_ETHDEV_DEBUG_RX > -- > 2.38.1 Acked-by: Simei Su Thanks, Simei=20