crypto/cnxk: add max queue pairs limit devargs
Subsystems (2)
PATCH 1/1 crypto/cnxk: add max queue pairs limit devargs
Adds max queue pairs limit devargs for crypto cnxk driver. This can be used to set a limit on the number of maximum queue pairs supported by the device. The default value is 63.
Signed-off-by Ankur Dwivedi <[email protected]>
Reviewed-by Anoob Joseph <[email protected]>
Reviewed-by Jerin Jacob Kollanukkaran <[email protected]>
--- doc/guides/cryptodevs/cnxk.rst | 15 +++++ drivers/crypto/cnxk/cn10k_cryptodev.c | 7 +++ drivers/crypto/cnxk/cn9k_cryptodev.c | 7 +++ drivers/crypto/cnxk/cnxk_cryptodev.h | 2 + drivers/crypto/cnxk/cnxk_cryptodev_devargs.c | 61 ++++++++++++++++++++ drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 5 +- drivers/crypto/cnxk/meson.build | 1 + 7 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/cnxk/cnxk_cryptodev_devargs.c
doc/guides/cryptodevs/cnxk.rst +15 -0
@@ -158,6 +158,21 @@ Bind the CPT VF device to the vfio_pci driver: ./usertools/dpdk-devbind.py -u 0002:20:00.1 ./usertools/dpdk-devbind.py -b vfio-pci 0002:20:00.1 +Runtime Config Options +---------------------- + +- ``Maximum queue pairs limit`` (default ``63``) + + The number of maximum queue pairs supported by the device, can be limited + during runtime by using ``max_qps_limit`` ``devargs`` parameter. + + For example:: + + -a 0002:20:00.1,max_qps_limit=4 + + With the above configuration, the number of maximum queue pairs supported + by the device is limited to 4. + Debugging Options -----------------
drivers/crypto/cnxk/cn10k_cryptodev.c +7 -0
@@ -68,6 +68,13 @@ cn10k_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { roc_cpt->pci_dev = pci_dev; + + rc =cnxk_cpt_parse_devargs (dev->device->devargs, vf); +if (rc) { +plt_err ("Failed to parse devargs rc=%d" , rc); + goto pmd_destroy; + } + rc =roc_cpt_dev_init (roc_cpt);if (rc) {plt_err ("Failed to initialize roc cpt rc=%d" , rc);
drivers/crypto/cnxk/cn9k_cryptodev.c +7 -0
@@ -68,6 +68,13 @@ cn9k_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { roc_cpt->pci_dev = pci_dev; + + rc =cnxk_cpt_parse_devargs (dev->device->devargs, vf); +if (rc) { +plt_err ("Failed to parse devargs rc=%d" , rc); + goto pmd_destroy; + } + rc =roc_cpt_dev_init (roc_cpt);if (rc) {plt_err ("Failed to initialize roc cpt rc=%d" , rc);
drivers/crypto/cnxk/cnxk_cryptodev.h +2 -0
@@ -25,9 +25,11 @@ struct cnxk_cpt_vf {struct rte_security_capability sec_caps[CNXK_SEC_MAX_CAPS ];uint64_t cnxk_fpm_iova[CNXK_AE_EC_ID_MAX ];struct roc_ae_ec_group *ec_grp[CNXK_AE_EC_ID_MAX ]; + uint16_t max_qps_limit; };uint64_t cnxk_cpt_default_ff_get (void );int cnxk_cpt_eng_grp_add (struct roc_cpt *roc_cpt); +int cnxk_cpt_parse_devargs (struct rte_devargs *devargs,struct cnxk_cpt_vf *vf);#endif /* _CNXK_CRYPTODEV_H_ */
drivers/crypto/cnxk/cnxk_cryptodev_devargs.c new file +61 -0
61 lines not on this page · raw message
drivers/crypto/cnxk/cnxk_cryptodev_ops.c +4 -1
@@ -150,7 +150,10 @@ cnxk_cpt_dev_info_get(struct rte_cryptodev *dev,struct cnxk_cpt_vf *vf = dev->data->dev_private;struct roc_cpt *roc_cpt = &vf->cpt; - info->max_nb_queue_pairs = roc_cpt->nb_lf_avail; + info->max_nb_queue_pairs = +RTE_MIN (roc_cpt->nb_lf_avail, vf->max_qps_limit); +plt_cpt_dbg ("max_nb_queue_pairs %u" , info->max_nb_queue_pairs); + info->feature_flags =cnxk_cpt_default_ff_get (); info->capabilities =cnxk_crypto_capabilities_get (vf); info->sym.max_nb_sessions =0 ;
drivers/crypto/cnxk/meson.build +1 -0
@@ -17,6 +17,7 @@ sources = files( 'cn10k_ipsec.c', 'cnxk_cryptodev.c', 'cnxk_cryptodev_capabilities.c', + 'cnxk_cryptodev_devargs.c', 'cnxk_cryptodev_ops.c', 'cnxk_cryptodev_sec.c', )
Signature · 1 line
2.28.0
Akhil Goyal
AppliedQuoted 8 lines
Adds max queue pairs limit devargs for crypto cnxk driver. This can be used to set a limit on the number of maximum queue pairs supported by the device. The default value is 63.
Signed-off-by Ankur Dwivedi <[email protected]>Reviewed-by Anoob Joseph <[email protected]>Reviewed-by Jerin Jacob Kollanukkaran <[email protected]>---
Applied to dpdk-next-crypto
Thanks.