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 53A40A0A0C; Thu, 15 Jul 2021 17:09:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F645412A3; Thu, 15 Jul 2021 17:09:14 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2065.outbound.protection.outlook.com [40.107.93.65]) by mails.dpdk.org (Postfix) with ESMTP id ED5AE41252 for ; Thu, 15 Jul 2021 17:09:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ah00AEdCPySE9n28kdH+vNA1ZzUlpO1OkLU8xFKURD+QCy7E+HCxE8xaxODG0KFfkFDAxPmUm+Nv/jNy3YEARhpMLqcg0jVTRqOyFmAaxqNyaO45hVFXT6KiHEH3tPmFIUuiPpCpB/kVmdP/4230friFNchSq9GqhdHToivNtzgm26aZfuD1XOvYzfcigQDh6rKiHILQZUmxmVWMfyg3hhqxRAS14RIH7YeIQag8i8pe5jLvXCb7zSbDWsmuF0teeEcr3KvKi/nJr6N7osQIA7DNW/mFt/Qsi80K4rQyM/CK7VaJA6lZ+7gpG1cMBRcQUKP7cFkHbLn9GIoHUc5auw== 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=zYW7FJU8n8KCNsyHBGZ7uIQXlvC37Of+gwZbvNVciA4=; b=AMCZ51RYkRhhtk1/e2gmoxtW2Q3St8aP9pnn7cr/5Hnf3zT+vZBqfl7qDQkQqqBA1eObZamiZNk3sYHMSToi9L+A7yBce6Y/H9prCq+u+zwCFYOmIbtdAyWC0hQz2qHMqZ3bUZc9K7jFzfAJVUc4UbS916j4+4WIfa44NUeoEFsw6x+EtHPpQo7U8MED6JPNf7FKWm5efSPWnyGeFrdbj8y+75qjABHz0wZZrVGC2CH1pJlDx21IgoH6OCQ6PwH2g8xin7Rf3o6+KIEYtgiPEdbE+XoYVlYcpBoOJQ/mm+B5VPNwwrf+tD/dL1tXeu9IvCB3ywPti2Hv//itE8Jfcg== 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=quarantine 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=zYW7FJU8n8KCNsyHBGZ7uIQXlvC37Of+gwZbvNVciA4=; b=OY6nwHMwE6BF4ZnvDOlyPDeFdIe+39aDuGXkdky6pjcz/U+PVpLi9aKk8z4nymUmJ117yPLLCmO8e7yFg+Lb/aR4JXVDZSJtM0KtcqGVcvAjF0LwcR2fchKGUhQDj/WUK9jg0Ttla04Imi06rmBH3KKnTj1JLaYrwQhedvijSiSOMyUGbDbaODNXMnHMt8TuSA7AhP6Sk86STtfOdOI3toHE+NwwDnnNkbXc3gRPphLJbKzGVFnHmkB1o2dlam1pEKumcIFT95bs18iiTubF5EZwzYKWsXhKnwfEy0V4LDIr3ca5daXiYWpoYUiKoaMtaDojT05mDWOQg236RglMdw== Received: from MWHPR03CA0012.namprd03.prod.outlook.com (2603:10b6:300:117::22) by DM6PR12MB4041.namprd12.prod.outlook.com (2603:10b6:5:210::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.23; Thu, 15 Jul 2021 15:09:08 +0000 Received: from CO1NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:300:117:cafe::12) by MWHPR03CA0012.outlook.office365.com (2603:10b6:300:117::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Thu, 15 Jul 2021 15:09:08 +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 CO1NAM11FT057.mail.protection.outlook.com (10.13.174.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4331.21 via Frontend Transport; Thu, 15 Jul 2021 15:09:08 +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, 15 Jul 2021 15:09:06 +0000 From: Shiri Kuzin To: CC: , , , Date: Thu, 15 Jul 2021 18:08:05 +0300 Message-ID: <20210715150817.51485-5-shirik@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210715150817.51485-1-shirik@nvidia.com> References: <20210708152530.25835-1-shirik@nvidia.com> <20210715150817.51485-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: 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: f57ace8b-aeb9-4911-cd5e-08d947a27ea4 X-MS-TrafficTypeDiagnostic: DM6PR12MB4041: 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: t533EVj7xxurLmyGdnYrmkz1Uw3R5gXVmxJaD9jiQTKkk8QkOYXTc1IPqstcTxH9RN7yKe2VP5k4GPmTCE23BKcOHTzapS8PJ98yuh3y1yOw+CtagZT4Hdx5yOCM+b9X5dEWRMw92rW3sAgJJ7hEbSO4qhBxYpeLqVQ71mXUBiK/72Xn8nELJdSolhs+0CbTxYAjf75ZcXx2/rSbS6aXHZgMi+p4rvrSWdMALmc782tu0FxyERvO4Ll9phCpFG2S7PiEQCwIR3neNKrclxX1V7DiEqFdAFZT9PqKyWQKKhzU4r9BSzDxBw0OS3f75nARcfgX12JAhqTjpkfSdbNaBU4U/jO1k7JGvp751G3MqhOb3xjN68o8a3lyiA70wP7mbMvSsyg8oBTd889UpC5CAResfy/1uC0FZjiXiaCRob+3aqe1ZE+B/rSyh6VudMqYFwKcd6x593q6uhPq01cEW6TBScrDS8I9VOv8uL0Ew3OUXUVPk0fknFK+N1tTnqCQkTeoLyLczJApxCKMwT8T2TNogVNkiC/p4Lek7OzjGcOVGhiCsV+8+2wUXQboTOWjBVRQcc4yg5MfX0XBGDKdXOQZ4rvqezbWY7Zi/zMNmgf23BITab+4Qehzq0MRNJCqmd0soI5njzSAHC6baNtaGUcOp0LtphvYAlZLln0cw6ZEteWhu+HrekWM3lB06GpqJ3MCoALvHJ0RdIS62KSwC31jq/cGBJ3H++tI+4uRdgw= 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)(396003)(346002)(376002)(39850400004)(136003)(46966006)(36840700001)(82740400003)(86362001)(16526019)(426003)(5660300002)(186003)(36756003)(478600001)(36906005)(316002)(83380400001)(55016002)(2616005)(36860700001)(54906003)(336012)(82310400003)(6286002)(34020700004)(4326008)(8676002)(2906002)(7636003)(8936002)(6916009)(356005)(7696005)(70586007)(26005)(70206006)(47076005)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2021 15:09:08.3510 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f57ace8b-aeb9-4911-cd5e-08d947a27ea4 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: CO1NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4041 Subject: [dpdk-dev] [PATCH v7 04/16] 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 167e9e57ad..a0df775407 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