From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0082.outbound.protection.outlook.com [104.47.32.82]) by dpdk.org (Postfix) with ESMTP id D544A2C38 for ; Tue, 4 Sep 2018 06:03:08 +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=TWELDeQrWTR0gemWlemqfgA/oyTILRRv/pSErf1mLPo=; b=Ld1u1GAPjlEJ94wcHRYNhLH3aBy6AJeC7c3nXSl9m7TxqPZ+WCJ2dibR3xJSaYCLkw+IJdZahp3/WbS6dvR4KqAKtgN12SvI+3Ulguo3AssfvQQuVK9nj4UsJ8kK7VCiYnTJVvQMda0xCBNB1bWEA3KxNHVsNksOhqLW0ujZPAU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.com (115.113.156.2) by BYAPR07MB4902.namprd07.prod.outlook.com (2603:10b6:a02:ef::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.15; Tue, 4 Sep 2018 04:02:39 +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: Tue, 4 Sep 2018 09:29:00 +0530 Message-Id: <1536033560-21541-14-git-send-email-ajoseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536033560-21541-1-git-send-email-ajoseph@caviumnetworks.com> References: <1528476325-15585-1-git-send-email-anoob.joseph@caviumnetworks.com> <1536033560-21541-1-git-send-email-ajoseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BMXPR01CA0023.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::33) To BYAPR07MB4902.namprd07.prod.outlook.com (2603:10b6:a02:ef::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 730c8533-531c-429b-ffa6-08d6121b440e X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4902; X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4902; 3:llbJdeHXauVQWIur9g7YBVAMAQzco6s7nLoLd6PX8cRve79s149Ar/TCe25ImCJF9C+ZILghf8VNzacB0xbmI3TC4kTt9yQDQOD0U6ACEyRqPLTNDGVZO+DWJiCZX7QOh0Cfxzj51YnR5sESocEEvvJx+jiFYSuTPCnKYNqMl3CYsYE1cqZdENVEg+ulkovsuH7ZWTmxzX8NwC19lWlMHHUGS792dqTXeg4f0+2N6HwrQ65dvW713jY5nop5gvZW; 25:T0P7D76T08lfeGG1O0u9FktKgDTAiUjQnik64p5T9b79+ypat4cWRKzxo2tejZqBFyMZTh7DhbUgQt6XU2DdlJlH3I6Xcxb1LDB72TmWOlR8kGiAyQxEuTPycTb8prP1i8z2xzBQr8cGg2SQE9UXTtkNQLKxz5RGvmU0GABVUHG4Q7cslYqCstXOu+exVWIShl/wtK/sb8UE+16Hp25MdGpNYxPLOrLF+t+y4oGByaXMBe+LLbmsSA8qBdm120sadxqf8cdF9QNpQco2aEHBWYoZVMACXH35YBVkwTrhbKa+J2OtY9vRy3BI3eyffCWskHqMWCPOHN+90b3BUF4ASQ==; 31:/XIoiHO1hFgRiOwCGPvFil24DzeqLdkJwXsGvDfT/N8YfjyiCjn/adR6FnlQubCZiqx5oNpaKd5UdPWWN4v0yo+sHdihq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BWnTHBfrSUwEWO9z+mohAKzJR0qVQnIzJDg== 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)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699016); SRVR:BYAPR07MB4902; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4902; X-Forefront-PRVS: 0785459C39 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(136003)(346002)(376002)(39860400002)(199004)(189003)(26005)(51416003)(52116002)(76176011)(81166006)(305945005)(81156014)(7736002)(105586002)(316002)(6506007)(106356001)(6512007)(8936002)(446003)(54906003)(25786009)(6666003)(68736007)(50226002)(110136005)(53936002)(16586007)(42882007)(386003)(5660300001)(2906002)(72206003)(50466002)(6486002)(36756003)(6116002)(107886003)(2616005)(14444005)(186003)(3846002)(478600001)(66066001)(476003)(8676002)(47776003)(486006)(956004)(48376002)(11346002)(4326008)(97736004)(16526019); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4902; 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; BYAPR07MB4902; 23:UNjKIHvaztezhMjURI2ygyS+sDC+UP4kE/j+RjTAD?= =?us-ascii?Q?UrxTUAS45nsrAPiPSezPKNXXfSjhf0qI/Tbyfb0APiOsHnsVL1dNpHknD+Wc?= =?us-ascii?Q?3RFYwmYEhtjTXzjevmI37hgxrj0NEmYbSIAzqbcPHkwyEMinxbCBy/0mJxl8?= =?us-ascii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eV8+ukQFlbuUcCctmHRo0eT6NRkQWZxxkUw336/mHsl2TOFLpcV5SbocP2M0PJ+Uo5c2NJ6oLVlSujg==; 5:dnC8jVL3xk4sQMYbIe9Y5wzWae/NtZJhXPN+sAG7KbKV8GCSSb2m+8oKmXW11MCSI1rC9AFJNEW3woa0LmftWzxEIAty3jckhMkafzBB+6cbQ7wGZ93t9K2ihnMbaeUb9v3aekZD84ufNoFgvDGYxAirKYI3IK5w+dKrZC27Nxw=; 7:SCXoX+xGCN/pAz1g2fCDYyIB1BQKqEgxTBmmZNjp1Z9QBjAjS/4U16enfbmSn4bgxjebOz7i6iZgq62UMQweXP5mx+LIX+hRCQ8J2ECaTaGO6HLSx52IxM6iwQz2qru/Ga/TMXVixQCgkihbxFMckKqJqowZmSdssXQMf+k9LZMNZyWnyzUvF4hqbscRlwarrbYp33FKpnHayRnxyBsLoudk9g126zvFBjEf8Rt2tyJNLav7UbTj6oNDvCkjczHx SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 04:02:39.6473 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 730c8533-531c-429b-ffa6-08d6121b440e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4902 Subject: [dpdk-dev] [PATCH v2 13/33] 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, 04 Sep 2018 04:03:09 -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 | 57 ++++++++++++++ drivers/crypto/octeontx/otx_cryptodev_hw_access.h | 30 ++++++++ drivers/crypto/octeontx/otx_cryptodev_ops.c | 94 ++++++++++++++++++++++- 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 a6b5bc6..d8b8872 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 @@ -265,3 +266,59 @@ 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\n", 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 82d8255..7dbc41e 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" /* Flags to indicate the features supported */ #define CPT_FLAG_VF_DRIVER (uint16_t)(1 << 3) @@ -150,4 +151,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 d109159..2bbf82f 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "cpt_pmd_logs.h" @@ -101,6 +102,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_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) { @@ -170,7 +262,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