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 07F7CA0A0C; Thu, 1 Jul 2021 15:27:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F18BC412FF; Thu, 1 Jul 2021 15:27:15 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2041.outbound.protection.outlook.com [40.107.94.41]) by mails.dpdk.org (Postfix) with ESMTP id CB3E5412D6 for ; Thu, 1 Jul 2021 15:27:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TKaIGLfxm339EwyPi7ertZzYc2rj8t8DLmaB8GzFquqySkK4T/ieIugUC/WtR84uv7+sLDEiwNaqfpvxaGFUHeFD/nty4gaSW47ymbxfUz0PQHH0YEAwniUriB4Rv0JGIu+3m2qhi1aMT0hhnKxpO4AvWeJOW24uIesLGUjIbSvKsoN9Ou5jzaL67TzuAYXwN8p1Z7TJXAvIHY1QBqLgezdS7qZ4foxUGCakbi0u4PduZ0/DF4w//7UrWxsnP1rX9YDXLiDI9n5cmlYTDRHpTN1eFSx330vQqb66cCJyFcr+SAYOZaFakcEm+feH8mS6emZhPHs3p3Owp5HJvb6/NA== 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-SenderADCheck; bh=8ps5eZZBnQIb3nEKbsrA+g39DNMuWkTfEmTQijJGhZc=; b=m5S7ztma2UATklvOgidurBghf3dHfaIdgHaQPSr/KPFvFGvEX272HORN1hg2O3+Hge38DAXBdJIAp7+ZFYlJasfrLLfad5s+60mVjsl6DjVPYG29MZkKc4+f61DHPWHvkl1YSOQ6M/evYo6t+ma8OCMzCNJQfklrRIiP0Iq63egvZnRtG8SpDJ91/fTAXM3BC5xp60NG9yOSp+LgzNBByVBzus3/A1tsPat0oQ2peVpRf+FPYxHaXGixfKsFHpXJ98YFSPiszEdpqBE0aUxMUby8kbXdJW4O/FpfwZrpaDYadzzNzY5e/x63j2M3w8ydiEmv6mfcRJ2Ss5WmayjYrw== 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=none sp=none 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=8ps5eZZBnQIb3nEKbsrA+g39DNMuWkTfEmTQijJGhZc=; b=BzByeTNwV9BO34R7ho1kGuNN1zSGC0i1BzKZVqz/QgEv3pYzruCpf4qPFE/R8SnztAsnoLUma0eo9sbm+yAAO13O37VeAugyMTjCL8kARTaLFPW/yPRctRCi6lxrI4k0diZwy/SIvmi8WiYTaWIDzvdValmXXNLY4L6RHiw7HDZKN1mv9Jsgw0V3vDl8up1cKMj/cAVDHAf3x0jXF+oJfzzR/HWPox4Q8ZR4tHuLWLJrMgyg4ejFp3ebWMSTxeLdDj7uwQRVs50f9aCmX3HD0KBGdSf3hFLMjp3QAVlx2wkKJpKFf6rpfPipy++HvojsBuq39hNVvVYOvIIlf8R7jg== Received: from BN8PR12CA0002.namprd12.prod.outlook.com (2603:10b6:408:60::15) by DM8PR12MB5416.namprd12.prod.outlook.com (2603:10b6:8:28::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.19; Thu, 1 Jul 2021 13:27:11 +0000 Received: from BN8NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:408:60:cafe::97) by BN8PR12CA0002.outlook.office365.com (2603:10b6:408:60::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Thu, 1 Jul 2021 13:27:11 +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 BN8NAM11FT042.mail.protection.outlook.com (10.13.177.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4287.22 via Frontend Transport; Thu, 1 Jul 2021 13:27:11 +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.2; Thu, 1 Jul 2021 13:26:56 +0000 From: Shiri Kuzin To: CC: , , Date: Thu, 1 Jul 2021 16:25:58 +0300 Message-ID: <20210701132609.53727-5-shirik@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210701132609.53727-1-shirik@nvidia.com> References: <20210509160507.224644-1-matan@nvidia.com> <20210701132609.53727-1-shirik@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d7d73e4-8ba7-44ad-6419-08d93c93eee2 X-MS-TrafficTypeDiagnostic: DM8PR12MB5416: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Sxe41mYpj8SnTGuR65Z1JYkabWzio7yIfVPxI8yy4vx4g2fo7NkxaMDXxfoCvJHU3UM5FG2uNTD8BVgvYnzzx4VtdUim8dRR3QCGwLO6ZIDNYVkwHsf6DmtJ2TMC6/ii4j2ZcFrdvxvtorvPcwTIsflydZJZL65SySWJQIB3XHxUdDkXvWEHs3zCU+qKIfZcO1myfRPs2C2MwR6Dpe3WLCHTKdu+jRyzHyUTUEOfuSsyOa7Fz8TbR4VzzhLhmBTLYh+D7Ret7oFYrb/gUV5psVb0wgcMx4dYZdn4XN3nKGBoNNpG6bxWb/DJ5wO+7QmKVIuIxFGc8q9uZyJh9dhktD63fVykKatprbXz7stkMBvVV1l6da/J0SuFXTFjk2DU0oAXdVyEKCPKha/0+HSE1P1XMAdT5X+YmIbKRRyBTwyFB85RoBOGHckZdE4u0U9HzFFSKfFUO+b5kE3r9hK37dDjDHTNgJWKDR/AC9df43d3QK2YrEtn5+erkRm7FvczE+/DeOg9KqXCb5q84J/KHRtJ1Y1KQoOIeyFc30fi3EhimkyMdnELPBtK7MqmQX1aktkQTO1YU+ccVgs5FKyLpgizIZSwVPeukUeR8hYUMxrrYeAvjUopw0HvDoYr7Eb6SyT2ZEpLL2DUKvOrEdt8CjiVTDg5gqbwWe3uzbp0gNlgLdkckLgrr5DFULxm/h1LyAsyG8C5HIgfwrg1Oa5sgA== 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)(39850400004)(136003)(396003)(346002)(376002)(36840700001)(46966006)(2616005)(83380400001)(478600001)(36906005)(54906003)(47076005)(1076003)(86362001)(7636003)(2906002)(316002)(356005)(55016002)(36756003)(336012)(26005)(70206006)(186003)(16526019)(8676002)(4326008)(426003)(6286002)(5660300002)(7696005)(70586007)(107886003)(6916009)(8936002)(82310400003)(82740400003)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2021 13:27:11.3470 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d7d73e4-8ba7-44ad-6419-08d93c93eee2 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: BN8NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5416 Subject: [dpdk-dev] [PATCH v5 04/15] crypto/mlx5: add basic operations 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" The basic dev control operations are configure, close and get info. Extended the existing support of configure and close: -mlx5_crypto_dev_configure- function used to configure device. -mlx5_crypto_dev_close- function used to close a configured device. Added config struct to user private data with the fields socket id, number of queue pairs and feature flags to be disabled. Signed-off-by: Shiri Kuzin Acked-by: Matan Azrad --- drivers/crypto/mlx5/mlx5_crypto.c | 26 +++++++++++++++++++------- drivers/crypto/mlx5/mlx5_crypto.h | 1 + 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c index dd9685dcad..0ce46ffd2f 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.c +++ b/drivers/crypto/mlx5/mlx5_crypto.c @@ -105,22 +105,27 @@ mlx5_crypto_dev_infos_get(struct rte_cryptodev *dev, } } -static unsigned int -mlx5_crypto_sym_session_get_size(struct rte_cryptodev *dev __rte_unused) -{ - return sizeof(struct mlx5_crypto_session); -} - static int mlx5_crypto_dev_configure(struct rte_cryptodev *dev, - struct rte_cryptodev_config *config __rte_unused) + struct rte_cryptodev_config *config) { struct mlx5_crypto_priv *priv = dev->data->dev_private; + if (config == NULL) { + DRV_LOG(ERR, "Invalid crypto dev configure parameters."); + return -EINVAL; + } + if ((config->ff_disable & RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO) != 0) { + DRV_LOG(ERR, + "Disabled symmetric crypto feature is not supported."); + return -ENOTSUP; + } if (mlx5_crypto_dek_setup(priv) != 0) { DRV_LOG(ERR, "Dek hash list creation has failed."); return -ENOMEM; } + priv->dev_config = *config; + DRV_LOG(DEBUG, "Device %u was configured.", dev->driver_id); return 0; } @@ -130,9 +135,16 @@ mlx5_crypto_dev_close(struct rte_cryptodev *dev) struct mlx5_crypto_priv *priv = dev->data->dev_private; mlx5_crypto_dek_unset(priv); + DRV_LOG(DEBUG, "Device %u was closed.", dev->driver_id); return 0; } +static unsigned int +mlx5_crypto_sym_session_get_size(struct rte_cryptodev *dev __rte_unused) +{ + return sizeof(struct mlx5_crypto_session); +} + static int mlx5_crypto_sym_session_configure(struct rte_cryptodev *dev, struct rte_crypto_sym_xform *xform, diff --git a/drivers/crypto/mlx5/mlx5_crypto.h b/drivers/crypto/mlx5/mlx5_crypto.h index 5a54cb0dca..4c07356028 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.h +++ b/drivers/crypto/mlx5/mlx5_crypto.h @@ -24,6 +24,7 @@ struct mlx5_crypto_priv { uint32_t pdn; /* Protection Domain number. */ struct ibv_pd *pd; struct mlx5_hlist *dek_hlist; /* Dek hash list. */ + struct rte_cryptodev_config dev_config; }; struct mlx5_crypto_dek { -- 2.27.0