From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700042.outbound.protection.outlook.com [40.107.70.42]) by dpdk.org (Postfix) with ESMTP id 2B7534C91 for ; Thu, 8 Nov 2018 22:19:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CG7j+FMkvIhbvcMfx5KsaphZCE0nDXRYKCEIby19uHg=; b=X70d0Lc2PsMM88MuXOTJxmKa7uNAXjnS5YMT2dAkozSZxKsYMHck/oOfuqKPqjKOHoHhLYDwMHH1IHsPBaES289LgoudkauPUs+TeeAYLeMdpZS6BCM6DK4o16lKdOwUfVKGK0veMYw9C/00M9YHTsjViAGiPM39WKcm0SJJQ0E= Received: from BYAPR07MB5365.namprd07.prod.outlook.com (20.177.125.18) by BYAPR07MB4998.namprd07.prod.outlook.com (52.135.238.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.30; Thu, 8 Nov 2018 21:19:31 +0000 Received: from BYAPR07MB5365.namprd07.prod.outlook.com ([fe80::4012:e217:427e:320b]) by BYAPR07MB5365.namprd07.prod.outlook.com ([fe80::4012:e217:427e:320b%3]) with mapi id 15.20.1294.034; Thu, 8 Nov 2018 21:19:31 +0000 From: "Mody, Rasesh" To: "dev@dpdk.org" CC: "Mody, Rasesh" , "ferruh.yigit@intel.com" , Dept-Eng DPDK Dev Thread-Topic: [PATCH 2/2] net/bnx2x: fix VF link status update Thread-Index: AQHUd6i9rEM8HmCeGkKK5qahEIHR5w== Date: Thu, 8 Nov 2018 21:19:30 +0000 Message-ID: <1541711947-3714-2-git-send-email-rasesh.mody@cavium.com> References: <1541711947-3714-1-git-send-email-rasesh.mody@cavium.com> In-Reply-To: <1541711947-3714-1-git-send-email-rasesh.mody@cavium.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR02CA0022.namprd02.prod.outlook.com (2603:10b6:a02:ee::35) To BYAPR07MB5365.namprd07.prod.outlook.com (2603:10b6:a03:64::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Rasesh.Mody@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [198.186.1.5] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BYAPR07MB4998; 6:Qo4lwwBynzJs5eDrkdwzgk4az8zR+ki0Tk8NjQgP+UmqI7PMJiFUu4DpK3NGXl2zIrdD1w6HF9SYj6nmGa6ZmwMQPFrsTKpqqEDLtaaqFvbAwv/Q85tahLhL7Lp2otdVSToD7ukJ+Zzbosp/u/lm7ji5+1nksAULknq2+AAnXyal41nLN2ZoDlmFR3Oecp7I/ZFcTsf6NkLiRyEaFgEb1Ax5RgSAdyGkGIsaz+o+I3Mjhw20iw5jKq2FnSHI3iClkGM6sNywpuu8P7PY2/wamOx1SS99it+J0V2xMDtLF4qRh6N/ysZCEYm5KKlY7GsBvtrCUodI6ox/uOAH+T/Q7e8+ROEUC/FlX0wJ13+aLYOuuS0DTCXUDEVxZVzGJL3EJZMCjpkT1w65us3zjW2zzoMAnFEMTH3xXcotld6HViSDTcL+EmXKiuhAx2SdvIe+I2KIgUIsAKthjqViQsUYLw==; 5:osbJUbk0e8zwi1WIuEN1TsN8jqH9hTJigAbEprljthqck3WUWRkWEEJSG3udtFo251xSXxMcLLBUlF7pwBx+JnQNSk/CAL3mT0JutZhLf4EQWOMnWy+BMFy7HH+HHvvapmGeopGYxW+vkkF6Z1+C67cfs0hYUOQ1d+qS04j4tYg=; 7:rskYlcLnRk/juaVv/FHDKvO8zO/vj2O1Rtcul3DzT6XxzR6d6dPJKXSuXQI6TDwHks9RI07kg4b3gOKip+bWd2r4wmgt2T92X1nJ7an3RcB1v225rhYPJofMuMyRCuQ0gk/BdBFw49VO8tFWLJwlpw== x-ms-office365-filtering-correlation-id: 01d63051-62ad-4dc9-6894-08d645bfdf4f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4998; x-ms-traffictypediagnostic: BYAPR07MB4998: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823302103)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:BYAPR07MB4998; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4998; x-forefront-prvs: 0850800A29 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(396003)(136003)(376002)(346002)(199004)(189003)(25786009)(2351001)(6512007)(106356001)(86362001)(5640700003)(6916009)(2906002)(2501003)(72206003)(486006)(446003)(2616005)(6486002)(476003)(6436002)(107886003)(478600001)(2900100001)(4326008)(11346002)(53936002)(66066001)(68736007)(71190400001)(1730700003)(105586002)(99286004)(551934003)(71200400001)(81166006)(8676002)(81156014)(5660300001)(316002)(8936002)(3846002)(6116002)(386003)(305945005)(14454004)(5024004)(97736004)(54906003)(7736002)(76176011)(52116002)(102836004)(14444005)(15650500001)(256004)(186003)(36756003)(26005)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4998; H:BYAPR07MB5365.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: BT/WRVQGk7Md0VipuvsLGdLc/QBQe+oVPFayKxpT6hJ9Yx7n/gdM3D53vCDvfp8Y1uvRTjy51NjS2mR2u6MbM3NFjA2DcnPVki496rxobJFIFICD1Ww7iTcLbBwAvH7SDDXYfCiBjdzqgGfv2IvViUtySvQpouc9EmfVuMtDTwOz/o3qztF/oLKth5R7jQosBgk5lfzFg+SJ+F8Zsx6Hn0MsiJTp0LHY6NknuTw/GbbVH2854hoNMrq0H986mWMk/zh5kjFmRBRnecr7EhSC2ylWl/dSYycUFc/SA6iWiF/ksHmoDsKOB7gweGush4142LdmLUJcb28S1ZxtG4HqMNpe1ESbeAeIOn7aQGtLXyE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01d63051-62ad-4dc9-6894-08d645bfdf4f X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2018 21:19:31.0259 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4998 Subject: [dpdk-dev] [PATCH 2/2] net/bnx2x: fix VF link status update 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: , X-List-Received-Date: Thu, 08 Nov 2018 21:19:33 -0000 In general the VF driver should not access the chip. For VF link status update, VF driver should not use HW lock, use bnx2x_link_report_locked() instead. Add few prints for releasing previously held HW locks. Fixes: a9b58b15ed51 ("net/bnx2x: fix to add PHY lock") Signed-off-by: Rasesh Mody --- drivers/net/bnx2x/bnx2x.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 2797593..a6d2687 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -199,8 +199,12 @@ static int bnx2x_acquire_hw_lock(struct bnx2x_softc *s= c, uint32_t resource) uint32_t hw_lock_control_reg; int cnt; =20 +#ifndef RTE_LIBRTE_BNX2X_DEBUG_PERIODIC if (resource) PMD_INIT_FUNC_TRACE(sc); +#else + PMD_INIT_FUNC_TRACE(sc); +#endif =20 /* validate the resource is within range */ if (resource > HW_LOCK_MAX_RESOURCE_VALUE) { @@ -248,8 +252,12 @@ static int bnx2x_release_hw_lock(struct bnx2x_softc *s= c, uint32_t resource) int func =3D SC_FUNC(sc); uint32_t hw_lock_control_reg; =20 +#ifndef RTE_LIBRTE_BNX2X_DEBUG_PERIODIC if (resource) PMD_INIT_FUNC_TRACE(sc); +#else + PMD_INIT_FUNC_TRACE(sc); +#endif =20 /* validate the resource is within range */ if (resource > HW_LOCK_MAX_RESOURCE_VALUE) { @@ -7041,7 +7049,7 @@ void bnx2x_link_status_update(struct bnx2x_softc *sc) } bnx2x_link_report(sc); } else { - bnx2x_link_report(sc); + bnx2x_link_report_locked(sc); bnx2x_stats_handle(sc, STATS_EVENT_LINK_UP); } } @@ -9388,6 +9396,8 @@ static int bnx2x_prev_unload(struct bnx2x_softc *sc) uint32_t fw, hw_lock_reg, hw_lock_val; uint32_t rc =3D 0; =20 + PMD_INIT_FUNC_TRACE(sc); + /* * Clear HW from errors which may have resulted from an interrupted * DMAE transaction. @@ -9395,22 +9405,23 @@ static int bnx2x_prev_unload(struct bnx2x_softc *sc= ) bnx2x_prev_interrupted_dmae(sc); =20 /* Release previously held locks */ - if (SC_FUNC(sc) <=3D 5) - hw_lock_reg =3D (MISC_REG_DRIVER_CONTROL_1 + SC_FUNC(sc) * 8); - else - hw_lock_reg =3D - (MISC_REG_DRIVER_CONTROL_7 + (SC_FUNC(sc) - 6) * 8); + hw_lock_reg =3D (SC_FUNC(sc) <=3D 5) ? + (MISC_REG_DRIVER_CONTROL_1 + SC_FUNC(sc) * 8) : + (MISC_REG_DRIVER_CONTROL_7 + (SC_FUNC(sc) - 6) * 8); =20 hw_lock_val =3D (REG_RD(sc, hw_lock_reg)); if (hw_lock_val) { if (hw_lock_val & HW_LOCK_RESOURCE_NVRAM) { + PMD_DRV_LOG(DEBUG, sc, "Releasing previously held NVRAM lock\n"); REG_WR(sc, MCP_REG_MCPR_NVM_SW_ARB, (MCPR_NVM_SW_ARB_ARB_REQ_CLR1 << SC_PORT(sc))); } + PMD_DRV_LOG(DEBUG, sc, "Releasing previously held HW lock\n"); REG_WR(sc, hw_lock_reg, 0xffffffff); } =20 if (MCPR_ACCESS_LOCK_LOCK & REG_RD(sc, MCP_REG_MCPR_ACCESS_LOCK)) { + PMD_DRV_LOG(DEBUG, sc, "Releasing previously held ALR\n"); REG_WR(sc, MCP_REG_MCPR_ACCESS_LOCK, 0); } =20 @@ -9740,6 +9751,8 @@ int bnx2x_attach(struct bnx2x_softc *sc) sc->fw_seq =3D (SHMEM_RD(sc, func_mb[SC_FW_MB_IDX(sc)].drv_mb_header) & DRV_MSG_SEQ_NUMBER_MASK); + PMD_DRV_LOG(DEBUG, sc, "prev unload fw_seq 0x%04x", + sc->fw_seq); bnx2x_prev_unload(sc); } =20 --=20 1.7.10.3