From patchwork Tue Jun 4 18:53:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shahed Shaikh X-Patchwork-Id: 54363 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 25E6B1B95D; Tue, 4 Jun 2019 20:55:07 +0200 (CEST) Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680080.outbound.protection.outlook.com [40.107.68.80]) by dpdk.org (Postfix) with ESMTP id 1DF592BEA; Tue, 4 Jun 2019 20:55:04 +0200 (CEST) Received: from SN4PR0701CA0004.namprd07.prod.outlook.com (2603:10b6:803:28::14) by DM5PR07MB2874.namprd07.prod.outlook.com (2603:10b6:3:8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.12; Tue, 4 Jun 2019 18:55:03 +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:02 +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:48 -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 x54Irsrn028666; Tue, 4 Jun 2019 11:53:54 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x54IrsQU028665; Tue, 4 Jun 2019 11:53:54 -0700 From: Shahed Shaikh To: CC: , , , Date: Tue, 4 Jun 2019 11:53:48 -0700 Message-ID: <20190604185352.28629-1-shshaikh@marvell.com> X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 132041481028234696; (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)(396003)(376002)(136003)(39850400004)(346002)(2980300002)(1110001)(339900001)(199004)(189003)(16586007)(6666004)(54906003)(356004)(8936002)(68736007)(36756003)(305945005)(86362001)(81166006)(81156014)(450100002)(8676002)(126002)(50226002)(316002)(498600001)(76130400001)(70206006)(26826003)(70586007)(6916009)(1076003)(36906005)(87636003)(5660300002)(2616005)(476003)(486006)(53936002)(26005)(336012)(85426001)(69596002)(48376002)(42186006)(4326008)(2906002)(47776003)(80596001)(105606002)(50466002)(51416003)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB2874; 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: 6d98f219-ff2d-489d-78b3-08d6e91e26c4 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:DM5PR07MB2874; X-MS-TrafficTypeDiagnostic: DM5PR07MB2874: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 0058ABBBC7 X-Microsoft-Antispam-Message-Info: LOmCvAw0ImrfMw1+Iq9T6Nuk7m+jDG0eeJMRTlGRW7X7Tzl00t1fjKDAWd3mLchR0mI7merY616qebsCoEee5fB5kjCkF+iP612moLfe6HjjywN3qOFyR0g5sLdkajACAARB0R3nH2WsLKnwq9Uz27oATaCHZCxPPZpWQmtm+HKx9Wb1xkClTN09Cm8Na90YVjR0+dfptA3nI0CIcLm4WJXjT6r/DoHWDt1E7bxmIiN8BHr82bm9pOLDMkNZhPDNgPLSiXIL2a/SyFQp67P+JjdCJGvIFsCb/QWhx2cf9vz6xOcL4cBKoLAQ1hpZOIJKUcqADd53EKJTjF7xJAkksIYMX1F9DNgvValyOaQgJF1iDVo9L1ivSvjNcJ/DUuiIdbiVaTwOdZt2wvFlBh9V43zhQ8ACZAh82DizWYEkRTQ= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2019 18:55:02.5682 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6d98f219-ff2d-489d-78b3-08d6e91e26c4 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: DM5PR07MB2874 Subject: [dpdk-dev] [PATCH 1/5] net/bnx2x: fix packet drop 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" Patch "8bd31421c593 ("net/bnx2x: fix ramrod timeout")" introduced a regression where sc->scan_fp flags is set for unexpectedly long time. So the slow path completion handler flow is run unnecessarily which walks over receive descriptor ring of fast path and drops the data packets while looking for slow path completion descriptor out of fast path ring. This issue is seen under heavy traffic with link events happening in background. Fixes: 8bd31421c593 ("net/bnx2x: fix ramrod timeout") Cc: stable@dpdk.org Signed-off-by: Shahed Shaikh Acked-by: Rasesh Mody --- drivers/net/bnx2x/bnx2x.c | 2 ++ drivers/net/bnx2x/ecore_sp.c | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 3e705c7a1..0698b1a8a 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -4572,6 +4572,8 @@ static void bnx2x_handle_fp_tq(struct bnx2x_fastpath *fp) } } + /* Assuming we have completed slow path completion, clear the flag */ + rte_atomic32_set(&sc->scan_fp, 0); bnx2x_ack_sb(sc, fp->igu_sb_id, USTORM_ID, le16toh(fp->fp_hc_idx), IGU_INT_ENABLE, 1); } diff --git a/drivers/net/bnx2x/ecore_sp.c b/drivers/net/bnx2x/ecore_sp.c index 43194095b..5ac22e725 100644 --- a/drivers/net/bnx2x/ecore_sp.c +++ b/drivers/net/bnx2x/ecore_sp.c @@ -291,10 +291,6 @@ static int ecore_state_wait(struct bnx2x_softc *sc, int state, cnt *= 20; ECORE_MSG(sc, "waiting for state to become %d", state); - /* being over protective to remind bnx2x_intr_legacy() to - * process RAMROD - */ - rte_atomic32_set(&sc->scan_fp, 1); ECORE_MIGHT_SLEEP(); while (cnt--) { From patchwork Tue Jun 4 18:53:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shahed Shaikh X-Patchwork-Id: 54362 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D5C371B94E; 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 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-dev] [PATCH 2/5] net/bnx2x: fix interrupt flood 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" 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); } From patchwork Tue Jun 4 18:53:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shahed Shaikh X-Patchwork-Id: 54365 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E61C1B9B0; Tue, 4 Jun 2019 20:55:13 +0200 (CEST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780042.outbound.protection.outlook.com [40.107.78.42]) by dpdk.org (Postfix) with ESMTP id 50BD21B974; Tue, 4 Jun 2019 20:55:09 +0200 (CEST) Received: from DM6PR07CA0043.namprd07.prod.outlook.com (2603:10b6:5:74::20) by SN6PR07MB4670.namprd07.prod.outlook.com (2603:10b6:805:3a::29) 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:08 +0000 Received: from BY2NAM05FT030.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::209) by DM6PR07CA0043.outlook.office365.com (2603:10b6:5:74::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1943.16 via Frontend Transport; Tue, 4 Jun 2019 18:55:07 +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 BY2NAM05FT030.mail.protection.outlook.com (10.152.100.167) 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:07 +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:54 -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 x54Is15w028674; Tue, 4 Jun 2019 11:54:01 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x54Is16i028673; Tue, 4 Jun 2019 11:54:01 -0700 From: Shahed Shaikh To: CC: , , , Date: Tue, 4 Jun 2019 11:53:50 -0700 Message-ID: <20190604185352.28629-3-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 X-EOPAttributedMessage: 0 X-Matching-Connectors: 132041481077517317; (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)(376002)(39850400004)(396003)(346002)(2980300002)(1110001)(339900001)(189003)(199004)(6666004)(356004)(85426001)(2906002)(76176011)(53936002)(51416003)(486006)(54906003)(1076003)(5660300002)(81156014)(70586007)(76130400001)(50226002)(16586007)(8676002)(70206006)(8936002)(81166006)(305945005)(80596001)(87636003)(2351001)(26826003)(316002)(69596002)(36906005)(105606002)(498600001)(476003)(450100002)(11346002)(126002)(2616005)(36756003)(6916009)(4326008)(50466002)(48376002)(68736007)(47776003)(446003)(42186006)(26005)(86362001)(336012); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4670; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9372351a-e44c-4795-9dd5-08d6e91e29b4 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:SN6PR07MB4670; X-MS-TrafficTypeDiagnostic: SN6PR07MB4670: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:538; X-Forefront-PRVS: 0058ABBBC7 X-Microsoft-Antispam-Message-Info: HTfs9tu2VpEeGEAnVoN950sNkyCF8wdZ8/zkxxfVjGgNzV+2XkMlgVaemyRGJoznP8PnJYv2fqlTBqyJG0bKOK2+2fThL0VQtPL8nrDrnPvZW/WDv5OZ6J+EbapYeON7MNMAYbE8gGS4NlFdhIvHun9qsaf6JAB+7jCS0XivktZWXUfvk4EmBEvpGiocv5DcdGW+t/KwD5ehBIK7XJmg5NcudpakIi5dL9vNEXMjI+6bwdhlUNEIvnydEvrUJ+Vd2aNzlBCWaFjyXrp/87WBRvouaOQVRf1axEZ3h9MPjVWGBlwhbs5r2TVxjKBES3EG0c1mphCdyYZQ1qccCJNwLdw80L46MiOBHM85fBChuma0JdOEaBeKw7958Mxt5VjVHkaaekU37oXm1JBj/nxL3C/xLGczF0Y/Ne++yEOOaMw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2019 18:55:07.4975 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9372351a-e44c-4795-9dd5-08d6e91e29b4 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: SN6PR07MB4670 Subject: [dpdk-dev] [PATCH 3/5] net/bnx2x: fix memory leak 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" bnx2x_free_hsi_mem() does not free DMA memory. Fix it here. Fixes: 540a211084a7 ("bnx2x: driver core") Cc: stable@dpdk.org Signed-off-by: Shahed Shaikh --- drivers/net/bnx2x/bnx2x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index e9f05a73a..d3b260830 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -9018,36 +9018,42 @@ void bnx2x_free_hsi_mem(struct bnx2x_softc *sc) /*******************/ memset(&fp->status_block, 0, sizeof(fp->status_block)); + bnx2x_dma_free(&fp->sb_dma); } /***************************/ /* FW DECOMPRESSION BUFFER */ /***************************/ + bnx2x_dma_free(&sc->gz_buf_dma); sc->gz_buf = NULL; /*******************/ /* SLOW PATH QUEUE */ /*******************/ + bnx2x_dma_free(&sc->spq_dma); sc->spq = NULL; /*************/ /* SLOW PATH */ /*************/ + bnx2x_dma_free(&sc->sp_dma); sc->sp = NULL; /***************/ /* EVENT QUEUE */ /***************/ + bnx2x_dma_free(&sc->eq_dma); sc->eq = NULL; /************************/ /* DEFAULT STATUS BLOCK */ /************************/ + bnx2x_dma_free(&sc->def_sb_dma); sc->def_sb = NULL; } From patchwork Tue Jun 4 18:53:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shahed Shaikh X-Patchwork-Id: 54364 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9376D1B99B; Tue, 4 Jun 2019 20:55:10 +0200 (CEST) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-eopbgr800042.outbound.protection.outlook.com [40.107.80.42]) by dpdk.org (Postfix) with ESMTP id 7409A1B94D; Tue, 4 Jun 2019 20:55:08 +0200 (CEST) Received: from DM6PR07CA0053.namprd07.prod.outlook.com (2603:10b6:5:74::30) by BYAPR07MB4440.namprd07.prod.outlook.com (2603:10b6:a02:c1::21) 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:07 +0000 Received: from BY2NAM05FT030.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::208) by DM6PR07CA0053.outlook.office365.com (2603:10b6:5:74::30) 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:06 +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 BY2NAM05FT030.mail.protection.outlook.com (10.152.100.167) 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:06 +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:57 -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 x54Is4Jo028678; Tue, 4 Jun 2019 11:54:04 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x54Is4Kn028677; Tue, 4 Jun 2019 11:54:04 -0700 From: Shahed Shaikh To: CC: , , , Date: Tue, 4 Jun 2019 11:53:51 -0700 Message-ID: <20190604185352.28629-4-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 X-EOPAttributedMessage: 0 X-Matching-Connectors: 132041481067839559; (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)(376002)(136003)(346002)(39840400004)(396003)(2980300002)(1110001)(339900001)(189003)(199004)(85426001)(14444005)(76176011)(26005)(51416003)(87636003)(80596001)(54906003)(11346002)(5660300002)(81166006)(50226002)(48376002)(6916009)(50466002)(68736007)(36756003)(69596002)(8676002)(446003)(47776003)(336012)(486006)(126002)(476003)(8936002)(36906005)(2616005)(42186006)(450100002)(26826003)(305945005)(105606002)(2351001)(53936002)(2906002)(498600001)(316002)(76130400001)(70206006)(4326008)(70586007)(356004)(86362001)(6666004)(1076003)(16586007)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4440; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 11cbcdeb-95fd-45a7-a90a-08d6e91e2913 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:BYAPR07MB4440; X-MS-TrafficTypeDiagnostic: BYAPR07MB4440: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 0058ABBBC7 X-Microsoft-Antispam-Message-Info: fxQLR6sD7ukmk9sVArs4nRVdLJbOn9tcAx+sFoHwdOYUOzXRO4JHjRs0e+HHBbwbRnCRpn+HvgR9PTjUEvgkrobcpMJ4BmQGWP60t7NTbKVSNVk7o0tQ7NI2oOuO49krTE7sDlSlxRJk501cuGKAVZ1r8Hd3dYFdHdZ/hrTLaGDnrvYb+uQ7FeVg1h/uGT1OS79jI7TIYnAkuFRw76GBca5sUJnNhdlNfdIqwU+Q9f8jy6zOl7bXuu4ClKSLvfBygkzf9f+S/cptzYotwyKAjwwA+7Bh+6WSQJEReTlQWShuv4gbwx4MeaMrgcz/JUOScVxh3dBKk7cm5vaW0HlVWMxllGoLKyaXqB10mnJSdw9kw300Ms9eWKaEY0exYfDnGENFM55rhPpMSkPr0Llqawc804rCjdvtW8/fO7PITpw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2019 18:55:06.4406 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11cbcdeb-95fd-45a7-a90a-08d6e91e2913 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: BYAPR07MB4440 Subject: [dpdk-dev] [PATCH 4/5] net/bnx2x: fix link inconsistent state 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" Don't call bnx2x_link_status_update() from bnx2x_link_update(). Actual use case of bnx2x_link_status_update() is to update the link status in shared memory between driver and MFW, and not to get the link status from HW. So ideally, bnx2x_link_status_update() should be called when there is an actual link event or change in link status. Calling bnx2x_link_status_update() from bnx2x_link_update() may corrupt the data of link status in shared memory and result in inconsistent state of link. Fixes: 540a211084a7 ("bnx2x: driver core") Cc: stable@dpdk.org Signed-off-by: Shahed Shaikh --- drivers/net/bnx2x/bnx2x_ethdev.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index 5dfd708ef..df5634fda 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -88,7 +88,6 @@ bnx2x_link_update(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(sc); - bnx2x_link_status_update(sc); memset(&link, 0, sizeof(link)); mb(); link.link_speed = sc->link_vars.line_speed; From patchwork Tue Jun 4 18:53:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shahed Shaikh X-Patchwork-Id: 54366 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E24031B9C4; Tue, 4 Jun 2019 20:55:15 +0200 (CEST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780078.outbound.protection.outlook.com [40.107.78.78]) by dpdk.org (Postfix) with ESMTP id 58C521B9B2; Tue, 4 Jun 2019 20:55:13 +0200 (CEST) Received: from DM5PR07CA0073.namprd07.prod.outlook.com (2603:10b6:4:ad::38) by SN6PR07MB4670.namprd07.prod.outlook.com (2603:10b6:805:3a::29) 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:12 +0000 Received: from BY2NAM05FT042.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by DM5PR07CA0073.outlook.office365.com (2603:10b6:4:ad::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1943.18 via Frontend Transport; Tue, 4 Jun 2019 18:55:12 +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 BY2NAM05FT042.mail.protection.outlook.com (10.152.100.179) 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:11 +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:54:01 -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 x54Is7ef028682; Tue, 4 Jun 2019 11:54:07 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x54Is7sK028681; Tue, 4 Jun 2019 11:54:07 -0700 From: Shahed Shaikh To: CC: , , , Date: Tue, 4 Jun 2019 11:53:52 -0700 Message-ID: <20190604185352.28629-5-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 X-EOPAttributedMessage: 0 X-Matching-Connectors: 132041481116846527; (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)(376002)(39850400004)(396003)(346002)(2980300002)(1110001)(339900001)(189003)(199004)(6666004)(356004)(85426001)(2906002)(76176011)(53936002)(51416003)(486006)(54906003)(1076003)(5660300002)(81156014)(70586007)(76130400001)(50226002)(16586007)(8676002)(70206006)(8936002)(81166006)(305945005)(80596001)(87636003)(2351001)(26826003)(316002)(69596002)(36906005)(105606002)(498600001)(14444005)(476003)(450100002)(11346002)(126002)(2616005)(36756003)(6916009)(4326008)(50466002)(48376002)(68736007)(47776003)(446003)(42186006)(26005)(86362001)(336012); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4670; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5b557be1-7f8d-47b6-82ed-08d6e91e2c0b X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:SN6PR07MB4670; X-MS-TrafficTypeDiagnostic: SN6PR07MB4670: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 0058ABBBC7 X-Microsoft-Antispam-Message-Info: D3kl3ojvLArgrFXvcx/cU5cy6CSRZex88JwJ5JKC6iV1G/pn/nyqEdi1lbQBxpIk28acB2p03gh6R91OmPNPf3A44IyzVd5qVzQBsGRJmz92EguP8BssYX72JDzDWGhwIkCr7j8KAFQ26BBfvlVjM9BU+gBrl8RjuNr8Kd2iM+5AX4Gtjovo6xEklDkMms3z9BZGsfb2Ivr51cSGtLRh2x08KUglbJUUSap1YwlKT7SgmO+kcGxdmmBiqn3dty32Swa2eSb1Hfo7cJGKlEeHpUkXjWqzn6vRePcVfgQ85BiXx3gTCx4PKJdpjSDi6UZRSazG9PgUKJyJem6sTh1oA/SyezrmbHQZ/MLoWaJWGBggUEYCJeYGVmQigzTou8fk4aLvntcreWBIJaK7FYyWg7AzxFEFLlRVkSdyUdePLao= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2019 18:55:11.3984 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b557be1-7f8d-47b6-82ed-08d6e91e2c0b 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: SN6PR07MB4670 Subject: [dpdk-dev] [PATCH 5/5] net/bnx2x: fix supported max Rx and Tx descriptor count 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" Driver does not provide limit on number Rx and Tx descriptors per queue, this may result in application configuring 64k descriptors (default set by rte_eth_dev_info_get()) and further result in issues in PMD and HW flows due to unsupported number. Fixes: 540a211084a7 ("bnx2x: driver core") Cc: stable@dpdk.org Signed-off-by: Shahed Shaikh --- drivers/net/bnx2x/bnx2x.h | 10 ++++++++-- drivers/net/bnx2x/bnx2x_ethdev.c | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index ef1688ff3..e4b4ecf1e 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h @@ -155,13 +155,14 @@ struct bnx2x_device_type { * Transmit Buffer Descriptor (tx_bd) definitions* */ /* NUM_TX_PAGES must be a power of 2. */ +#define NUM_TX_PAGES 16 #define TOTAL_TX_BD_PER_PAGE (BNX2X_PAGE_SIZE / sizeof(union eth_tx_bd_types)) /* 256 */ #define USABLE_TX_BD_PER_PAGE (TOTAL_TX_BD_PER_PAGE - 1) /* 255 */ #define TOTAL_TX_BD(q) (TOTAL_TX_BD_PER_PAGE * q->nb_tx_pages) /* 512 */ #define USABLE_TX_BD(q) (USABLE_TX_BD_PER_PAGE * q->nb_tx_pages) /* 510 */ #define MAX_TX_BD(q) (TOTAL_TX_BD(q) - 1) /* 511 */ - +#define MAX_TX_AVAIL (USABLE_TX_BD_PER_PAGE * NUM_TX_PAGES - 2) #define NEXT_TX_BD(x) \ ((((x) & USABLE_TX_BD_PER_PAGE) == \ (USABLE_TX_BD_PER_PAGE - 1)) ? (x) + 2 : (x) + 1) @@ -182,13 +183,14 @@ struct bnx2x_device_type { /* * Receive Buffer Descriptor (rx_bd) definitions* */ -//#define NUM_RX_PAGES 1 +#define MAX_RX_PAGES 8 #define TOTAL_RX_BD_PER_PAGE (BNX2X_PAGE_SIZE / sizeof(struct eth_rx_bd)) /* 512 */ #define USABLE_RX_BD_PER_PAGE (TOTAL_RX_BD_PER_PAGE - 2) /* 510 */ #define RX_BD_PER_PAGE_MASK (TOTAL_RX_BD_PER_PAGE - 1) /* 511 */ #define TOTAL_RX_BD(q) (TOTAL_RX_BD_PER_PAGE * q->nb_rx_pages) /* 512 */ #define USABLE_RX_BD(q) (USABLE_RX_BD_PER_PAGE * q->nb_rx_pages) /* 510 */ #define MAX_RX_BD(q) (TOTAL_RX_BD(q) - 1) /* 511 */ +#define MAX_RX_AVAIL (USABLE_RX_BD_PER_PAGE * MAX_RX_PAGES - 2) #define RX_BD_NEXT_PAGE_DESC_CNT 2 #define NEXT_RX_BD(x) \ @@ -244,6 +246,10 @@ struct bnx2x_device_type { #define MIN_RX_AVAIL(sc) \ ((sc)->dropless_fc ? BD_TH_HI(sc) + 128 : 128) +#define MIN_RX_SIZE_NONTPA_HW ETH_MIN_RX_CQES_WITHOUT_TPA +#define MIN_RX_SIZE_NONTPA (RTE_MAX((uint32_t)MIN_RX_SIZE_NONTPA_HW,\ + (uint32_t)MIN_RX_AVAIL(sc))) + /* * dropless fc calculations for RCQs * Number of RCQs should be as number of buffers in BRB: diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index df5634fda..5be487765 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -480,6 +480,7 @@ static void bnx2x_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct bnx2x_softc *sc = dev->data->dev_private; + dev_info->max_rx_queues = sc->max_rx_queues; dev_info->max_tx_queues = sc->max_tx_queues; dev_info->min_rx_bufsize = BNX2X_MIN_RX_BUF_SIZE; @@ -487,6 +488,10 @@ bnx2x_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_mac_addrs = BNX2X_MAX_MAC_ADDRS; dev_info->speed_capa = ETH_LINK_SPEED_10G | ETH_LINK_SPEED_20G; dev_info->rx_offload_capa = DEV_RX_OFFLOAD_JUMBO_FRAME; + + dev_info->rx_desc_lim.nb_max = MAX_RX_AVAIL; + dev_info->rx_desc_lim.nb_min = MIN_RX_SIZE_NONTPA; + dev_info->tx_desc_lim.nb_max = MAX_TX_AVAIL; } static int