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 B9198A034F for ; Mon, 21 Feb 2022 20:46:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2EB64013F; Mon, 21 Feb 2022 20:46:54 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2040.outbound.protection.outlook.com [40.107.101.40]) by mails.dpdk.org (Postfix) with ESMTP id 23A304013F for ; Mon, 21 Feb 2022 20:46:52 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hNATJveRlEncyHR0iRHHrDWZzgimgfJLF2nRJY4eOGjNKUTJSIysy4Y6MmPAb35wT3Wn/mmecMTYBH3KuIEqKy6Jw7q69bljf7icvmB9e2vrZSzEmsnmUCjbY+VCXy7kmAVSmBj8jhvoxW0/1jt1zp/vDwmViWOSHczHkUkHS2sdSol35cgp3P0t7Ut1ssn/Z8rlaZppLTJz+Ze/SfYAbrpHGnwVQ2kKRPwx7r8/yLQ2B59WXSx0ucXQtqJ+iGcK5xU7ERYXqv//lVUW6cM5fFKcFcXnTHjD3fCzaSJ01ISlAKwr38beM4bXYXFfaIgJtu9PBu8TbF119/2y2V3eAA== 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=epIPzFB4oN9JnxpXMYZ0mp4o6xprkAm79AU7wTWrV/Eep8m1LIG8HJc2DDj9ynEep1jqiIjgGoKCqepNmnbF8A9UAX+JvW5a3jGrGrqxEjKfFLmG/oIJUn1vQR7MFBNBeRa5JqxfAuj0Pja6Tj40c7MTnQMHn9ueNaCfDxN5kSNcciQO1Mv47slIuAcW0FeaC2vnbw4XPQwpq0PuOzovoJvchcqUHzaUK7sDtCoyWler2VTagi5A96uK3p55Ey/rgP8YgZNLlnhkzOl+S/0rNurQzTcMkBtspPfCyWVXNlteeWFGVUMgVefy2pgwGa62rbJGizZhx3fBhrhxXggDCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=Fk7TnLcewTpmhInYfx79EyePZet3zpJLlg0xOeDcXFDkpbeKhrzRyck4OOFN9R4OfUu0jf2vd+ViOP5D/SmKfLEJ1ErzbAEmJsFLGKly1V9yctGTOSZFCBUu2EVLQXLaHR8D8q8mJ40RkyyMFz8vUwAasyX1jyY1Xv4eDvaemSopXCkj3r50C3k3aT5L3OYh5/oDxnU9IiyroPALXqaqC2mMjbzjBtPVdpsJSWHuhBiXFLy13X3ihu97SvJKbdJRq5ekG2/iqsdEySLbSrQSpUOQRBvrX6IGXqsFhIXI4w6Uo9dlgblD/7xg8rJyjcyLrrcERKbvfibq7dGnMxVeXQ== Received: from BN8PR04CA0032.namprd04.prod.outlook.com (2603:10b6:408:70::45) by SN1PR12MB2352.namprd12.prod.outlook.com (2603:10b6:802:25::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.24; Mon, 21 Feb 2022 19:46:49 +0000 Received: from BN8NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:408:70:cafe::98) by BN8PR04CA0032.outlook.office365.com (2603:10b6:408:70::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14 via Frontend Transport; Mon, 21 Feb 2022 19:46:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT052.mail.protection.outlook.com (10.13.177.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Mon, 21 Feb 2022 19:46:49 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 21 Feb 2022 19:46:48 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Mon, 21 Feb 2022 11:46:47 -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; Mon, 21 Feb 2022 11:46:46 -0800 From: Michael Baum To: CC: Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH 20.11 4/5] net/mlx5: fix memory socket selection in ASO management Date: Mon, 21 Feb 2022 21:46:34 +0200 Message-ID: <20220221194635.2458173-5-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221194635.2458173-1-michaelba@nvidia.com> References: <20220221194635.2458173-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: 620330f2-35fb-4703-7240-08d9f572e6c2 X-MS-TrafficTypeDiagnostic: SN1PR12MB2352: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: fbRC0AjHa5Li0Lgg7Mp40w/ES1Mk5zs8Z5OsWgvJPneoBsJYJQkmZzJ4YPVYPZGgivLQdQTzbppLHi3+5vsFz+5Ep85nOUMbJHFOAhVHhI39uZDTNE4Nx3Fb8PPY3B23jsnCd9EmfvwngPWml0QHvacOHH6coeq+RhdYH8VEGWpOQbgLv2/+N+l4bUcXIBtX2LEUPv8F7X8pDITjD4AeqAPTUxuYYWDR2aG7blOQ90FuwwKfwrT4WQpBS4Lyr/etIAxZfnmli6A9l1283eQBsN0dxfxwBUqpk0GRgMS7/fxsz5uhdkR12Uwl96uBpx2fNlQKAfCKqnU+OL60gekGPonoLhZxjT9cYxVuFazAyqX+dplH0LN1wH0xDXXeJkP6EW2Cy+2BJRF7HU++jpEhTyD6nIPyFXw5P817IyWONaHoWrDFqQXdbyNnOIhy99FT2JhrKzNn9zBGlM+x8R12ML87t6l/y5qAl9tqo/BNkEo8lO9EWULBAHndOI/GotndlsAobkvGddq6lfviwgmh3/GjvhgZ7gytNbVQi63bbzxPEODRbnpef6AEtCSoGHsra+NXBGJr5qTcR2/paIsDURyA7e7KCov7J5QpofHTBBFdbjWyTltPofRXfmyvZIUzEWMsTvRM0aeiuEUCGSIQFQbc6zUY4VQ/aScMoHc8JemciIge+SXBLR5Zqll5U9dxzhBUn7XTrZvPDNrK239XtQ== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(26005)(6286002)(86362001)(2616005)(426003)(336012)(316002)(81166007)(356005)(54906003)(186003)(6916009)(70586007)(70206006)(4326008)(8676002)(1076003)(36756003)(107886003)(83380400001)(47076005)(6666004)(8936002)(2906002)(82310400004)(36860700001)(5660300002)(508600001)(40460700003)(55016003)(7696005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2022 19:46:49.4496 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 620330f2-35fb-4703-7240-08d9f572e6c2 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.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2352 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