From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720082.outbound.protection.outlook.com [40.107.72.82]) by dpdk.org (Postfix) with ESMTP id 8FEB91B181 for ; Tue, 9 Oct 2018 11:09:13 +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=dnnGSZrsfi/TLu/UWdQcwAFcZKkKFTElyOpM8olVTNvjvjzlQosHKCsW86w3NNJjGGZgPDveoEdu2Io4wuEX50T2O0magr9yHInF/sGq8+W1KLwH8VJGhat+Tiyh4Ga+OTvqu0ZMzXLw+SMjJSdXZmzdQnJQ7JsiVdcYr4eG8aQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.com (115.113.156.2) by BN7PR07MB4897.namprd07.prod.outlook.com (2603:10b6:406:ef::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.28; Tue, 9 Oct 2018 09:09:08 +0000 From: Anoob Joseph To: Akhil Goyal , Pablo de Lara , Thomas Monjalon Cc: Murthy NSSR , Jerin Jacob , Narayana Prasad , Ankur Dwivedi , Anoob Joseph , Nithin Dabilpuram , Ragothaman Jayaraman , Srisivasubramanian S , Tejasree Kondoj , dev@dpdk.org Date: Tue, 9 Oct 2018 14:37:41 +0530 Message-Id: <1539076076-19786-9-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539076076-19786-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1538744363-30340-1-git-send-email-anoob.joseph@caviumnetworks.com> <1539076076-19786-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: PN1PR0101CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::14) To BN7PR07MB4897.namprd07.prod.outlook.com (2603:10b6:406:ef::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aef75777-9340-4d2d-5197-08d62dc6e0da X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BN7PR07MB4897; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4897; 3:MdpJjDikxQWwYLk2Ub9/QSLu8Ac28pT3g1CUtGmXNo2qBYEfymkOzJKVYwm5nZ212k2TVI92ovh6uJrcVCL0ee48y83S58bVk2u1AlFw0UjgCLr3xkD0DQNN3ZJzaizAomsPX09QIBszP8ejshF42ryG4kbfA+YaQxgH5vnRSUQkK8hA6ns1IvQvhzZKtHdfLTXwLH/nP52abcq3v5gq5K2xMPbHpqUCuz3u28rNaQ39qgugq6Ljw39Aw5Y5hbk/; 25:i8uSx5KW010trQcLtWaa4i8IroG/7ISf37M8gdp+aW8yzymAWYy7+Prutuh5W3T4JVs5VVXZEKAZOqg3UdE6vl1bUMV4c7W6SDThkZUJ1XHcyfhwukIio3uTGUSqj32yWGdt7mYJw/z5nNpXTxRxvNFQ4Xu7fLsWDJFNisPfur9GM1RJE9YhV0+/tBNYsZz2aeunmNZZOT6hzklkL6soRBoR0DZx/iz0Nv5u7MlNae5DWoji1x4BKrMysEGdNVDDNOTUnxf5fUcpAvydAv05G49V9YYvwCDyoZCPDHkyHTrdyAMZCCXfleUEkbvq7TPogiIbyzQzGMLEXin7EbMkTA==; 31:rg2TXjvNdkWoFnbeqPrTAVBpht1gEhw+SpO7VmUxiyhrEYouJSqLxh//Zz6fY9E26HOXdVn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sx0HMuYP+zL0hakXr2d06pSWz6G6pYLzUutN+gQ1CLf0xxlf5kZIYsV6H9qs6BcIS2MmHnAQIg== 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)(5005006)(8121501046)(3002001)(93006095)(10201501046)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(201708071742011)(7699051); SRVR:BN7PR07MB4897; BCL:0; PCL:0; RULEID:; SRVR:BN7PR07MB4897; X-Forefront-PRVS: 08200063E9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(376002)(136003)(346002)(39860400002)(199004)(189003)(42882007)(47776003)(106356001)(6666003)(186003)(5660300001)(26005)(68736007)(16526019)(8936002)(25786009)(6116002)(2906002)(81156014)(50226002)(305945005)(81166006)(7736002)(3846002)(105586002)(478600001)(8676002)(54906003)(110136005)(48376002)(16586007)(14444005)(6486002)(6506007)(50466002)(316002)(53936002)(386003)(51416003)(52116002)(76176011)(11346002)(6512007)(44832011)(446003)(36756003)(55236004)(956004)(2616005)(486006)(4326008)(66066001)(97736004)(72206003)(476003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR07MB4897; 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; BN7PR07MB4897; 23:UXyn2Ga5Kdd8YyhuKlPzpBB8bxwglbIpryL7hw1lw?= =?us-ascii?Q?qxQ0N9xCfNAL3fywMr0ZbafBI2oPmZF+FWFofRiJYfrVgFUittkg3g1lfWWB?= =?us-ascii?Q?VmbgKdJ3sKWEWQI6Bbs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68hHPiH2nwO909o0FX9X4x0ZF9P2wFwH1p7mv/VQrzocr/88OHsomH74vc7e+TyjmyELrsvdPkoq9YVm4ItisAucwSsJmKi5CrWOJARFYZvhKSSNyXVRfb75zVNuAO5obwQInScJEc4whNq8hVllg==; 5:TGgamWSrTfYpdKDW8z6+imY2J8SOM5US2s0OdVfZkht9sN/Y5fUFHa2RmEw30Mmz3lqdjCudyP0Xb3DmInEeoGk75euGA3PcNxdneu5zGx+SvqWq1bVlhonAX++KCMGBFA4UPfY3WXhHkiNz9bw2d1Aa6ycvVU5o90zkYLXpMlk=; 7:cmLLfA5GIgY6PR2aABwWjy36SU1TbRN60AFTxUBzdFBhsXccKsE3m19mxHHxkhpzx2S5tF5721YpVpKpDZHlNq9FhYCymd95n5OEFtb6PbKwek4XSsFKVRMLPKev0pAIHR2WdawswFgPFOe+QlHfgKdBE78kzuR4Y4yVmCS580w+wEBP7599c6Px3ZJd1N0epoZXHREnvTXyB9GM/x+16AGc9kka+uL5nuQeSlcbny9YKiQP9BkA58MTRkkW5TVZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2018 09:09:08.4979 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aef75777-9340-4d2d-5197-08d62dc6e0da X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4897 Subject: [dpdk-dev] [PATCH v4 08/23] 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: Tue, 09 Oct 2018 09:09:14 -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