From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0068.outbound.protection.outlook.com [104.47.33.68]) by dpdk.org (Postfix) with ESMTP id 98A4A1B10F for ; Fri, 5 Oct 2018 15:01:10 +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=sj/8O0mF548G6ueMphrXO1/FIJVdPd1BEYOTJ6EA6ro=; b=JSmhQMnSSl0j6SlwNitUN6/nBeiCuWhgzz/gtULL1Fj1wCox8szYqhoLEax/hmSqWU+W/IFOEyFfu/D4CVy7yUntjRu0eiHZYFneKUfwVAgFxoHOxswwM14Jk/Amn1KCmRgeO4I2FMfPPKnehnSUyWOOAQZLFsN4T+lQbJhqi1Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.com (115.113.156.2) by SN6PR07MB4910.namprd07.prod.outlook.com (2603:10b6:805:39::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.21; Fri, 5 Oct 2018 13:01:04 +0000 From: Anoob Joseph To: Akhil Goyal , Pablo de Lara , Thomas Monjalon Cc: Murthy NSSR , Jerin Jacob , Narayana Prasad , dev@dpdk.org, Ankur Dwivedi , Anoob Joseph , Nithin Dabilpuram , Ragothaman Jayaraman , Srisivasubramanian S , Tejasree Kondoj Date: Fri, 5 Oct 2018 18:29:03 +0530 Message-Id: <1538744363-30340-13-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538744363-30340-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1536033560-21541-1-git-send-email-ajoseph@caviumnetworks.com> <1538744363-30340-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: MA1PR0101CA0036.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::22) To SN6PR07MB4910.namprd07.prod.outlook.com (2603:10b6:805:39::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b6c2b1dd-21b2-489a-4513-08d62ac29eaa X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4910; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4910; 3:yrqfmXgrik9oUiBaJ6oJU1vk4bgfy5eqWGH5odiB5hwoU8Gtw2ks1O8imiEB8gr6GYlMxAkVa1mHFu6xvCW2+Zx6iJJgE2ZHLdILGAPhjdqU3jJANnItx7ScFjKRDpBgGkKfnrIc4lOSe2RfT6uJyh/AqtBvJ1RN8j6db2EVSERy1OyQtoahTU9XRYvhfd0nWDd6wWyoXvvFgs3gZdp+yiqrSWvR9t5n2GP8SFgt11Qds46J16MILZ86MmOHu+oV; 25:fpdnXFX3cOfKXNjzCcxfb/TVicDs+bINYdhnq4p5GfKP5pewvnwNPSICp1oh5AUWW6eBOHYwGbDgYY4imnZH+2BeU0DLHHJy0MZ+R7H46SiioSMoLx/0OSeUuK3xbJNSOwpM/JT15ggkyxFOY50cMCvg7nQvUh6rC1zf5oFsfvg5FzZO82MWEbp9m1/i1QPAu96ViZ8qjfPYzf/4MzcILZ98M3QWM7jaoeVJq7aufsljygB1JL7lkvzP8bYdjseVQk5vOSnNIaiLzLgLQ+6MaFc72LJeC3hMp5QnMLQmhlCwdM8/9Xvkj7+s2eDNoz4STxjR7nMvOh1HVlECqs7J+A==; 31:ga/4ZFFiDAIqQXWgbes4bN8ejRYLtjkYC6uH29/GEGR8fTJ8hmq8bR17J01M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d1MpALyb1YHR84tFRuno3NmN/LyqAe4hT0VCgHkqGnus64GPFdPHOrHzse7fzXZng== 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)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:SN6PR07MB4910; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4910; X-Forefront-PRVS: 0816F1D86E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(136003)(396003)(366004)(199004)(189003)(51416003)(76176011)(11346002)(50226002)(25786009)(8936002)(48376002)(305945005)(186003)(16526019)(110136005)(6486002)(3846002)(446003)(52116002)(6116002)(81156014)(8676002)(97736004)(5660300001)(50466002)(4326008)(956004)(42882007)(2616005)(68736007)(478600001)(54906003)(7736002)(81166006)(16586007)(107886003)(26005)(55236004)(66066001)(386003)(47776003)(6512007)(72206003)(44832011)(476003)(316002)(14444005)(36756003)(105586002)(106356001)(486006)(6506007)(2906002)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4910; H:ajoseph83.caveonetworks.com.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN6PR07MB4910; 23:X/1f5BleVN+IaMGigVidcMhmgh2GMevT+3Zna/fdX?= =?us-ascii?Q?bP2ATobALRKLoAx/CzICkzlZyZzfWh/WUfD00EvFMzcn/lZCndlFZqIN1gWM?= =?us-ascii?Q?2wkLGSLaQ8hcN+nJbNRgImleymPdvi+8O6i1n2Ga5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BKlgPiVFoGc4k5jyQsLoGm0xw3ipJ5omSMWXZ1Pk96z3Odt2KrKc7RjgxApupaZ47dN+tFlFNe26UPuN23MPB14eeDlt68VgGVJ4fQ5SFzFP6a9cREIS3luw6yZQvMlxsdDY2OAKOg==; 5:zVILVw4Jh1U4MwSYG9YNNfFcFOPG59puebDd5PbCCmEKdovNU2E/oHQGs4Yy5JDZari+cwVuu92X8wYJzNu8ECktj+Mde1vsYAzc3wYCE9Xzpz32LmfJa5ZK7+EALTJgiSqNXId7cdYlmum6mTjJ7p+LrcYv4SCRGAVi9jluNWU=; 7:3BGD3bPyz/6eszM1uJvaARPydkICxQR2+Tz+/hatmtTlvOJFS+HAw7g79UPO60OQlIiuzJTsJvl4Wug1yFx6LqdAebuBHgAqYGnULAtvMWFlR+9Onj+dvBGM2ugOtXYCL0uI5v8MTDSmO2s2vDsp0s9GPjS6dWt04gKkHGkbEh8DbOBkaD2syeEL6Sf+wq5lNY7wpF4v/7Y8ksWSyAWqBh4grka7f9Al3rYL6cEo8q23p6dwjBt9tJSy88F0Yayv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2018 13:01:04.7461 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6c2b1dd-21b2-489a-4513-08d62ac29eaa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4910 Subject: [dpdk-dev] [PATCH v3 12/32] crypto/octeontx: add basic dev ops 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, 05 Oct 2018 13:01:11 -0000 From: Murthy NSSR Adding the following dev ops, - dev_configure - dev_start - dev_stop - dev_close - dev_infos_get - stats_get - stats_reset Signed-off-by: Ankur Dwivedi Signed-off-by: Anoob Joseph Signed-off-by: Murthy NSSR Signed-off-by: Nithin Dabilpuram Signed-off-by: Ragothaman Jayaraman Signed-off-by: Srisivasubramanian S Signed-off-by: Tejasree Kondoj --- drivers/crypto/octeontx/otx_cryptodev_hw_access.c | 56 +++++++++++++ drivers/crypto/octeontx/otx_cryptodev_hw_access.h | 30 +++++++ drivers/crypto/octeontx/otx_cryptodev_ops.c | 95 ++++++++++++++++++++++- drivers/crypto/octeontx/otx_cryptodev_ops.h | 4 + 4 files changed, 184 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c index eb9fbcf..303bcc0 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c +++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c @@ -2,6 +2,7 @@ * Copyright(c) 2018 Cavium, Inc */ #include +#include #include #include @@ -260,3 +261,58 @@ otx_cpt_deinit_device(void *dev) return 0; } + +int +otx_cpt_start_device(void *dev) +{ + int rc; + struct cpt_vf *cptvf = (struct cpt_vf *)dev; + + rc = otx_cpt_send_vf_up(cptvf); + if (rc) { + CPT_LOG_ERR("Failed to mark CPT VF device %s UP, rc = %d", + cptvf->dev_name, rc); + return -EFAULT; + } + + if ((cptvf->vftype != SE_TYPE) && (cptvf->vftype != AE_TYPE)) { + CPT_LOG_ERR("Fatal error, unexpected vf type %u, for CPT VF " + "device %s", cptvf->vftype, cptvf->dev_name); + return -ENOENT; + } + + return 0; +} + +void +otx_cpt_stop_device(void *dev) +{ + int rc; + uint32_t pending, retries = 5; + struct cpt_vf *cptvf = (struct cpt_vf *)dev; + + /* Wait for pending entries to complete */ + pending = otx_cpt_read_vq_doorbell(cptvf); + while (pending) { + CPT_LOG_DP_DEBUG("%s: Waiting for pending %u cmds to complete", + cptvf->dev_name, pending); + sleep(1); + pending = otx_cpt_read_vq_doorbell(cptvf); + retries--; + if (!retries) + break; + } + + if (!retries && pending) { + CPT_LOG_ERR("%s: Timeout waiting for commands(%u)", + cptvf->dev_name, pending); + return; + } + + rc = otx_cpt_send_vf_down(cptvf); + if (rc) { + CPT_LOG_ERR("Failed to bring down vf %s, rc %d", + cptvf->dev_name, rc); + return; + } +} diff --git a/drivers/crypto/octeontx/otx_cryptodev_hw_access.h b/drivers/crypto/octeontx/otx_cryptodev_hw_access.h index 6e5731a..b795983 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.h +++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.h @@ -11,6 +11,7 @@ #include #include "cpt_common.h" +#include "cpt_hw_types.h" #define CPT_INTR_POLL_INTERVAL_MS (50) @@ -145,4 +146,33 @@ otx_cpt_hw_init(struct cpt_vf *cptvf, void *pdev, void *reg_base, char *name); int otx_cpt_deinit_device(void *dev); +int +otx_cpt_start_device(void *cptvf); + +void +otx_cpt_stop_device(void *cptvf); + +/* Write to VQX_DOORBELL register + */ +static __rte_always_inline void +otx_cpt_write_vq_doorbell(struct cpt_vf *cptvf, uint32_t val) +{ + cptx_vqx_doorbell_t vqx_dbell; + + vqx_dbell.u = 0; + vqx_dbell.s.dbell_cnt = val * 8; /* Num of Instructions * 8 words */ + CPT_WRITE_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_DOORBELL(0, 0), vqx_dbell.u); +} + +static __rte_always_inline uint32_t +otx_cpt_read_vq_doorbell(struct cpt_vf *cptvf) +{ + cptx_vqx_doorbell_t vqx_dbell; + + vqx_dbell.u = CPT_READ_CSR(CPT_CSR_REG_BASE(cptvf), + CPTX_VQX_DOORBELL(0, 0)); + return vqx_dbell.s.dbell_cnt; +} + #endif /* _OTX_CRYPTODEV_HW_ACCESS_H_ */ diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c index 68c6b92..905b37a 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c @@ -5,12 +5,14 @@ #include #include #include +#include #include #include "cpt_pmd_logs.h" #include "cpt_pmd_ops_helper.h" #include "otx_cryptodev.h" +#include "otx_cryptodev_capabilities.h" #include "otx_cryptodev_hw_access.h" #include "otx_cryptodev_ops.h" @@ -95,6 +97,97 @@ otx_cpt_periodic_alarm_stop(void *arg) return rte_eal_alarm_cancel(otx_cpt_alarm_cb, arg); } +/* PMD ops */ + +static int +otx_cpt_dev_config(struct rte_cryptodev *dev __rte_unused, + struct rte_cryptodev_config *config __rte_unused) +{ + CPT_PMD_INIT_FUNC_TRACE(); + return 0; +} + +static int +otx_cpt_dev_start(struct rte_cryptodev *c_dev) +{ + void *cptvf = c_dev->data->dev_private; + + CPT_PMD_INIT_FUNC_TRACE(); + + return otx_cpt_start_device(cptvf); +} + +static void +otx_cpt_dev_stop(struct rte_cryptodev *c_dev) +{ + void *cptvf = c_dev->data->dev_private; + + CPT_PMD_INIT_FUNC_TRACE(); + + otx_cpt_stop_device(cptvf); +} + +static int +otx_cpt_dev_close(struct rte_cryptodev *c_dev) +{ + void *cptvf = c_dev->data->dev_private; + + CPT_PMD_INIT_FUNC_TRACE(); + + otx_cpt_periodic_alarm_stop(cptvf); + otx_cpt_deinit_device(cptvf); + + return 0; +} + +static void +otx_cpt_dev_info_get(struct rte_cryptodev *dev, struct rte_cryptodev_info *info) +{ + CPT_PMD_INIT_FUNC_TRACE(); + if (info != NULL) { + info->max_nb_queue_pairs = CPT_NUM_QS_PER_VF; + info->feature_flags = dev->feature_flags; + info->capabilities = otx_get_capabilities(); + info->sym.max_nb_sessions = 0; + info->driver_id = otx_cryptodev_driver_id; + info->min_mbuf_headroom_req = OTX_CPT_MIN_HEADROOM_REQ; + info->min_mbuf_tailroom_req = OTX_CPT_MIN_TAILROOM_REQ; + } +} + +static void +otx_cpt_stats_get(struct rte_cryptodev *dev __rte_unused, + struct rte_cryptodev_stats *stats __rte_unused) +{ + CPT_PMD_INIT_FUNC_TRACE(); +} + +static void +otx_cpt_stats_reset(struct rte_cryptodev *dev __rte_unused) +{ + CPT_PMD_INIT_FUNC_TRACE(); +} + +static struct rte_cryptodev_ops cptvf_ops = { + /* Device related operations */ + .dev_configure = otx_cpt_dev_config, + .dev_start = otx_cpt_dev_start, + .dev_stop = otx_cpt_dev_stop, + .dev_close = otx_cpt_dev_close, + .dev_infos_get = otx_cpt_dev_info_get, + + .stats_get = otx_cpt_stats_get, + .stats_reset = otx_cpt_stats_reset, + .queue_pair_setup = NULL, + .queue_pair_release = NULL, + .queue_pair_count = NULL, + + /* Crypto related operations */ + .sym_session_get_size = NULL, + .sym_session_configure = NULL, + .sym_session_clear = NULL +}; + static void otx_cpt_common_vars_init(struct cpt_vf *cptvf) { @@ -164,7 +257,7 @@ otx_cpt_dev_create(struct rte_cryptodev *c_dev) /* Initialize data path variables used by common code */ otx_cpt_common_vars_init(cptvf); - c_dev->dev_ops = NULL; + c_dev->dev_ops = &cptvf_ops; c_dev->enqueue_burst = NULL; c_dev->dequeue_burst = NULL; diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.h b/drivers/crypto/octeontx/otx_cryptodev_ops.h index ac88fa5..b3efecf 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_ops.h +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.h @@ -5,6 +5,10 @@ #ifndef _OTX_CRYPTODEV_OPS_H_ #define _OTX_CRYPTODEV_OPS_H_ +#define OTX_CPT_MIN_HEADROOM_REQ (24) +#define OTX_CPT_MIN_TAILROOM_REQ (8) +#define CPT_NUM_QS_PER_VF (1) + void cleanup_global_resources(void); -- 2.7.4