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 BD4B4A0352; Mon, 4 Nov 2019 16:02:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1EC89322C; Mon, 4 Nov 2019 16:02:54 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 56C742C15; Mon, 4 Nov 2019 16:02:51 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Nov 2019 07:02:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,267,1569308400"; d="scan'208";a="284994770" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 04 Nov 2019 07:02:49 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 4 Nov 2019 07:02:49 -0800 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 4 Nov 2019 07:02:48 -0800 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.57) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 4 Nov 2019 07:02:48 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aF1BnL6Bj3vHWgQjrJtK1wpDghtrUbYJr6r36s7ujGJBOppUsDm5a1oSY7B+118Fp1Q/WpS0wJXHX+vEAbWRhPwLSIMXbk/82wZIBjvzgN3D0XzwBVJsZDCWay9afQ9NuISkWqW4gXCSC/KqSQnyY936GOGMtHQHK4hTSi35CmM1zWg9DSV8nvCDzNqI/PgO2GPQFtnEQpKLsw/1hSfeLa6Fnk6VkOjZ9YLS/2DkFW+IoBRWSiiRZcRH0NuS2iX7YO+eWRWAim4tweHFk2RBZ4kmo7siuw+Aot0QH4wne2mhmHNmvQ8rvgYBLI0YsVFXe3Tm1JxrdEo2a33IlJCpSA== 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=TBM8wUyFQbxuYO29GsM32BlqrFUCpTL3duoRlMjLPMc=; b=lG+aLCS/wHCMlOML3lFBxkqzB1QasUG2arl7C1WelwuLoYfgWEb5YKPErei7phZDonowkuGohiP9+jBzPRFBdednSgVEvRn9nXJTbaiuo4SlkVZy8YnDAsUySRCmRuFYD+VhznydQCmtI6DVJ3vv/iZ9L0NvECd/xo+xI+7Jq0EDBfYrv6RVb6XPvK4PqOwW7wGDNeWKNEX4OQiYQsdia2ySkFHrsL+2dy4W6CrjYZljAFYEq5MaWK6t9YEiM/Ll3hVAxF3NLE/skbM1XMOD5f+Q5UCejSgtD5le8ZlgXQk3lSlCawyOcDONemhn0/gyib4xfUwZkAjPk4Olqi61Jg== 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=TBM8wUyFQbxuYO29GsM32BlqrFUCpTL3duoRlMjLPMc=; b=W+agtw/mVDASs5sq1T+4sOwIeHKWfPWdFJ7XFt/K94LfDQffw5s25Lncu8ghP/0g0HY8Vqg9mJpcays8RssfzGAqcMd8kTj3mC/0LeZrBcg05PU9LBKPwvlHKLhaU1gBuSclR827G1ISrZBu/g6ONdCQip44JwwdwFnggeCDnWU= Received: from BN8PR11MB3828.namprd11.prod.outlook.com (20.178.220.87) by BN8PR11MB3697.namprd11.prod.outlook.com (20.178.221.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.24; Mon, 4 Nov 2019 15:02:32 +0000 Received: from BN8PR11MB3828.namprd11.prod.outlook.com ([fe80::7417:db34:276c:2b57]) by BN8PR11MB3828.namprd11.prod.outlook.com ([fe80::7417:db34:276c:2b57%5]) with mapi id 15.20.2408.024; Mon, 4 Nov 2019 15:02:31 +0000 From: "Stillwell Jr, Paul M" To: "Yang, Qiming" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Yang, Qiming" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/ice: fix link status recovery Thread-Index: AQHVktOeAawE5j1EEEKLOkURJJjAOKd7G0vA Date: Mon, 4 Nov 2019 15:02:31 +0000 Message-ID: References: <20191104054005.146150-1-qiming.yang@intel.com> In-Reply-To: <20191104054005.146150-1-qiming.yang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzJiMzQ2YzYtMGUxOC00YjcyLWEzMjQtNmFlYjIzODczZjFjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTjdnS21scng5VzhXRUl4XC9NdG1CVnRUNmZRSkRxVWJoSVwvdGVKNG1KVG4yYVwvaUdwTnhHeDcrT1hDckN0bm91byJ9 dlp-version: 11.2.0.6 dlp-reaction: no-action dlp-product: dlpe-windows x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=paul.m.stillwell.jr@intel.com; x-originating-ip: [192.55.52.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 89f47e87-55e5-4027-3053-08d761380475 x-ms-traffictypediagnostic: BN8PR11MB3697: 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:31; x-forefront-prvs: 0211965D06 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(979002)(346002)(39860400002)(396003)(136003)(376002)(366004)(199004)(189003)(13464003)(33656002)(54906003)(110136005)(316002)(2906002)(305945005)(8936002)(81156014)(14454004)(81166006)(74316002)(8676002)(478600001)(66946007)(66476007)(66556008)(66446008)(64756008)(76116006)(7736002)(25786009)(450100002)(99286004)(26005)(2501003)(66066001)(86362001)(55016002)(7696005)(6436002)(102836004)(53546011)(6506007)(6246003)(71190400001)(71200400001)(76176011)(11346002)(446003)(9686003)(4326008)(256004)(14444005)(186003)(476003)(486006)(5660300002)(229853002)(52536014)(3846002)(6116002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN8PR11MB3697; H:BN8PR11MB3828.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1kVCtGN2hBvap95cyGPzFn/UczfIoZt0bzbLd0riiashXbFxFV7LpuVexDZtURqIrnL0pR8vv5rhHTUCkMkXFl7gHLAJXCjMcVWNZkOBvV9DAWjlH4ms8MU33Uo54APGIC952jYuc/pIkOn6tneqoUPbUSDc2JJIRwHeoWkdtkIHS1elLeHu0d6h2GGZuwqch0QKWIImQ0fvtoy8wi14Td/hFr3x5fowz3a5coxUGEo8EjJN5j/3ebAK8jLZcCGrzbhz/rGWP+yHpt0C78SM0zrzocZgJNmzbPE018iLfANgTd0bzxl40saP3HlWc1YJIvz4ITl4Cc0cbHabfBuxelmbZIBiKGLOgMwqWmrIaKfWUlsn2+rMB6ZnQLQlHwvawElqfp+2JvvSxfWK9ogXqAQrViJCqIFw5e3s41xdwzsfamYhBT6AL5Md/JGL6U7I Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 89f47e87-55e5-4027-3053-08d761380475 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Nov 2019 15:02:31.5847 (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: 4DlSWp1GfH3WWMnkf8sUgbRJD51Zi4HaxCjQdRTMTr4VNvKnA31N+kcyrx1d34cukdpmAA+01aTUFtreQMqlG16YeSYhBr4SGYSRNK9hkTc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3697 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] net/ice: fix link status recovery 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" > -----Original Message----- > From: dev On Behalf Of Qiming Yang > Sent: Sunday, November 3, 2019 9:40 PM > To: dev@dpdk.org > Cc: Lu, Wenzhuo ; Yang, Qiming > ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/ice: fix link status recovery >=20 > This patch fix a kernel driver link status issue by recovering link statu= s when > device stop. >=20 > Fixes: e6161345d8a9 ("net/ice: support link status change") > Cc: stable@dpdk.org >=20 > Signed-off-by: Qiming Yang > --- > drivers/net/ice/ice_ethdev.c | 26 +++++++++++++++++++++++++- > drivers/net/ice/ice_ethdev.h | 1 + > 2 files changed, 26 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c > index d746758..c9972cf 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -2277,7 +2277,10 @@ ice_dev_stop(struct rte_eth_dev *dev) > /* Clear all queues and release mbufs */ > ice_clear_queues(dev); >=20 > - ice_dev_set_link_down(dev); > + if (pf->init_link_status) > + ice_dev_set_link_up(dev); > + else > + ice_dev_set_link_down(dev); >=20 > /* Clean datapath event and queue/vec mapping */ > rte_intr_efd_disable(intr_handle); > @@ -2648,6 +2651,25 @@ ice_rxq_intr_setup(struct rte_eth_dev *dev) > return 0; > } >=20 > +static void ice_get_init_link_status(struct rte_eth_dev *dev) { > + struct ice_hw *hw =3D ICE_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > + struct ice_pf *pf =3D ICE_DEV_PRIVATE_TO_PF(dev->data- > >dev_private); > + bool enable_lse =3D dev->data->dev_conf.intr_conf.lsc ? true : false; > + struct ice_link_status link_status; > + int ret; > + > + ret =3D ice_aq_get_link_info(hw->port_info, enable_lse, > + &link_status, NULL); > + if (ret !=3D ICE_SUCCESS) { > + PMD_DRV_LOG(ERR, "Failed to get link info"); > + pf->init_link_status =3D false; You should probably just return here instead of continuing on. If the FW do= esn't clear out the link_status variable then there could be garbage in the= re that would match the test below for link_info & ICE_AQ_LINK_UP, thus set= ting init_link_status to true after you just set it to false. > + } > + > + if (link_status.link_info & ICE_AQ_LINK_UP) > + pf->init_link_status =3D true; > +} > + > static int > ice_dev_start(struct rte_eth_dev *dev) > { > @@ -2717,6 +2739,8 @@ ice_dev_start(struct rte_eth_dev *dev) > if (ret !=3D ICE_SUCCESS) > PMD_DRV_LOG(WARNING, "Fail to set phy mask"); >=20 > + ice_get_init_link_status(dev); > + > ice_dev_set_link_up(dev); >=20 > /* Call get_link_info aq commond to enable/disable LSE */ diff --git > a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index > de67e59..27db4e7 100644 > --- a/drivers/net/ice/ice_ethdev.h > +++ b/drivers/net/ice/ice_ethdev.h > @@ -369,6 +369,7 @@ struct ice_pf { > struct ice_parser_list rss_parser_list; > struct ice_parser_list perm_parser_list; > struct ice_parser_list dist_parser_list; > + bool init_link_status; > }; >=20 > #define ICE_MAX_QUEUE_NUM 2048 > -- > 2.9.5