From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 07BA4A00C3 for ; Wed, 23 Feb 2022 17:07:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0216A41145; Wed, 23 Feb 2022 17:07:39 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2060.outbound.protection.outlook.com [40.107.101.60]) by mails.dpdk.org (Postfix) with ESMTP id F22B941145 for ; Wed, 23 Feb 2022 17:07:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IAJdZ5IEbn2VZAArU1yywxiJaUgZA70uXxVbHNjILjYPoqxkEPY0eqbLHoRbEngN+a7oltgHdJUMiqXJ7EPOpOYa2lCGq8ax8KwCW9A0vFf7xzcArNOM+l1EOx7cCloD9uHxeqLvx1L8coKkYvjmAzUzDUU6FxqCvLNlGF/GA4iMLqDk8vGy+zPQAGpZI0uFMIxYPTllcKA5C1XiZKZ+9scNKLPNIMjIji/kWGVC96V6TkFR01LMpPPFGYW1Dt+8MPiEai7pNH7q1uEj2eLTyJM9qLmyc+Z7MWMxpVPjMrj/r467BrRaP9lBdMiaUtTlkvIUAAYwp93TfktkWYDt2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5LumBUoTKe7ahHIUaczHrhK+/XN1RPO5kl8kdvMWfp4=; b=UZME6JcYIlRPTDzl9E1bPM25M9XIAmsuz9uobOzqDangLkkl5C9oDTMr58LWIGmzA6HJAeS1Gyzx7zdjgYbBhtwSDeQ4WkLYlhHyulCe2J86EU/+/llAGU1UHS94Lh1QtQwPjr7Cix5/9D/EC3TjAn/utQ4/VB6nUSFw1dkEMOjG2+Q5I/JKgIaRecwHY7F6oYQqGnhrY/XUHeX86HQiCeLvOkymtNMHms4ZY2VJTV5fBG6+1XiQZV3SQabu4safMUULy6dUkajJKpFxEWSzQO/GVsKgoLZCdYnwzDYbzT0phv1zMB2AsYWp077/VwxeH9iJvhCiy7qYmFtAp5lthw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5LumBUoTKe7ahHIUaczHrhK+/XN1RPO5kl8kdvMWfp4=; b=HtOlrJd56TJrWL7VZ3jpLpLDcAbqQvqf7IKeD60saQXVYuziFQ0CiwO6gPmuTNVYy4UAoPo1I/NXmmC+czOY2W4xMy8HB/KhiEc8/rgLDc4NF+pCOLuGyf0ee2cSBLqkOg6y7+u9gp+mO4/q/TgvZtZalh41/GCOArjTTbCQfJ/W116JufJcB132WZD3sfm/Q3+6ddS5FeFVSbQoxorHELFOwA6JtKeLaial3hGgnSmgGmXIOlNZX+vhISm9OGx/3Iai5EB6dB0tmA3IO48k+6jXEyr+1bQqF267H7HpAXtynMAbEpICWMdg7S5fBvqMJG9/0uuoGvO34znmJS1HlA== Received: from MWHPR07CA0007.namprd07.prod.outlook.com (2603:10b6:300:116::17) by LV2PR12MB6013.namprd12.prod.outlook.com (2603:10b6:408:171::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22; Wed, 23 Feb 2022 16:07:35 +0000 Received: from CO1NAM11FT067.eop-nam11.prod.protection.outlook.com (2603:10b6:300:116:cafe::30) by MWHPR07CA0007.outlook.office365.com (2603:10b6:300:116::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.22 via Frontend Transport; Wed, 23 Feb 2022 16:07:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by CO1NAM11FT067.mail.protection.outlook.com (10.13.174.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5017.22 via Frontend Transport; Wed, 23 Feb 2022 16:07:35 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 23 Feb 2022 16:07:27 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Wed, 23 Feb 2022 08:07:26 -0800 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9 via Frontend Transport; Wed, 23 Feb 2022 08:07:25 -0800 From: Michael Baum To: CC: Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH 20.11 v2 4/5] net/mlx5: fix memory socket selection in ASO management Date: Wed, 23 Feb 2022 18:07:12 +0200 Message-ID: <20220223160713.2992784-5-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220223160713.2992784-1-michaelba@nvidia.com> References: <20220223160713.2992784-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fcf5c900-06d6-46bf-165e-08d9f6e69af4 X-MS-TrafficTypeDiagnostic: LV2PR12MB6013:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DFkUBv9eduiDjSqpuZ2uFAlWIw2CEl4n5gtwDp06AbT+Bvhsj8z9DIG+MvUkHzCPuKN8GLOlaG9Wn+/hbQcnMlwxqm7tVsplqzBdhCRvRqRxiRx52SvzjNkHhEIcYfkX5axOTSVeUxTttQKKeiEGxQg/Sf0GjeECmYJBUHxYg+1hSxiHnIFF7yQQnXRNkttHV/3+jY4+Lpzpz+hB4BGeIHfqp9zRcjiIiKSb499h0MhmSuMTKMQRBGgm/u0sYIyWl4tSaurrkB9yFUkBR0B3QNp4N/voXycZ59NEx/CSXysgwREwYjcaHhdtJr9x/8O8ZMpkIn6Tvo9/QXYYCEJAAtmR/n9TEOrzeCRkwm26TEM/6uxoRXAzd88flWwNynKtthWidnFkc4W860ObEndX+JMgouFJdC5A3iXJdn/sT1WBhRF4NheFWF3eNjJuJsV2BlcBamB+z8koUX2ZtYdAdA1HdZklG4rwp/5HanN2ItfpS7ynxOTZyHsKoo1sZGTcvM15rcitk6w3JgheagQtX++7vUr/kWN+AiwIovi7zwGtSiMiaLo5XROGPZBKHohMnLnnbjBAIyLagf/JqaDbGlyG55XKtRyFE12GIphw61LziKmMXo8L45Q5CxhAw8zotzGBlX8VMbAFx6cF/y/+rpO6vEDajet6XdFZT+ZQJNCNGtJV48yGQOZ294/wIqKywLyVQpBP5IO6SkwLmO61Xw== X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(36860700001)(47076005)(6286002)(83380400001)(186003)(426003)(336012)(107886003)(26005)(1076003)(8936002)(70586007)(70206006)(2906002)(4326008)(8676002)(36756003)(5660300002)(54906003)(86362001)(508600001)(55016003)(82310400004)(6916009)(316002)(7696005)(2616005)(81166007)(40460700003)(356005)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2022 16:07:35.1140 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fcf5c900-06d6-46bf-165e-08d9f6e69af4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB6013 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 [ upstream commit 147f6fb42bd7637b37a9180b0774275531c05f9b ] In ASO objects creation (WQE, CQE and MR), socket number is given as a parameter. The selection was wrongly socket 0 hardcoded even if the user didn't configure memory for this socket. This patch replaces the selection to default socket (SOCKET_ID_ANY). Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging") Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_age.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_age.c b/drivers/net/mlx5/mlx5_flow_age.c index 6c4ee0d33c..aae7a3758a 100644 --- a/drivers/net/mlx5/mlx5_flow_age.c +++ b/drivers/net/mlx5/mlx5_flow_age.c @@ -38,8 +38,6 @@ mlx5_aso_cq_destroy(struct mlx5_aso_cq *cq) * Pointer to CQ to create. * @param[in] log_desc_n * Log of number of descriptors in queue. - * @param[in] socket - * Socket to use for allocation. * @param[in] uar_page_id * UAR page ID to use. * @param[in] eqn @@ -50,7 +48,7 @@ mlx5_aso_cq_destroy(struct mlx5_aso_cq *cq) */ static int mlx5_aso_cq_create(void *ctx, struct mlx5_aso_cq *cq, uint16_t log_desc_n, - int socket, int uar_page_id, uint32_t eqn) + int uar_page_id, uint32_t eqn) { struct mlx5_devx_cq_attr attr = { 0 }; size_t pgsize = sysconf(_SC_PAGESIZE); @@ -60,7 +58,7 @@ mlx5_aso_cq_create(void *ctx, struct mlx5_aso_cq *cq, uint16_t log_desc_n, cq->log_desc_n = log_desc_n; umem_size = sizeof(struct mlx5_cqe) * cq_size + sizeof(*cq->db_rec) * 2; cq->umem_buf = mlx5_malloc(MLX5_MEM_RTE | MLX5_MEM_ZERO, umem_size, - 4096, socket); + 4096, SOCKET_ID_ANY); if (!cq->umem_buf) { DRV_LOG(ERR, "Failed to allocate memory for CQ."); rte_errno = ENOMEM; @@ -123,8 +121,6 @@ mlx5_aso_devx_dereg_mr(struct mlx5_aso_devx_mr *mr) * Size of MR buffer. * @param[in/out] mr * Pointer to MR to create. - * @param[in] socket - * Socket to use for allocation. * @param[in] pdn * Protection Domain number to use. * @@ -133,12 +129,12 @@ mlx5_aso_devx_dereg_mr(struct mlx5_aso_devx_mr *mr) */ static int mlx5_aso_devx_reg_mr(void *ctx, size_t length, struct mlx5_aso_devx_mr *mr, - int socket, int pdn) + int pdn) { struct mlx5_devx_mkey_attr mkey_attr; mr->buf = mlx5_malloc(MLX5_MEM_RTE | MLX5_MEM_ZERO, length, 4096, - socket); + SOCKET_ID_ANY); if (!mr->buf) { DRV_LOG(ERR, "Failed to create ASO bits mem for MR by Devx."); return -1; @@ -240,8 +236,6 @@ mlx5_aso_init_sq(struct mlx5_aso_sq *sq) * Context returned from mlx5 open_device() glue function. * @param[in/out] sq * Pointer to SQ to create. - * @param[in] socket - * Socket to use for allocation. * @param[in] uar * User Access Region object. * @param[in] pdn @@ -255,7 +249,7 @@ mlx5_aso_init_sq(struct mlx5_aso_sq *sq) * 0 on success, a negative errno value otherwise and rte_errno is set. */ static int -mlx5_aso_sq_create(void *ctx, struct mlx5_aso_sq *sq, int socket, +mlx5_aso_sq_create(void *ctx, struct mlx5_aso_sq *sq, struct mlx5dv_devx_uar *uar, uint32_t pdn, uint32_t eqn, uint16_t log_desc_n, uint32_t ts_format) { @@ -268,14 +262,15 @@ mlx5_aso_sq_create(void *ctx, struct mlx5_aso_sq *sq, int socket, int ret; if (mlx5_aso_devx_reg_mr(ctx, (MLX5_ASO_AGE_ACTIONS_PER_POOL / 8) * - sq_desc_n, &sq->mr, socket, pdn)) + sq_desc_n, &sq->mr, pdn)) return -1; - if (mlx5_aso_cq_create(ctx, &sq->cq, log_desc_n, socket, + if (mlx5_aso_cq_create(ctx, &sq->cq, log_desc_n, mlx5_os_get_devx_uar_page_id(uar), eqn)) goto error; sq->log_desc_n = log_desc_n; - sq->umem_buf = mlx5_malloc(MLX5_MEM_RTE | MLX5_MEM_ZERO, wq_size + - sizeof(*sq->db_rec) * 2, 4096, socket); + sq->umem_buf = mlx5_malloc(MLX5_MEM_RTE | MLX5_MEM_ZERO, + wq_size + sizeof(*sq->db_rec) * 2, + 4096, SOCKET_ID_ANY); if (!sq->umem_buf) { DRV_LOG(ERR, "Can't allocate wqe buffer."); rte_errno = ENOMEM; @@ -347,7 +342,7 @@ mlx5_aso_sq_create(void *ctx, struct mlx5_aso_sq *sq, int socket, int mlx5_aso_queue_init(struct mlx5_dev_ctx_shared *sh) { - return mlx5_aso_sq_create(sh->ctx, &sh->aso_age_mng->aso_sq, 0, + return mlx5_aso_sq_create(sh->ctx, &sh->aso_age_mng->aso_sq, sh->tx_uar, sh->pdn, sh->eqn, MLX5_ASO_QUEUE_LOG_DESC, sh->sq_ts_format); } -- 2.25.1