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 34DF3A0096 for ; Tue, 4 Jun 2019 20:55:47 +0200 (CEST) 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 Content-Type: text/plain 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 -- 2.12.3