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 6B313A0C48; Thu, 8 Jul 2021 17:26:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D71AD41637; Thu, 8 Jul 2021 17:26:18 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2073.outbound.protection.outlook.com [40.107.236.73]) by mails.dpdk.org (Postfix) with ESMTP id BF59A4162C for ; Thu, 8 Jul 2021 17:26:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MPtSG9LcBIA7yFQOvUqw8mD62yzW+8St8M5gZFCI8dPl7b+qXl5IBXDBo2dZ2rbgLNBV7iq+JW4OtSEhaYJgLkvo5oS+Vu0UkoShFLEVwCR5sJdLwdLSwUubrS/afMRIHUJU60EzO/B1DkKgfjggpHkJ8lkrZ/2VamnqlIbrBv5jL5Ju/8XkkRNHHdGgfGQbK6JnIRzEjlYaTuDUkYc/csXOhEJ3dGYbk0U04gTMZMklp8gZ1TZmC0uQwpc590Ji9jHZG25Hw+aiAjzSv7zk8nXFmUJ/Ui2CGfnU48rCDtNS3ZkhgxPWJJW6g5llUc4ewRCeztRWQk0E4hjF02zakw== 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=u4yN37n1+ECMx+Z5l3zzDI8H+6MNfuq7XH2lppM+7ug=; b=DVeQ7xLxEngnI1QZcm/ZbyGeMnxhqZJEL1Mj2TpYPwjquibxJZMHXDOKThyZsC664bWBW9DTAwdxzOkUFdNYNm6QpOWdcl5DLpRW8Ec7+h+Zd+Dl8/yqL8Hj+xgFpON6zZGTxS0k4cpVLR9XY1q/oq6PHBKZ5bkhY5NxgUDJzL1G68v84ha9mCY73JlJBWHHYIFEVgoNnfa9cGHcbkctpl9+mV99U1Oh5zJlxVOCowKA6JnJgCqkyhy+9x2YQTQo3lg4b/m6RLbqzucbwbysfHeXi+LTUiyVVuAuZWLk0Aps9GEtGZSqgiIHzrqRkUeKiMfEZMCx7S/kPxvp60FAhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=redhat.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=u4yN37n1+ECMx+Z5l3zzDI8H+6MNfuq7XH2lppM+7ug=; b=GT07pPnUp01ReixzHrHI7NySqlESWMuGahbQt3aO/qS3RCfKLJsuNlFMdtEEm1xUrNpL5lmY+XDveFivzSBdNyTYbYfcztKev30kaO+leFa/47TtHMY7sCTKkjENBqTuG1huAbwMzbPiSJxih0r3v0hx5WcvQa7aAs9Ni3Uehx7e9YLiwv8hb3tILKlfFF9mSG87ZHPmi/fqxUFIyEuNSv6N71aYGvvINKzWf/oMxFzYGmKL8lUlTTseu2vTse/aQb1aDtgnAp4GS9OpTWNTfF3dHo0DHgBvt7nW+T6Z0ayTbTcWMszU2DJWrSBEiZwoUTTWG1OP2wF08cy3wRFluw== Received: from BN6PR13CA0009.namprd13.prod.outlook.com (2603:10b6:404:10a::19) by DM6PR12MB4010.namprd12.prod.outlook.com (2603:10b6:5:1ce::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.20; Thu, 8 Jul 2021 15:26:13 +0000 Received: from BN8NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:404:10a:cafe::ba) by BN6PR13CA0009.outlook.office365.com (2603:10b6:404:10a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.10 via Frontend Transport; Thu, 8 Jul 2021 15:26:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.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 BN8NAM11FT013.mail.protection.outlook.com (10.13.176.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4308.20 via Frontend Transport; Thu, 8 Jul 2021 15:26:13 +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, 8 Jul 2021 15:26:11 +0000 From: Shiri Kuzin To: CC: , , , Date: Thu, 8 Jul 2021 18:25:19 +0300 Message-ID: <20210708152530.25835-5-shirik@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210708152530.25835-1-shirik@nvidia.com> References: <20210701132609.53727-1-shirik@nvidia.com> <20210708152530.25835-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: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a48d64a6-e45f-42ba-bc26-08d94224b892 X-MS-TrafficTypeDiagnostic: DM6PR12MB4010: 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: ErWHut42hhK4jUfioVYF47n4MmrEIh2BtmBBx121PlIWcwulugQ5tVwRrNyxjWV95r3Slr/VPj3GJfXSQhkgQG6zQfOixsz2Ixgntn/nKYNRU7Y0J/zIyrst5GbhDN8jwlbjyZGRZa8DcRyGZbhHL7EcDrscBMByGVLjyyJSfsHYL5TPyYkfGuWzBgSiHU6kZfgUxORrTBVO/Q0WOhmlNBJFM40EKHr/V7GkRLTcXZa8s5ZZi3/zLCJSDUq8BkjDimp8ajIHVTB7S1N70DQqmXZ4WVuafVAs+Xn34v+GNnzqbsF1F5AdzRUlNRCiasa9jTCmCXHr1ITMdMbZ6ygVMY3N7OWGYSEVwiGc69iE0TMAkxEZLNo6mhtH52begVTU5/jGQGoP+g3srFwTWhmL/rxMYWFQvwdO0tVXEbqTc6CqukcaB0LS5j/MJ9bMwR9xILGv6SIiyTgQURuYqYSOVM2p9K3xwTHkqRPUzq7rVe56UN0ODjjkATRzmsQR/CPRRIT9VoP76VMRYdHA+CQvlf0z0s7fyVSGrbMqAS6lUjp28/xSsr0M9nZTqg44zjlmFJZ9iaC0X/jBEkm1T+b3Jm7sQXnDpi87q1s6cg58Xts0s/pP24lgJ7MvQBS8Mq/JgJBEtO5JS8ru1/xNLYbJ8/3HXq1Fi0TZp6U2sw3IzPEn+IPMYTcrFUvwDSs4qsirLlz+QkN3x2DkBMQSiYuaqA== 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)(136003)(376002)(39860400002)(346002)(396003)(46966006)(36840700001)(36906005)(6916009)(36756003)(2616005)(82310400003)(7696005)(478600001)(5660300002)(86362001)(316002)(2906002)(4326008)(8676002)(336012)(6286002)(55016002)(70586007)(26005)(1076003)(186003)(70206006)(16526019)(8936002)(426003)(54906003)(36860700001)(82740400003)(7636003)(47076005)(356005)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2021 15:26:13.0876 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a48d64a6-e45f-42ba-bc26-08d94224b892 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: BN8NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4010 Subject: [dpdk-dev] [PATCH v6 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 3f0c97d081..a7e44deb9e 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