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 20DBEA0C47; Tue, 12 Oct 2021 17:54:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 86448411BA; Tue, 12 Oct 2021 17:54:50 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2068.outbound.protection.outlook.com [40.107.243.68]) by mails.dpdk.org (Postfix) with ESMTP id A00E9411B9 for ; Tue, 12 Oct 2021 17:54:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FV7+/e3TKlQQspX30vISLpbrxM0AkuD5+NS0dgdUTmx8RYnNI/++rRwYJfwE7nHo7cz4SqbYn2P8SiFD9WoUhve9JFNFUk0MTFHDiC+ZHyfdowZB6vYLDyNEQFlKM17jT/myjPANm9CUhc55il/TGdSKsCEIdKKntvHatHRp+D46ea/rRTphfGJDKpbjwbnv33UbRpDQLYnqO465eV7Q/aPtGaX0Y71TMa/bK+eNjuuUyJE7s7RjfG+edBgICQNqxhKMBuX3eufmFWCAx+t0HVuOu6ZRRCbOKvEHbdpLjUKKtS7W++5tViYI1dIOvn44Si9pzC0P1cEfQQ2rGQWcUw== 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=AdoYxCGMCzJLES2exRMwUZEUYfpv7CSKTLmxxKJhid7bpa2cnHzg3Ttm20wfAKin4WCRMnKsyyTef6pBeNQHmNmrxiJPb9QvgPe8FpQN/IW35uuxFgdAUg75cGFkNFnPphSQQNJ/c759aDB0gr4R2eOZZnxl7wH/bINplIjfs75I7Dk1pJBHoaC8HFC9WRK6n7AB+tXBImp/Q0rp7mZWfugyI3bH3PsWVOnJfcvgxNJ++jLwTzsBPO5QSg77a4MrCxfeQwY5n+QEGD0GLaZzDdQTSBOa18Tn9bwLu3RVa6BTlDpijnUWWlsbPiFsPr3+qYymxnuqOIyPXY2kE1iW8g== 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=FFyftNJtkYEiimcZJniDmOYmiULVLEX9YMyaZ6ijioX3Fsnog40A/IoDCLinTmxThYvISIMv7mx5Xp8Wvnsiqd9nfvxr1L5CN16qT0A1LHDNIosulAfJ78Q3uTRFkdi33Q+LIHBIAZApCcsLgCjdGS8I092aSeJ/H6niarDbmP7bMoj6Apyt0ko2kqInYzSt5cch0YWK4uqp2ae7EvQRqeKqpr8GhfC9RX3onp0UrUP0vnc3xMTkWrTKU4XN1kA91bnzAJecwAYqJ+VPNncAfxQmBuTbbTTrSXGHn2/f3GVf5B51t4NjGOrSz83vMY7azILle/MYnYPhuKn4R8ymGg== Received: from DS7PR03CA0239.namprd03.prod.outlook.com (2603:10b6:5:3ba::34) by DM4PR12MB5376.namprd12.prod.outlook.com (2603:10b6:5:39a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Tue, 12 Oct 2021 15:54:47 +0000 Received: from DM6NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3ba:cafe::4e) by DS7PR03CA0239.outlook.office365.com (2603:10b6:5:3ba::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Tue, 12 Oct 2021 15:54:47 +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 DM6NAM11FT058.mail.protection.outlook.com (10.13.172.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4587.18 via Frontend Transport; Tue, 12 Oct 2021 15:54:46 +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; Tue, 12 Oct 2021 15:54:42 +0000 From: Tal Shnaiderman To: CC: , , , , , , , Date: Tue, 12 Oct 2021 18:53:56 +0300 Message-ID: <20211012155359.8908-3-talshn@nvidia.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20211012155359.8908-1-talshn@nvidia.com> References: <20211012155359.8908-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: b3a73916-37d7-47ef-a622-08d98d989da5 X-MS-TrafficTypeDiagnostic: DM4PR12MB5376: 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: 8w8OsG+5e2QQFQJaPjHXzeAUv5EsschfDAIN+SUo34laoo53Af1zjyLGeMbXLp0SIOZJ1t+v2TiWyt0P1H2YPW19DUbCZEZO0fqQEGFrkYv5s3K2ho57L29lIPVMndRBPKyGmJGiR+7XbhZuoEuGV23wB44ovdU7MYfR50JEJhGcGLzcevpCg/SX50+6Ia2xL7FUjwn4cePt1ohwx72EEzO0T/WHdt5PGWxiyYA1kbH2BRjZ0mBYQwiogSTPyz3nhFPTIX8o0kxzotFLY45woencedchUiyTzC0NPTJHv289qh4boTEj/Qh2LJNV0u3uNegDgU6MiVIRkU7nS7l653lWG8BN3bR8rRsog0nTFetFthycu0wed7Sr4CiVAasjC62blv/7ZpPUNDAdsDbVLE3OlEVEIqQXUyuvJkvz3eZZdp4AxyhAq063CCQNi9e730n7Ltl+SvqYBVsr35vZns4vJC/WfMHiK66eAxABl6hIOk0smNOvtABLW8fhznsgYNrCIx99oEs6Fg2PnvrfGWHrLZXCEdK7vMqhdNhtRozSoncp9aleTJ1cQSEIKSWf+fvfV45eEpUw2nS4aet9xMYHiK/xqo4HUD1U3FjL++sn0nkNICenF5NWLCp+Vby3HMg6ZHlH+T6gDLEBqTYgQPbMV2IBdeK5fihtSoPg9qJnPxRNwK6rVTPfpim1gd5N1cUcD9LSQF9E7zpI/PuLDg== 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)(46966006)(36840700001)(508600001)(6666004)(86362001)(8936002)(2616005)(70586007)(316002)(55016002)(5660300002)(6916009)(186003)(336012)(36756003)(82310400003)(36860700001)(54906003)(4326008)(2906002)(7636003)(8676002)(107886003)(7696005)(16526019)(356005)(70206006)(26005)(6286002)(47076005)(1076003)(83380400001)(426003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2021 15:54:46.8020 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b3a73916-37d7-47ef-a622-08d98d989da5 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: DM6NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5376 Subject: [dpdk-dev] [PATCH 2/5] 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