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 39EF9459B6; Tue, 17 Sep 2024 20:22:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0974940E28; Tue, 17 Sep 2024 20:22:53 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 793B740280 for ; Tue, 17 Sep 2024 20:22:51 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48HF63E3009218 for ; Tue, 17 Sep 2024 11:22:50 -0700 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 41na0g5wkg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 17 Sep 2024 11:22:49 -0700 (PDT) Received: from m0045851.ppops.net (m0045851.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 48HIMmWE003980; Tue, 17 Sep 2024 11:22:48 -0700 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2044.outbound.protection.outlook.com [104.47.70.44]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 41na0g5wkb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Sep 2024 11:22:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Y8lz/KZEoURHxgr/o2po/V9KaWp7LNHPF/O2x6lUtDjK9JkYr7dq4ZDTN9ikJDLJwaTZYrn0Qgr2Qo9LBsOqMG/OGb00YgwER6KNXtvGXm4VfrVP2hqS9FEBHc4QfX/Wx8o2baVFiuPKPMLfsg2s5XzgBsLExYHiuq9CxT0BbJMMPyXk0sP/oHZg8r+ds4N6EzMGZUuXHo6Eh1TOP2+qhqpjwPEvobuZQQ6cTGPuywjkir7ZlsDGTbS6DvhbrBq6xayuDkOlJXvS/rX3TsF86f4bMenezAipRCAQc0pFv+8eIHjP5eq+LfjWlRqqO9c/FFbM4QKTd8sMRsrj2rg/YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hE4YDh6xKu3Dh2q7+6ZayRRIqfhxQO5rpToLl5ifClI=; b=aRamst36NO7lm/JHJgufleo5XIJf26c2oS2FjXfcpMWM3FETqPeOxIBIzs3JItHnU/eOJsi4aq+a0laeVuq6dyrK48GMOAWqugasEMCO4qYN8PMKscMC2UOQZAD1zxuZu3iRMZBeAPUQVSSVA863ukvL29McEFESx4u8P+TQ5OVjK5u9y8kv0Wr7SqMqBJ+3hbNwSGVWtekiToqdVhbLAZqYtSTxYGCbDgaGSC0MPEJrGOFVsIWI2zA5iMGh0ZOhddj7IIr5NyWU141oG4DyM12PRHqQUkkrbt9YynE58ZXOhFfU/yhdifCF+h6LU0jWVwgItg4QEeUvhqI7Yqs52A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hE4YDh6xKu3Dh2q7+6ZayRRIqfhxQO5rpToLl5ifClI=; b=C4D1uiTClJb3kYmqvzJoqtwWgcAPaJNxzx+2XCWyOhkze/6ZxJlhH75dA1X5pV3yD5FpFOu70fK74ui0dasSgJzJq09qkfvF22Eoh5Z1FWZ8/YqC4IiCJFJgYs5Hl/al2eLHsdt8Diym5llVSu6EY7s6C0WrAMUJsQOhpk3+DIk= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO6PR18MB4019.namprd18.prod.outlook.com (2603:10b6:5:34c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.24; Tue, 17 Sep 2024 18:22:44 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d%5]) with mapi id 15.20.7962.022; Tue, 17 Sep 2024 18:22:44 +0000 From: Akhil Goyal To: Hanxiao Li , "dev@dpdk.org" CC: "wang.yong19@zte.com.cn" Subject: RE: [EXTERNAL] [PATCH v6 5/8] zsda: modify files for introducing zsda cryptodev Thread-Topic: [EXTERNAL] [PATCH v6 5/8] zsda: modify files for introducing zsda cryptodev Thread-Index: AQHbBCAavTBKLFmqCEmUZtIvgL7L07JcU5TQ Date: Tue, 17 Sep 2024 18:22:44 +0000 Message-ID: References: <20240911075200.4074366-1-li.hanxiao@zte.com.cn> <20240911075447.4074486-1-li.hanxiao@zte.com.cn> <20240911075447.4074486-4-li.hanxiao@zte.com.cn> In-Reply-To: <20240911075447.4074486-4-li.hanxiao@zte.com.cn> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO6PR18MB4484:EE_|CO6PR18MB4019:EE_ x-ms-office365-filtering-correlation-id: 7cb28f36-ac89-4295-f7a2-08dcd745b976 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018; x-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OSjUyczZkL2RId21wWktURGpMeHdCM3dh?= =?utf-8?Q?2D1EIghmhwPcP0BwAQRWOkqmY0hvSCTqQbe6s=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?WERZQktWRkRUQWxGL3Jjc25ZSlJPTURnaHVjSU93MFVDSlY0UXZmcXZkTm42?= =?utf-8?B?R09GQ1A3NGcrRlIxRW1yeG5rajBpd2hWNTYya0MrRExPZitTSHhiMHZEOEdv?= =?utf-8?B?Vncyc0IzbGw4ZGo4UHdqcjdFbm5mNzcySWlETENZYXZ5eHA0TTdDQ3NmUWJT?= =?utf-8?B?SGZUZ3lGUkYyK0RQTTB0ZGc0SHIvLys2UnQ5ZHB5ZjFmeVJaNituNGdjb0dn?= =?utf-8?B?OVFXNUhzMXdXVE8vSmZVSllzcUs3SDlhcGpTUEhzSU5QUW8xMXpLUzE4SUln?= =?utf-8?B?WEE0SDcrU3h5M1lYNzNHUWZDRm5ka252VVcyNGZ5d1dJaWlzOHo4K2JtUXc2?= =?utf-8?B?aktrK0ZPR1E5cms2TGh6bWlrRy9VbXQ0VWgvK2dVMWNvSlFwMkI0V2k2Z3hs?= =?utf-8?B?VHJSTHlTc0RwMzhVOFdjTkJRSkpRUXlxUDlKYVFSbTRIRU9uN2E1Z2ViTnVZ?= =?utf-8?B?QzloMUVIeTl6QW54THF0SERiZE1zczVxemhSSVdHakxhbXhBQmpvbWRvbllZ?= =?utf-8?B?bGtkenRYblBZS21JSTAxRit4bEF5YVo0TVBCdWZYYmZuMXpkL2hXRHB2THp0?= =?utf-8?B?RUlEMEpoL1l5NUJqK29LUk5kcGR0MVFLSkt3bEx1QVhhbXAv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XJkdnJxM2l5UDdjVWkva0l1SWNrN3J3?= =?utf-8?B?SUZkdTFOeFVaL3EvYjFFRlp3S3JrazZxWEpaMGFKU1h2MVBUK0NzM1JRNHRX?= =?utf-8?B?cW5oeVNDNFZmR0FUMHlJaXJBcCtFZ250MU5WSy9HZHRCQ0gvMUhsWFF4RnlP?= =?utf-8?B?K1RRNS8wclo1UnI1T1ZNelFsUUpCM2xvcVVWQi9SQ2lzc3pKU0M0VWxia2Rv?= =?utf-8?B?aDgxbDVCd0xIckFaN2g4S1V0c09IQ2FUa1B4MUxWU2VmL0xvOTJJTThybTBy?= =?utf-8?B?R25hTWd4MnNCdlNHYVExcnEwOS9mV01DMFFwaExRSDVGTWx3SVFvdE4zeXQr?= =?utf-8?B?RnB4ZkNyYTloMkh2d2tRZWYzMStOKzllSjNWWlZxS2FpZHo1Tkx3SEVXSTBJ?= =?utf-8?B?aUhZRjBVUEpMVUs3WVNPOE5JRGpSMjZGeTJ5WmNwV1UyMkZIYUJRR3VnZG9F?= =?utf-8?B?U3E2cGlHQWt6YVNRTUdIRzN4aHV3UlZmUStvdFVZWXZrZTVHRHZLckZJYW9Z?= =?utf-8?B?aXR2RnRVeFgrM0M5UXZtTlo3MlFJQWRNMzlJU0dvd01tWGpFNVdQUFVSZXpN?= =?utf-8?Q?BDtk=3D?= MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7cb28f36-ac89-4295-f7a2-08dcd745b976 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Sep 2024 18:22:44.3896 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: K4dTebJoS5yzj+Fzzdmedkzfm788M89KcqvbOrM1881fV+uDqJjOKzI/Ngi/SoMAM1zyzLyHKlGMn8QahjyQPw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR18MB4019 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: 5Ca984hcMDp51NqR6TXDnBt0UbGCaRtZ X-Proofpoint-GUID: lw3G6J8AURhIk5r1JfFFqlBctNZtXKVm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 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 > -----Original Message----- > From: Hanxiao Li > Sent: Wednesday, September 11, 2024 1:24 PM > To: dev@dpdk.org > Cc: wang.yong19@zte.com.cn; Hanxiao Li > Subject: [EXTERNAL] [PATCH v6 5/8] zsda: modify files for introducing zsda > cryptodev >=20 > It is necessary to make necessary modifications to existing files based o= n the > newly introduced content Signed-off-by: Hanxiao Li --- > MAINTAINERS | 3 ++ drivers/common/zsda/zsda_common.=E2=80=8Ah | 50 > +++++++++++++++++++++++ >=20 > It is necessary to make necessary modifications to > existing files based on the newly introduced content >=20 > Signed-off-by: Hanxiao Li > --- > MAINTAINERS | 3 ++ > drivers/common/zsda/zsda_common.h | 50 +++++++++++++++++++++++ > drivers/common/zsda/zsda_device.c | 42 +++----------------- > drivers/common/zsda/zsda_device.h | 19 +++++++-- > drivers/common/zsda/zsda_qp.c | 66 ++++++++++++++++++++++++++++++- > lib/cryptodev/rte_crypto_sym.h | 4 +- > 6 files changed, 141 insertions(+), 43 deletions(-) >=20 > diff --git a/MAINTAINERS b/MAINTAINERS > index ea245fc61b..9e66c72c45 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1221,6 +1221,9 @@ F: drivers/crypto/virtio/ > F: doc/guides/cryptodevs/virtio.rst > F: doc/guides/cryptodevs/features/virtio.ini >=20 > +ZTE Storage Data Accelerator > +M: Hanxiao Li > +F: drivers/crypto/zsda/ >=20 > Compression Drivers > ------------------- > diff --git a/drivers/common/zsda/zsda_common.h > b/drivers/common/zsda/zsda_common.h > index 0dbc9b7d3c..d50a152307 100644 > --- a/drivers/common/zsda/zsda_common.h > +++ b/drivers/common/zsda/zsda_common.h > @@ -97,17 +97,39 @@ > enum zsda_service_type { > ZSDA_SERVICE_COMPRESSION =3D 0, > ZSDA_SERVICE_DECOMPRESSION, > + ZSDA_SERVICE_SYMMETRIC_ENCRYPT, > + ZSDA_SERVICE_SYMMETRIC_DECRYPT, > + ZSDA_SERVICE_HASH_ENCODE =3D 6, > ZSDA_SERVICE_INVALID, > }; >=20 > #define ZSDA_MAX_SERVICES (ZSDA_SERVICE_INVALID) >=20 > +#define ZSDA_OPC_EC_AES_XTS_256 0x0 /* Encry AES-XTS-256 */ > +#define ZSDA_OPC_EC_AES_XTS_512 0x01 /* Encry AES-XTS-512 */ > +#define ZSDA_OPC_EC_SM4_XTS_256 0x02 /* Encry SM4-XTS-256 */ > +#define ZSDA_OPC_DC_AES_XTS_256 0x08 /* Decry AES-XTS-256 */ > +#define ZSDA_OPC_DC_AES_XTS_512 0x09 /* Decry AES-XTS-512 */ > +#define ZSDA_OPC_DC_SM4_XTS_256 0x0A /* Decry SM4-XTS-256 */ > #define ZSDA_OPC_COMP_GZIP 0x10 /* Encomp deflate-Gzip */ > #define ZSDA_OPC_COMP_ZLIB 0x11 /* Encomp deflate-Zlib */ > #define ZSDA_OPC_DECOMP_GZIP 0x18 /* Decompinfalte-Gzip */ > #define ZSDA_OPC_DECOMP_ZLIB 0x19 /* Decompinfalte-Zlib */ > +#define ZSDA_OPC_HASH_SHA1 0x20 /* Hash-SHA1 */ > +#define ZSDA_OPC_HASH_SHA2_224 0x21 /* Hash-SHA2-224 */ > +#define ZSDA_OPC_HASH_SHA2_256 0x22 /* Hash-SHA2-256 */ > +#define ZSDA_OPC_HASH_SHA2_384 0x23 /* Hash-SHA2-384 */ > +#define ZSDA_OPC_HASH_SHA2_512 0x24 /* Hash-SHA2-512 */ > +#define ZSDA_OPC_HASH_SM3 0x25 /* Hash-SM3 */ > #define ZSDA_OPC_INVALID 0xff >=20 > +#define ZSDA_DIGEST_SIZE_SHA1 (20) > +#define ZSDA_DIGEST_SIZE_SHA2_224 (28) > +#define ZSDA_DIGEST_SIZE_SHA2_256 (32) > +#define ZSDA_DIGEST_SIZE_SHA2_384 (48) > +#define ZSDA_DIGEST_SIZE_SHA2_512 (64) > +#define ZSDA_DIGEST_SIZE_SM3 (32) > + > #define SET_CYCLE 0xff > #define SET_HEAD_INTI 0x0 >=20 > @@ -237,9 +259,34 @@ struct zsda_op_cookie { > uint8_t comp_head[COMP_REMOVE_SPACE_LEN]; > } __rte_packed; >=20 > +#define ZSDA_CIPHER_KEY_MAX_LEN 64 > +struct crypto_cfg { > + uint8_t slba_L[8]; > + uint8_t key[ZSDA_CIPHER_KEY_MAX_LEN]; > + uint8_t lbads : 4; > + uint8_t resv1 : 4; > + uint8_t resv2[7]; > + uint8_t slba_H[8]; > + uint8_t resv3[8]; > +} __rte_packed; > + Move crypto specific things to crypto pmd. > struct compress_cfg { > } __rte_packed; >=20 > +struct zsda_wqe_crpt { > + uint8_t valid; > + uint8_t op_code; > + uint16_t sid; > + uint8_t resv[3]; > + uint8_t rx_sgl_type : 4; > + uint8_t tx_sgl_type : 4; > + uint64_t rx_addr; > + uint32_t rx_length; > + uint64_t tx_addr; > + uint32_t tx_length; > + struct crypto_cfg cfg; > +} __rte_packed; > + > struct zsda_wqe_comp { > uint8_t valid; > uint8_t op_code; > @@ -281,6 +328,9 @@ struct zsda_common_stat { > enum zsda_algo_core { > ZSDA_CORE_COMP, > ZSDA_CORE_DECOMP, > + ZSDA_CORE_ENCRY, > + ZSDA_CORE_DECRY, > + ZSDA_CORE_HASH, > ZSDA_CORE_INVALID, > }; >=20 > diff --git a/drivers/common/zsda/zsda_device.c > b/drivers/common/zsda/zsda_device.c > index de8894f5a3..4ddc97e564 100644 > --- a/drivers/common/zsda/zsda_device.c > +++ b/drivers/common/zsda/zsda_device.c > @@ -7,6 +7,7 @@ > #include >=20 > #include "zsda_device.h" > +#include "zsda_qp.h" >=20 > /* per-process array of device data */ > struct zsda_device_info zsda_devs[RTE_PMD_ZSDA_MAX_PCI_DEVICES]; > @@ -306,7 +307,8 @@ zsda_pci_device_release(const struct rte_pci_device > *pci_dev) > inst =3D &zsda_devs[zsda_pci_dev->zsda_dev_id]; >=20 > if (rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY) { > - if (zsda_pci_dev->comp_dev !=3D NULL) { > + if ((zsda_pci_dev->sym_dev !=3D NULL) || > + (zsda_pci_dev->comp_dev !=3D NULL)) { > ZSDA_LOG(DEBUG, "ZSDA device %s is busy", name); > return -EBUSY; > } > @@ -322,47 +324,12 @@ static int > zsda_pci_dev_destroy(struct zsda_pci_device *zsda_pci_dev, > const struct rte_pci_device *pci_dev) > { > + zsda_sym_dev_destroy(zsda_pci_dev); > zsda_comp_dev_destroy(zsda_pci_dev); >=20 > return zsda_pci_device_release(pci_dev); > } >=20 > -int > -zsda_get_queue_cfg_by_id(const struct zsda_pci_device *zsda_pci_dev, > - const uint8_t qid, struct qinfo *qcfg) > -{ > - struct zsda_admin_req_qcfg req =3D {0}; > - struct zsda_admin_resp_qcfg resp =3D {0}; > - int ret =3D 0; > - struct rte_pci_device *pci_dev =3D > - zsda_devs[zsda_pci_dev->zsda_dev_id].pci_dev; > - > - if (qid >=3D MAX_QPS_ON_FUNCTION) { > - ZSDA_LOG(ERR, "qid beyond limit!"); > - return ZSDA_FAILED; > - } > - > - zsda_admin_msg_init(pci_dev); > - req.msg_type =3D ZSDA_ADMIN_QUEUE_CFG_REQ; > - req.qid =3D qid; > - > - ret =3D zsda_send_admin_msg(pci_dev, &req, sizeof(req)); > - if (ret) { > - ZSDA_LOG(ERR, "Failed! Send msg"); > - return ret; > - } > - > - ret =3D zsda_recv_admin_msg(pci_dev, &resp, sizeof(resp)); > - if (ret) { > - ZSDA_LOG(ERR, "Failed! Receive msg"); > - return ret; > - } > - > - memcpy(qcfg, &resp.qcfg, sizeof(*qcfg)); > - > - return ZSDA_SUCCESS; > -} > - > static int > zsda_unmask_flr(const struct zsda_pci_device *zsda_pci_dev) > { > @@ -432,6 +399,7 @@ zsda_pci_probe(struct rte_pci_driver *pci_drv > __rte_unused, > return ret; > } >=20 > + ret |=3D zsda_sym_dev_create(zsda_pci_dev); > ret |=3D zsda_comp_dev_create(zsda_pci_dev); >=20 > if (ret) { > diff --git a/drivers/common/zsda/zsda_device.h > b/drivers/common/zsda/zsda_device.h > index 1b2ad0ce85..51ff741840 100644 > --- a/drivers/common/zsda/zsda_device.h > +++ b/drivers/common/zsda/zsda_device.h > @@ -18,6 +18,12 @@ struct zsda_device_info { >=20 > struct rte_pci_device *pci_dev; >=20 > + struct rte_device sym_rte_dev; > + /**< This represents the crypto sym subset of this pci device. > + * Register with this rather than with the one in > + * pci_dev so that its driver can have a crypto-specific name > + */ > + > struct rte_device comp_rte_dev; > /**< This represents the compression subset of this pci device. > * Register with this rather than with the one in > @@ -27,6 +33,7 @@ struct zsda_device_info { >=20 > extern struct zsda_device_info zsda_devs[]; >=20 > +struct zsda_sym_dev_private; > struct zsda_comp_dev_private; >=20 > struct zsda_qp_hw_data { > @@ -64,6 +71,10 @@ struct zsda_pci_device { >=20 > struct rte_pci_device *pci_dev; >=20 > + /* Data relating to symmetric crypto service */ > + struct zsda_sym_dev_private *sym_dev; > + /**< link back to cryptodev private data */ > + > /* Data relating to compression service */ > struct zsda_comp_dev_private *comp_dev; > /**< link back to compressdev private data */ > @@ -79,7 +90,10 @@ struct zsda_pci_device * > zsda_get_zsda_dev_from_pci_dev(const struct rte_pci_device *pci_dev); >=20 > __rte_weak int > -zsda_get_queue_cfg(struct zsda_pci_device *zsda_pci_dev); > +zsda_sym_dev_create(struct zsda_pci_device *zsda_pci_dev); > + > +__rte_weak int > +zsda_sym_dev_destroy(struct zsda_pci_device *zsda_pci_dev); >=20 > __rte_weak int > zsda_comp_dev_create(struct zsda_pci_device *zsda_pci_dev); > @@ -87,9 +101,6 @@ zsda_comp_dev_create(struct zsda_pci_device > *zsda_pci_dev); > __rte_weak int > zsda_comp_dev_destroy(struct zsda_pci_device *zsda_pci_dev); >=20 > -int zsda_get_queue_cfg_by_id(const struct zsda_pci_device *zsda_pci_dev, > - const uint8_t qid, struct qinfo *qcfg); > - > int zsda_queue_start(const struct rte_pci_device *pci_dev); > int zsda_queue_stop(const struct rte_pci_device *pci_dev); > int zsda_queue_clear(const struct rte_pci_device *pci_dev); > diff --git a/drivers/common/zsda/zsda_qp.c b/drivers/common/zsda/zsda_qp.c > index f2dfe43b2e..5c5ac90771 100644 > --- a/drivers/common/zsda/zsda_qp.c > +++ b/drivers/common/zsda/zsda_qp.c > @@ -20,8 +20,11 @@ struct ring_size { > }; >=20 > struct ring_size zsda_qp_hw_ring_size[ZSDA_MAX_SERVICES] =3D { > + [ZSDA_SERVICE_SYMMETRIC_ENCRYPT] =3D {128, 16}, > + [ZSDA_SERVICE_SYMMETRIC_DECRYPT] =3D {128, 16}, > [ZSDA_SERVICE_COMPRESSION] =3D {32, 16}, > [ZSDA_SERVICE_DECOMPRESSION] =3D {32, 16}, > + [ZSDA_SERVICE_HASH_ENCODE] =3D {32, 16}, > }; >=20 > static void > @@ -36,6 +39,43 @@ zsda_set_queue_head_tail(const struct zsda_pci_device > *zsda_pci_dev, > SET_HEAD_INTI); > } >=20 > +static int > +zsda_get_queue_cfg_by_id(const struct zsda_pci_device *zsda_pci_dev, > + const uint8_t qid, struct qinfo *qcfg) This function is moved from device.c to qp.c. Better to place it at the right place at once. Avoid unnecessary movement of code within patchset. > +{ > + struct zsda_admin_req_qcfg req =3D {0}; > + struct zsda_admin_resp_qcfg resp =3D {0}; > + int ret =3D 0; > + struct rte_pci_device *pci_dev =3D > + zsda_devs[zsda_pci_dev->zsda_dev_id].pci_dev; > + > + if (qid >=3D MAX_QPS_ON_FUNCTION) { > + ZSDA_LOG(ERR, "qid beyond limit!"); > + return ZSDA_FAILED; > + } > + > + zsda_admin_msg_init(pci_dev); > + req.msg_type =3D ZSDA_ADMIN_QUEUE_CFG_REQ; > + req.qid =3D qid; > + > + ret =3D zsda_send_admin_msg(pci_dev, &req, sizeof(req)); > + if (ret) { > + ZSDA_LOG(ERR, "Failed! Send msg"); > + return ret; > + } > + > + ret =3D zsda_recv_admin_msg(pci_dev, &resp, sizeof(resp)); > + if (ret) { > + ZSDA_LOG(ERR, "Failed! Receive msg"); > + return ret; > + } > + > + memcpy(qcfg, &resp.qcfg, sizeof(*qcfg)); > + > + return ZSDA_SUCCESS; > +} > + > + > int > zsda_get_queue_cfg(struct zsda_pci_device *zsda_pci_dev) > { > @@ -43,7 +83,7 @@ zsda_get_queue_cfg(struct zsda_pci_device > *zsda_pci_dev) > uint32_t index; > enum zsda_service_type type; > struct zsda_qp_hw *zsda_hw_qps =3D zsda_pci_dev->zsda_hw_qps; > - struct qinfo qcfg; > + struct qinfo qcfg =3D {0}; > int ret =3D 0; >=20 > for (i =3D 0; i < zsda_num_used_qps; i++) { > @@ -115,6 +155,30 @@ zsda_comp_max_nb_qps(const struct zsda_pci_device > *zsda_pci_dev) > return min; > } >=20 > +uint16_t > +zsda_crypto_max_nb_qps(struct zsda_pci_device *zsda_pci_dev) > +{ > + uint16_t encrypt =3D zsda_qps_per_service(zsda_pci_dev, > + ZSDA_SERVICE_SYMMETRIC_ENCRYPT); > + uint16_t decrypt =3D zsda_qps_per_service(zsda_pci_dev, > + ZSDA_SERVICE_SYMMETRIC_DECRYPT); > + uint16_t hash =3D > + zsda_qps_per_service(zsda_pci_dev, ZSDA_SERVICE_HASH_ENCODE); > + uint16_t min =3D 0; > + > + if ((encrypt =3D=3D MAX_QPS_ON_FUNCTION) || > + (decrypt =3D=3D MAX_QPS_ON_FUNCTION) || > + (hash =3D=3D MAX_QPS_ON_FUNCTION)) > + min =3D MAX_QPS_ON_FUNCTION; > + else { > + min =3D (encrypt < decrypt) ? encrypt : decrypt; > + min =3D (min < hash) ? min : hash; > + } > + > + if (min =3D=3D 0) > + return MAX_QPS_ON_FUNCTION; > + return min; > +} >=20 > void > zsda_stats_get(void **queue_pairs, const uint32_t nb_queue_pairs, > diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sy= m.h > index 53b18b9412..b34d041fe0 100644 > --- a/lib/cryptodev/rte_crypto_sym.h > +++ b/lib/cryptodev/rte_crypto_sym.h > @@ -176,8 +176,10 @@ enum rte_crypto_cipher_algorithm { > /**< ShangMi 4 (SM4) algorithm in CTR mode */ > RTE_CRYPTO_CIPHER_SM4_OFB, > /**< ShangMi 4 (SM4) algorithm in OFB mode */ > - RTE_CRYPTO_CIPHER_SM4_CFB > + RTE_CRYPTO_CIPHER_SM4_CFB, > /**< ShangMi 4 (SM4) algorithm in CFB mode */ > + RTE_CRYPTO_CIPHER_SM4_XTS > + /**< ShangMi 4 (SM4) algorithm in XTS mode */ > }; This change should be a separate patch. Also add test cases for this.