From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30069.outbound.protection.outlook.com [40.107.3.69]) by dpdk.org (Postfix) with ESMTP id 87F8F2B92; Wed, 8 Aug 2018 21:33:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S//31g4yQ1+PTKXhqcewi/U79IFDJTTQFbfsr/ripm0=; b=uI6X2X1OL4O0qyfCaJOyGgTBPjzIbYSKK55Gx8XLba5+x1JGjplPkXhsSDlyr1U8IVEVQeF7ppnE3nyZyH/jicWJsUDeMGSvWao6zOkt+yhspp99QNVA2EDS52HPbF9n9bdCxArHVFKFu+NVGe3FUIzUNjsNTVwruz4aQZj6EuA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from mellanox.com (209.116.155.178) by AM6PR0502MB3973.eurprd05.prod.outlook.com (2603:10a6:209:1c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.20; Wed, 8 Aug 2018 19:33:02 +0000 From: Yongseok Koh To: shahafs@mellanox.com Cc: dev@dpdk.org, Yongseok Koh , stable@dpdk.org Date: Wed, 8 Aug 2018 12:32:47 -0700 Message-Id: <20180808193247.16391-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: MWHPR1201CA0006.namprd12.prod.outlook.com (2603:10b6:301:4a::16) To AM6PR0502MB3973.eurprd05.prod.outlook.com (2603:10a6:209:1c::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7c6b502c-4d03-4470-1e72-08d5fd65c24b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR0502MB3973; X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3973; 3:F2TcJ+B2bYEuYM5DXGxD9Z4cn495sic6RAd4mf+jyg/77cWnZnSUkI4u/5P2GNgmUYnwfYvROvs4ght5zansZWcBQ66NDdIH3qlIuvSzgOZHQMCAqmZitsOk/0A0uog+hvClRI00N4ZudXZl3zNE7NSrspRnER0kxUqUb82WzilkBBdnsV5t2ZYDf7HY0SZOWUmbT72PzqdrSC2M/DeAQuky8qplBg8Jctjl5LlLAjpDDmu8KcmKm3wyuoXaAuHY; 25:x7RHY690GOJP8wdfwCmtd4EPr7lrOQ2y+MlDhUeZvNeZZcMFlCOhCESUpWq0/Hj1X7RecUNjljHlfeu62k4sTbnlMwjROG627mIhWnngZNMiR9RrKfebt3kGBLSYfZD559ZN/GXCSQjtx9ZDxro3I+UNnzhf+V9P9mxUYbEbw66ze3KZ2gUZCkfU+6QzPKqocV3nm4z47Qk7IginsHilBdQOX1QHfK6eQuqDqLYuCycFxnHvVlVfEXx9k+rKiEcM1mGSn8QTlYHzY+f6BEIFs2kSDT9UWVzQtbqEIxwkYY/2vsgklylkvgG8s9zXyCAP+XjT3Elfz4YJPAQzXfnqcg==; 31:X4ol53rdgAHgrNUohNUb5I2cRkMFPLICNPW+fnLGhuvXidYUf8oFX30BvRGccmqn+IfM3CCVsGAL6F81uFfJpDAL34H3RzlClUCsGtpe4vPBBVoNHfHdF/Nwyg2yjFxz+ExzBoPnSvJplQ/7Qz5ibeI7yeI0WkIyqsQmb9K1GAH3O0C2h+kTg3+F05jw9/fEE0Z+NUUu9vygBWhH/yCgybYaNVhYHQEti9CtHL6+RfY= X-MS-TrafficTypeDiagnostic: AM6PR0502MB3973: X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3973; 20:zjyBFcTdBEi8FCsehNR+Irel+fCl2xJkFj0IMsvAhYKXnzpL5NSJzzNT2V/UJH4fZx5d3x5hX+mXQsowUXxBUlKv6Q5hub2EwMG6ZVVZEitEcFryH5zia+SCO3cOy9ERCLWDR37dxYVS+o+MYEs1BBJOpLXE5vHzsTnW8uWdB1hHoCyXKfQR64Xv0yRnPYqCz/Iepdi9S+W1fCX0uRGlhJuzt26cPzRWIEUHLgoiTWSwTNzCgW9YZKOKhpN5jurVbIEFYGjn2ynSlUVzI68VfjwXupQqA3M/dsi6/f47cxPTwkoDWVjypndq9BPlBNx/Eg+v6V5Wg41Y6mxX+XEf8KzTy9Uc9DIixh/UmpzHvl9C3LZZe1lhw/gcFS1po2L27NTSBADTFFmm328sS/zqJTcKomYAHmQexhZi2l522FMLOm6AJRnuGPy1zM+AzTTWOftRa4UPMdx6h4j6w3ExhE2Bj+iwoTaQpXcvKQPMnEQf8vk8CI002u4vWKzqLG/m; 4:OyToNYUlYKaGy2KxVroWMsN53x4pPOlBgUb+8GSKGs3+9ywGlZJF4K75J5d3pr4VQFFpzubcqeXvlywblKmSu1pEYMOBfmnlZjRwCE+cZvfYG0Bc2GgeenePegplcGtJJf0sB/ZEyeHRlOSSxZO4QAiWLHPWFBe4z6ihoySiICx9vp6SmyvgjRvAvne+BDorlGj5ThsLwSXYE6CznbkihZg3CTq4QFcgi8WlfPnAqQF1DYkw/d5t8v1PlfhJnvET30WLVRFgnRb+5/A6CchLXg== 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)(5005006)(8121501046)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:AM6PR0502MB3973; BCL:0; PCL:0; RULEID:; SRVR:AM6PR0502MB3973; X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(136003)(376002)(346002)(199004)(189003)(47776003)(36756003)(1076002)(8936002)(25786009)(6116002)(3846002)(51416003)(26005)(106356001)(21086003)(66066001)(105586002)(16526019)(386003)(305945005)(86362001)(50226002)(69596002)(7736002)(476003)(4326008)(52116002)(34206002)(2906002)(2361001)(7696005)(8676002)(956004)(81166006)(81156014)(2616005)(450100002)(97736004)(6666003)(486006)(14444005)(478600001)(6636002)(53936002)(5660300001)(2351001)(1857600001)(55016002)(316002)(16586007)(50466002)(37006003)(48376002)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3973; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR0502MB3973; 23:Nkd55nxYM6+zriiVLblpM6HySEdBW/Yh4HvP0Qx?= =?us-ascii?Q?XqdS1VLfb8jr3CJF0pSAzkf611VqwjTl5tKtNHyYL1D5NbhlCDDGKieuaO1+?= =?us-ascii?Q?dxq89T45dvfPNem3ke1+xTz09p4zD9H6906/Q0DS+oNzCcLuzffd7Wk02G9I?= =?us-ascii?Q?9C4difaHRSOkTndCGkHc7jVBwfvTZfP8iQY61QV1vk4fNEOLjECWKRMC5nQ2?= =?us-ascii?Q?mdMPgG1qRN6EOra3Gfpea2XR4m3H64S7yTAN08ac6tYqQVC+6//8/KhBxxTZ?= =?us-ascii?Q?jqqLolP/AcJKJd4agfidnw3et1tHygYBe9vzBDRVakHXKZMnDspaZpEA3JHZ?= =?us-ascii?Q?Uez0hP1umd3SQkF+VNghfcrKUz4aiRxt4Y04TvaKwD73DesBXLdxLKVDZZQG?= =?us-ascii?Q?wEPsb2E3vQ5zfoB94I6CNRbZ49BvOZHEcgmxZA8naEJbiZDkPfrU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BuHmTDzPbUa27nfbx8nf6SqLL6FPLjXbgSNGUfr2Wb6F21GTwRSw4OqYZT+tYBtmSWgYDNfrT5MtVkV6KtkAyJXGxeXxrwngxcMGgTP/vCBb3MDRJ7uSAPQDEHN2MQvEMIQYnXxSvbGuZMrh0t4d4Et9c5OCaP5ZDKxR/nOX0CigRnbEOCdbykeGAPTPMVBZ1but/YIgmYP3l1nuV0kqEqhwJuwobC8OZmJW8njISjJmJ3tQ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 19:33:02.5394 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7c6b502c-4d03-4470-1e72-08d5fd65c24b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3973 Subject: [dpdk-dev] [PATCH] net/mlx5: fix minimum size of Multi-Packet Rx queue 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: Wed, 08 Aug 2018 19:33:04 -0000 The size of Rx queue is determined by dividing the number of descriptors by the number of strides. As device can't support single slot queue, if the number of descriptors is same as the number of strides, MPRQ shouldn't be enabled. Otherwise, this will cause HW fault. For example, if rxd is set to 512 with testpmd on ConnectX-4 Lx, PMD can't receive more than 512 packets because the minimum number of strides for ConnectX-4 Lx is 512. Users have to configure larger number of descriptors in this case. Fixes: 7d6bf6b866b8 ("net/mlx5: add Multi-Packet Rx support") Cc: stable@dpdk.org Signed-off-by: Yongseok Koh --- drivers/net/mlx5/mlx5_rxq.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 8b4c1b1a14..1f7bfd4414 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1356,7 +1356,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, sizeof(struct rte_mbuf_ext_shared_info) + RTE_PKTMBUF_HEADROOM; if (mprq_en && - desc >= (1U << config->mprq.stride_num_n) && + desc > (1U << config->mprq.stride_num_n) && mprq_stride_size <= (1U << config->mprq.max_stride_size_n)) { /* TODO: Rx scatter isn't supported yet. */ tmpl->rxq.sges_n = 0; @@ -1411,6 +1411,14 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, dev->data->dev_conf.rxmode.max_rx_pkt_len, mb_len - RTE_PKTMBUF_HEADROOM); } + if (mprq_en && !mlx5_rxq_mprq_enabled(&tmpl->rxq)) + DRV_LOG(WARNING, + "port %u MPRQ is requested but cannot be enabled" + " (requested: desc = %u, stride_sz = %u," + " supported: min_stride_num = %u, max_stride_sz = %u).", + dev->data->port_id, desc, mprq_stride_size, + (1 << config->mprq.stride_num_n), + (1 << config->mprq.max_stride_size_n)); DRV_LOG(DEBUG, "port %u maximum number of segments per packet: %u", dev->data->port_id, 1 << tmpl->rxq.sges_n); if (desc % (1 << tmpl->rxq.sges_n)) { -- 2.11.0