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 6657DA0547; Sun, 17 Oct 2021 11:42:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A0194111A; Sun, 17 Oct 2021 11:42:15 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2060.outbound.protection.outlook.com [40.107.100.60]) by mails.dpdk.org (Postfix) with ESMTP id 91C9441101 for ; Sun, 17 Oct 2021 11:42:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bbV57RdOYaliC7YtxdVQjfR2VcJfW/ckgMn+FOmPnSp+gGombR9HVzh3gRDBx2yG9r6CTJuVcqg3Ox8VKANwkB4y18fOHKO1JrWMIpnEOHZBW7XdTrwvHT9b/wXXzlZ08sN9gWJPCIYllPoaj3xnkqF4KrkEndIuYOqykJgUy3ToEmFFE2btkheaM96SijSD8LMa6wL/9g29B0j+5svOp9hJZux7VWBSTpJrCdaDj0Ry8QkNfTPLx17zU0IPSBxbcRS/CmeKwtWpbBbAEBYsi+HMRl6lxtc0fAdNAqf2NvO7YXbEAF8RgnPsJn5awsT9PH+Ve9Er4t0AgD73kBJhMg== 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=QylP90DV8gmRATDL8EkuggzATZtc8sEmbFpMpuUFNNY=; b=TWh/zGcjO8faxm9cM148/cMiuQ1zDnxiB9rSM9aOvbcPFS5Bf5TcZBqWktx0LtqL6oNfDfeOTJAf0HrdAawkzGSL70WmijaTq5TwrTzYQ6ME0MGtoFkE1ML/SzSLPXw5mfYAeWPPYP0McIjuF0xU0nj4qRC4OprXAi6KhIfXnaxcJAw/qO2LqqU86lTgPDtrENFk3K+wzBoRMZHSyUwq/haG8zPrEjNhxEZAnNMTopTt0hPNxIdjHTR/HVHZ60vfFyduQg+q5ZBy3GzYgwSQlA0yxBGlsS/wVLnCmeE7lg4HZGkFXN6Ovafgcs0SV2JA46xGxFJ759xjaP9HyVRDNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=QylP90DV8gmRATDL8EkuggzATZtc8sEmbFpMpuUFNNY=; b=lugAugnwDGR6t37Vk5jyH8QHz91EtZOzQhMp645YEM5MD0TW2xMX3sqlkEcP7lQTAGWDRq5KhJEcxFPgBPW6IJvnDZb6oAB8xFaymC0tCHBSN4idnYgaEeSnhaElcBxukp5KOvpW3eyc3MWOZ9/pUPJd7D87sdQ+Z0ESDXR0T/FC4lEHxsAOgWNmdfUxxwKv2rtiKLo0VY2mJhTjJOd3NgkW9oxPJmWCa8eRW++HuzFeazYhSgIO0X6BwXgVvz0d0TOcQsea51FselKaXult4gYCAXFo2/DBNe5fPaCZMpqU8ACriWiUrLrcsd4d1KN7VOzAg+CA9e04CXmlqWkFqQ== Received: from BN9PR03CA0635.namprd03.prod.outlook.com (2603:10b6:408:13b::10) by CY4PR1201MB0261.namprd12.prod.outlook.com (2603:10b6:910:1c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Sun, 17 Oct 2021 09:42:08 +0000 Received: from BN8NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13b:cafe::bc) by BN9PR03CA0635.outlook.office365.com (2603:10b6:408:13b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16 via Frontend Transport; Sun, 17 Oct 2021 09:42:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT032.mail.protection.outlook.com (10.13.177.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4608.15 via Frontend Transport; Sun, 17 Oct 2021 09:42:07 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 17 Oct 2021 09:42:05 +0000 From: Tal Shnaiderman To: CC: , , , , , , , Date: Sun, 17 Oct 2021 12:41:28 +0300 Message-ID: <20211017094133.18988-3-talshn@nvidia.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20211017094133.18988-1-talshn@nvidia.com> References: <20211017094133.18988-1-talshn@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0b49952-07db-4aec-5a68-08d9915262dc X-MS-TrafficTypeDiagnostic: CY4PR1201MB0261: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XQA6cF6vxlrqUOmIgdtmnxhZhZSz1J4/EfvCGvV7H51mxWtosPszy3YnDKgvEsn9DulXvGsWMHQH5bycVS48Dlh6CFH+qnn2SIAHc73xxiR3sdm1jmtIHNlrc49qY2P14yt1yBW2LrqjuAnezSGVNxT5gvZnv3kGgjZF2OSC7i4sMSVv2i5c7p4yW4MVAOZEFpq41Z2FXdCNHlUp0RDkTvF836hKGfV4RC3yBozeYroGOWTg+yAqVqq90R859TVluEXKi4XlkyIY7MC2jjmwnRbWu07tFYdDCKufUhXL2rtYSjSxwukJlgBNWRlDIQrh57X8IzGPQQXTYGJebxcprBFbFJAvVRsgOpadWnYeH/AKXw+T7Ma9tJSCdXd8MQtorst6xIfvoSa9K2luY/UTJXkjtxOT/ll/PLJeMjvJ5O2/k5RzZKz4EoPrGcOy1rbrtDm14ZJVW+duuXmSPc/PWtCN2n1RGFgQq2hAeWhw4OjcJ/CVcDACXYfJw9MVqXTw7fDpIQzwYM6ys3tsux729S2w6QK3nt6cJTQYnk60aOl5eyN6aI5l8c/9SP/P+Z4ScotpPjrQqrUtjvti8L76icZYzcruw+SCL1QSh0iJFDJXx/g/InWcRDsoB1Zs6pMpGcBN9avI7mVaocmx4CSwHkClenDqcy0LVIyrLCVpKBRgj59LHOD8qTyvL1wzfg/95xplWD+iH9ibCAbQSqHe5w== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(8676002)(356005)(5660300002)(4326008)(1076003)(8936002)(7636003)(6666004)(36756003)(55016002)(54906003)(316002)(36906005)(6916009)(508600001)(86362001)(83380400001)(426003)(26005)(336012)(2616005)(70206006)(70586007)(16526019)(7696005)(47076005)(82310400003)(36860700001)(6286002)(186003)(107886003)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2021 09:42:07.9920 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0b49952-07db-4aec-5a68-08d9915262dc X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0261 Subject: [dpdk-dev] [PATCH v2 2/6] crypto/mlx5: replace UNIX functions with EAL functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Use the OS agnostic EAL function rte_mem_page_size to get page size value instead of the Linux specific implementation. Also remove the usage of PTHREAD_MUTEX_INITIALIZER which is not support in Windows and initialize priv_list_lock in RTE_INIT. Signed-off-by: Tal Shnaiderman Acked-by: Matan Azrad --- drivers/crypto/mlx5/mlx5_crypto.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c index 2af5194c05..791bec03f9 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.c +++ b/drivers/crypto/mlx5/mlx5_crypto.c @@ -4,6 +4,7 @@ #include #include +#include #include #include #include @@ -33,7 +34,7 @@ TAILQ_HEAD(mlx5_crypto_privs, mlx5_crypto_priv) mlx5_crypto_priv_list = TAILQ_HEAD_INITIALIZER(mlx5_crypto_priv_list); -static pthread_mutex_t priv_list_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t priv_list_lock; int mlx5_crypto_logtype; @@ -688,7 +689,7 @@ mlx5_crypto_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id, attr.pd = priv->cdev->pdn; attr.uar_index = mlx5_os_get_devx_uar_page_id(priv->uar); attr.cqn = qp->cq_obj.cq->id; - attr.log_page_size = rte_log2_u32(sysconf(_SC_PAGESIZE)); + attr.log_page_size = rte_log2_u32(rte_mem_page_size()); attr.rq_size = 0; attr.sq_size = RTE_BIT32(log_nb_desc); attr.dbr_umem_valid = 1; @@ -1014,6 +1015,7 @@ static struct mlx5_class_driver mlx5_crypto_driver = { RTE_INIT(rte_mlx5_crypto_init) { + pthread_mutex_init(&priv_list_lock, NULL); mlx5_common_init(); if (mlx5_glue != NULL) mlx5_class_driver_register(&mlx5_crypto_driver); -- 2.16.1.windows.4