From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700063.outbound.protection.outlook.com [40.107.70.63]) by dpdk.org (Postfix) with ESMTP id 728B35F11 for ; Fri, 8 Jun 2018 18:49:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+TdWLIFve/5sQwLJ5Ua1gj2wa2syO0uJj2ewhwTLWrY=; b=o3JG7acpzAtMxZfAAA4xfevLQndQl+mOQcfPBellEzckPfruyJa+F3xELioDX0rFB1sBJTcVgvVneTO7FNS3iVEodpVJfL0crK5flslDKRqBY5Vlg2LL37X+7TNW/60mqwHqOEdjo27gOWYr9PTmYd9yowUnfyJoQhtzsz0Ixh8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.caveonetworks.com (115.113.156.2) by SN6PR07MB4911.namprd07.prod.outlook.com (2603:10b6:805:3c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.15; Fri, 8 Jun 2018 16:49:26 +0000 From: Anoob Joseph To: Akhil Goyal , Pablo de Lara , Thomas Monjalon Cc: Srisivasubramanian Srinivasan , Ankur Dwivedi , Jerin Jacob , Murthy NSSR , Narayana Prasad , Nithin Dabilpuram , Ragothaman Jayaraman , dev@dpdk.org Date: Fri, 8 Jun 2018 22:15:21 +0530 Message-Id: <1528476325-15585-13-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528476325-15585-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1528476325-15585-1-git-send-email-anoob.joseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BM1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::11) To SN6PR07MB4911.namprd07.prod.outlook.com (2603:10b6:805:3c::29) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4911; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4911; 3:vyqi1ni7RZ4NbksOuLWQATMTYe6UBEEgnRqtUcOVzo9DwmYGhEmq8nDz6cMo6w+EfIom2WEHYCW8RZoOKp6J9FR/I+4HGw2+k79P7o1U+lCsS3i8KjwrSDmrI9rBMWDjSDSTJSkFJteMx7zdFqzCrAL49PIct56iPmj+AnCEkjGtiWYg0PyPrkVWsHUxIlW/6YM0h1Vu9Uh0uJV7qtePvgeTB0OaLfGtZNlSNfGvsFyCB3SyygZWK9Ppy8A03/9r; 25:LXKi0yde1q4kJKxSKBYccKxvwtLj62vn+fg+EybG+vd4AnB9BrzDPkZTDdVhxSFK4UHzuuXQTe8HoeqP3tU9TOxeHEimJk0o8gmeJanRWVs94qpCoF1Eni5HEasYRv5ZwKD9Ni2X4Q7yHYoGdtNXkNcKpHcsGn1bHQQo9r/m8ux7+3WNLGf9TehLLBGIRsd2CKKcl+sLHgTqHouvrMredhExSBETD16VNWA9bGXtC+6W9O1HzEF7ZKt8q6x1BHKpACu5qAzCFABj5BBbMhvvdazaMtVnTj08p/7Lq7mt8nYMtSsGOKTl3c2xQFHA6DrYPT9SjZU+gqK9ac5mLKdy3A==; 31:18XjlmfDLGKMIWVCOKb45IzBZ5dKVDw8ERlZZBnHQPVresX5WR7KfjTNFngVcYLoEMDN3O1YD8uNRCn6j3243hXbB2mepbA+yXjnLYXNuApmGDi0X6yC4z5OU7cguP6RG81H+dTOeKN/2LjCOzQ6SUs9UDTt641HFG7XM1pUtRE89HUL6YqAQFZCsQzd/qsTM3bbbuGm/Almm+bRL4b9ExZIOZv9wj5blNdyFuXYv7Y= X-MS-TrafficTypeDiagnostic: SN6PR07MB4911: X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4911; 20:omw6KVrSGuE5ZWa/bsg4/reiwiAGZzdplg8Xho8YCDoNiCFp0iPLCjHgI2mOagOS+pymI8ki4zMQMfZj9gDKlQgmILHKp5RJATpD6onDRIYWKKcVKlpdNIfR15eghzFCA/E/AzlUK96xhrA23qyj80RYXAhtk9xJBcoIBpwXbJGQxABLBkLbIO6xTeSzRu+4K2FzzGA+PVv77hoI2HQY6huZWQ6sDqSSaYOcya91FN/mwKKZUb4cEuz44XZqr6c//Ciz4bnz2L9SLhK2Lwh0R6EEfMqHQinfID+ZjcfN++v1KkG6xMNWmeXd1AQqsj3SbzfqRvR/YGAx6ow4rkXrUugAK7jjborIB3tM9SzKNYgsqOZjQe4OO6UygrL5W94zsOsiQTofo1zftzx/x1QNPMkRycFcSymAW7L7UlT0Dpq/BDKODxNyE7YHrDB+aXlxm8JRrJWwv17NiMMClQvU3xXGAz+RAj9V2zit9LxzuxuG/FsIdbUBmqBt+PQi4ggX9ihu4BFBOW1YbkCfFVCHHeX7nYkF08VT1srTRsSd2rU6+7CphN4oqqxuqv8mnFj0sSwd2phc6KmqCEzji6m3MYKtVYMeRD85IhHgmf859Jg=; 4:MytQ9VKrqN6nkAvXuxcHGp9bIt4f4k+GPD6PVzVLFiynS6ax41wIYtmPOkhUcojApCkdWV+PD6T8wDUCQ+dhX3MpRNHsSjagrUHI6Zha/JwrxxiRgoa/E2fwxH0GlvGlsJIsZvW9CWi5nRRuCyW2RHODEkQWtgaQLIfYzs2opwB3lj/R1QYLijKmDM8SEou+NdICZO2LqrRKVe6qJhQr5isjbFJI4mSo5k2m4xCk99CprMl5o+C+4BZKglDbbG3M1z7/M67WrYHpC+D8jVdXcQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:SN6PR07MB4911; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4911; X-Forefront-PRVS: 06973FFAD3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(39380400002)(366004)(39860400002)(189003)(199004)(26005)(52116002)(956004)(305945005)(8676002)(81156014)(50226002)(8936002)(81166006)(7736002)(68736007)(105586002)(106356001)(3846002)(6116002)(72206003)(478600001)(6486002)(97736004)(6506007)(16586007)(6512007)(53936002)(47776003)(486006)(25786009)(5660300001)(50466002)(48376002)(6666003)(4326008)(54906003)(76176011)(36756003)(110136005)(66066001)(8656006)(2906002)(316002)(55236004)(11346002)(16526019)(386003)(186003)(59450400001)(446003)(476003)(42882007)(44832011)(2616005)(51416003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4911; H:ajoseph83.caveonetworks.com.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN6PR07MB4911; 23:qkpWRmN+CvQgQ5onk5VB/krzgSsLf+nHS7qG8mE+i?= =?us-ascii?Q?gVI3fJb5SWnXrLbAnQOxYZEKRCANcak9niGejSMvnTNVLVRJeTxsuDxkqhgt?= =?us-ascii?Q?4jj3VqLQQmDC58pQU5KCQ8R2ZVH/BHoa7q75MsVLhPQI9uDwINmezK/fXd1S?= =?us-ascii?Q?5idW7MxW2o/kPmFZjnpfa1WTdjYG82vld6UpaO0g9NSaj+Hcw3nY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v8NTRsV7MKC4mcFKL0Or/DAOrrh2ecZgiW5m4wWOvBQSQ4ABRF5ajaPefNaRINY/Fi5RUskOKdVuVEubWdr3PdPFu+WLqVqxXxq8UoEQz5E/ftp4=; 24:Q0cxzoJs0pYGYyNQplq57nxrLgH+cBvA/feIaRri+uPu+SHII/3HWJUV3plfvqaGnLaCvjVjJKWncmYhyC4ZGuVlj4xC8YRovbxOX1NPY8s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4911; 7:wmBwksKqpJWIt8ONK5DYn4pADTebjbSDiE9AaAjNW67YiUJ6rS9ztSWUvVj1VDv/ysWaQtO2SHiLhbNosChadKr4S9QvxAunDHFlAoto0K+bT+/4Qjuky5XRrOg7VL4uyFREUoZTl6aG/wsYYcRbiHq/UpQjMriBHYxpGAUV7EOleuMUMCREHusn0rrM7JUD6M2TEdvVWYsSIoSzLVSBwhGRFpx5YbTigcFfFCZU4MerWW3PrYIAwB5vxcC8+Ipq X-MS-Office365-Filtering-Correlation-Id: 97e1f936-7df3-4973-4ea4-08d5cd5fcdd2 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2018 16:49:26.5894 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97e1f936-7df3-4973-4ea4-08d5cd5fcdd2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4911 Subject: [dpdk-dev] [PATCH 12/16] crypto/cpt: adds some more callback functions for CPT X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 16:49:32 -0000 From: Srisivasubramanian Srinivasan This patch does the following: 1. Adds the stats callback functions for the cpt vf. 2. Adds the queue pair setup and queue pair release callback functions for cpt vf. Signed-off-by: Ankur Dwivedi Signed-off-by: Murthy NSSR Signed-off-by: Nithin Dabilpuram Signed-off-by: Ragothaman Jayaraman Signed-off-by: Srisivasubramanian Srinivasan --- drivers/crypto/cpt/cpt_pmd_cryptodev.c | 8 ++--- drivers/crypto/cpt/cpt_pmd_ops.c | 63 ++++++++++++++++++++++++++++++++++ drivers/crypto/cpt/cpt_pmd_ops.h | 11 ++++++ 3 files changed, 78 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/cpt/cpt_pmd_cryptodev.c b/drivers/crypto/cpt/cpt_pmd_cryptodev.c index 3939b5e..3961ec8 100644 --- a/drivers/crypto/cpt/cpt_pmd_cryptodev.c +++ b/drivers/crypto/cpt/cpt_pmd_cryptodev.c @@ -53,10 +53,10 @@ .dev_close = cpt_pmd_dev_close, .dev_infos_get = cptvf_dev_info_get, - .stats_get = NULL, - .stats_reset = NULL, - .queue_pair_setup = NULL, - .queue_pair_release = NULL, + .stats_get = cpt_pmd_stats_get, + .stats_reset = cpt_pmd_stats_reset, + .queue_pair_setup = cpt_pmd_que_pair_setup, + .queue_pair_release = cpt_pmd_que_pair_release, .queue_pair_start = NULL, .queue_pair_stop = NULL, .queue_pair_count = NULL, diff --git a/drivers/crypto/cpt/cpt_pmd_ops.c b/drivers/crypto/cpt/cpt_pmd_ops.c index 2f066cb..1c60191 100644 --- a/drivers/crypto/cpt/cpt_pmd_ops.c +++ b/drivers/crypto/cpt/cpt_pmd_ops.c @@ -523,6 +523,69 @@ int cpt_pmd_dev_close(struct rte_cryptodev *c_dev) } } +void +cpt_pmd_stats_get(struct rte_cryptodev *dev __rte_unused, + struct rte_cryptodev_stats *stats __rte_unused) +{ + PMD_INIT_FUNC_TRACE(); +} + +void cpt_pmd_stats_reset(struct rte_cryptodev *dev __rte_unused) +{ + PMD_INIT_FUNC_TRACE(); +} + +int +cpt_pmd_que_pair_setup(struct rte_cryptodev *dev, + uint16_t que_pair_id, + const struct rte_cryptodev_qp_conf *qp_conf, + int socket_id __rte_unused, + struct rte_mempool *session_pool __rte_unused) +{ + struct cpt_vf *cptvf = dev->data->dev_private; + cpt_instance_t *instance = NULL; + struct rte_pci_device *pci_dev; + int ret = -1; + + PMD_INIT_FUNC_TRACE(); + + if (dev->data->queue_pairs[que_pair_id] != NULL) { + ret = cpt_pmd_que_pair_release(dev, que_pair_id); + if (ret) + return ret; + } + + if (qp_conf->nb_descriptors > DEFAULT_CMD_QLEN) { + PMD_DRV_LOG(INFO, "Number of descriptors too big %d," + " using default queue length of %d\n", + qp_conf->nb_descriptors, DEFAULT_CMD_QLEN); + } + + pci_dev = RTE_DEV_TO_PCI(dev->device); + + if (pci_dev->mem_resource[0].addr == NULL) { + PMD_DRV_LOG(ERR, "PCI mem address null"); + return -EIO; + } + + /* + * FIXME: We always setup a queue with DEFAULT_CMD_QLEN size + * in get_hw_resource. + */ + ret = cptvf_get_resource(cptvf, 0, &instance); + if (ret != 0) { + PMD_DRV_LOG(ERR, "Error getting instance handle" + " from device %s : ret = %d\n", + dev->data->name, ret); + return ret; + } + + instance->queue_id = que_pair_id; + dev->data->queue_pairs[que_pair_id] = instance; + + return 0; +} + int cpt_pmd_que_pair_release(struct rte_cryptodev *dev, uint16_t que_pair_id) { diff --git a/drivers/crypto/cpt/cpt_pmd_ops.h b/drivers/crypto/cpt/cpt_pmd_ops.h index 015b4a2..db2024b 100644 --- a/drivers/crypto/cpt/cpt_pmd_ops.h +++ b/drivers/crypto/cpt/cpt_pmd_ops.h @@ -58,7 +58,18 @@ int cpt_pmd_dev_config(struct rte_cryptodev *dev __rte_unused, void cptvf_dev_info_get(struct rte_cryptodev *dev, struct rte_cryptodev_info *inf); +int +cpt_pmd_que_pair_setup(struct rte_cryptodev *dev, + uint16_t que_pair_id, + const struct rte_cryptodev_qp_conf *qp_conf, + int socket_id, + struct rte_mempool *session_pool); int cpt_pmd_que_pair_release(struct rte_cryptodev *dev, uint16_t que_pair_id); +void cpt_pmd_stats_get(struct rte_cryptodev *dev, + struct rte_cryptodev_stats *stats); + +void cpt_pmd_stats_reset(struct rte_cryptodev *dev); + #endif -- 1.9.3