From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D2EEAA0096 for ; Tue, 4 Jun 2019 20:55:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A07C7559A; Tue, 4 Jun 2019 20:55:04 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680042.outbound.protection.outlook.com [40.107.68.42]) by dpdk.org (Postfix) with ESMTP id 382582BEA; Tue, 4 Jun 2019 20:55:03 +0200 (CEST) Received: from SN4PR0701CA0004.namprd07.prod.outlook.com (2603:10b6:803:28::14) by BN7PR07MB4433.namprd07.prod.outlook.com (2603:10b6:406:b6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1943.22; Tue, 4 Jun 2019 18:55:02 +0000 Received: from BY2NAM05FT033.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::209) by SN4PR0701CA0004.outlook.office365.com (2603:10b6:803:28::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1943.17 via Frontend Transport; Tue, 4 Jun 2019 18:55:02 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by BY2NAM05FT033.mail.protection.outlook.com (10.152.100.170) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1965.10 via Frontend Transport; Tue, 4 Jun 2019 18:55:01 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 4 Jun 2019 11:53:51 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id x54Irv5Z028670; Tue, 4 Jun 2019 11:53:57 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x54IrvRx028669; Tue, 4 Jun 2019 11:53:57 -0700 From: Shahed Shaikh To: CC: , , , Date: Tue, 4 Jun 2019 11:53:49 -0700 Message-ID: <20190604185352.28629-2-shshaikh@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190604185352.28629-1-shshaikh@marvell.com> References: <20190604185352.28629-1-shshaikh@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Matching-Connectors: 132041481018636974; (abac79dc-c90b-41ba-8033-08d666125e47); (abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38; IPV:CAL; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(136003)(396003)(346002)(376002)(39850400004)(2980300002)(1110001)(339900001)(199004)(189003)(316002)(42186006)(16586007)(36906005)(50466002)(54906003)(76176011)(48376002)(53936002)(336012)(2351001)(2906002)(105606002)(36756003)(450100002)(4326008)(498600001)(70586007)(1076003)(356004)(69596002)(8676002)(85426001)(86362001)(68736007)(47776003)(81156014)(8936002)(50226002)(476003)(80596001)(70206006)(126002)(6916009)(305945005)(51416003)(446003)(11346002)(26005)(2616005)(6666004)(87636003)(26826003)(81166006)(486006)(5660300002)(14444005)(76130400001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR07MB4433; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aded714a-a76a-4399-3cd7-08d6e91e261f X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:BN7PR07MB4433; X-MS-TrafficTypeDiagnostic: BN7PR07MB4433: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 0058ABBBC7 X-Microsoft-Antispam-Message-Info: DnqoqBpMnwyMxIHrhBE3RjpjjHYn75waTSfIe+uFNTg5uF4Jb9sYGUt5NdfyjqlPAjVfoZvXTcs0T15zL8UowVJZBG0ytke5Gv6MzORlkQ+pzBKmjvNFRpUDZPKMhueO7+J3QiyRvrwAsK2uDs3tnmZAz2EkARaHjZFbrmrwa+FVmU+P30sbe5oWfUDarxhXz7tQc/SuKo/2UmFMnd4VWSGnwY394CZu9uav6aPq+EFV4NQuZIwvHZgfowvzqWn3gtCCOmGhmMG9BLVo7Jv6fJcGct0BTj60jiljeC73dxhOspoCyCi5OgGWb+WPIe9xu1OeAF8tFduI49dZsUk3Rn/YC3G7ktGT6znVBwNllcdWmcI8qEpaPp/aqwRgL7wijAfKQVvCfOAt2TCDQDwuODNSOLV8YvQt70dFpyPS7d8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2019 18:55:01.4793 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aded714a-a76a-4399-3cd7-08d6e91e261f X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[199.233.58.38]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4433 Subject: [dpdk-stable] [PATCH 2/5] net/bnx2x: fix interrupt flood X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" PMD sets up and clears the slow path interrupt status block in dev_start and dev_stop flow and slow path interrupt status block DMA memory for device is allocated in dev_configure flow. This situation creates a state where, after dev_stop is called, and if there is a slow path interrupt from device, PMD sees the old value of status block consumer in dev_start flow, since DMA memory for status block belongs to old configuration and dev_start will result in new slow path interrupt status block configuration. And since PMD fails to ack new slow path interrupt with correct status block consumer value, device continues to trigger interrupt causing an interrupt flood. Fix is to create and destroy status block DMA memory in dev_start and dev_stop flow instead of dev_configure and dev_close flow. Fixes: 540a211084a7 ("bnx2x: driver core") Cc: stable@dpdk.org Signed-off-by: Shahed Shaikh --- drivers/net/bnx2x/bnx2x.c | 10 ++++++++++ drivers/net/bnx2x/bnx2x_ethdev.c | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 0698b1a8a..e9f05a73a 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -2401,6 +2401,9 @@ static void bnx2x_free_mem(struct bnx2x_softc *sc) ecore_ilt_mem_op(sc, ILT_MEMOP_FREE); bnx2x_free_ilt_lines_mem(sc); + + /* free the host hardware/software hsi structures */ + bnx2x_free_hsi_mem(sc); } static int bnx2x_alloc_mem(struct bnx2x_softc *sc) @@ -2451,6 +2454,13 @@ static int bnx2x_alloc_mem(struct bnx2x_softc *sc) return -1; } + /* allocate the host hardware/software hsi structures */ + if (bnx2x_alloc_hsi_mem(sc) != 0) { + PMD_DRV_LOG(ERR, sc, "bnx2x_alloc_hsi_mem was failed"); + bnx2x_free_mem(sc); + return -ENXIO; + } + return 0; } diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index 3063aea64..5dfd708ef 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -207,13 +207,6 @@ bnx2x_dev_configure(struct rte_eth_dev *dev) return -ENXIO; } - /* allocate the host hardware/software hsi structures */ - if (bnx2x_alloc_hsi_mem(sc) != 0) { - PMD_DRV_LOG(ERR, sc, "bnx2x_alloc_hsi_mem was failed"); - bnx2x_free_ilt_mem(sc); - return -ENXIO; - } - bnx2x_dev_rxtx_init_dummy(dev); return 0; } @@ -294,9 +287,6 @@ bnx2x_dev_close(struct rte_eth_dev *dev) bnx2x_dev_clear_queues(dev); memset(&(dev->data->dev_link), 0 , sizeof(struct rte_eth_link)); - /* free the host hardware/software hsi structures */ - bnx2x_free_hsi_mem(sc); - /* free ilt */ bnx2x_free_ilt_mem(sc); } -- 2.12.3