DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>, Akhil Goyal <gakhil@marvell.com>,
	Chenbo Xia <chenbox@nvidia.com>,
	Fan Zhang <fanzhang.oss@gmail.com>,
	Jay Zhou <jianjay.zhou@huawei.com>
Cc: Jerin Jacob <jerinj@marvell.com>, Anoob Joseph <anoobj@marvell.com>
Subject: RE: [EXTERNAL] Re: [v2 2/2] examples/vhost_crypto: add asymmetric support
Date: Thu, 30 Jan 2025 09:29:09 +0000	[thread overview]
Message-ID: <CO1PR18MB4714D6AC9923CA97E7D68482CBE92@CO1PR18MB4714.namprd18.prod.outlook.com> (raw)
In-Reply-To: <394449d9-3511-436b-a397-ee4608e71317@redhat.com>

Hi Maxime,

> >   static const struct rte_vhost_device_ops virtio_crypto_device_ops = {
> > -	.new_device =  new_device,
> > -	.destroy_device = destroy_device,
> > +	.new_connection =  new_device,
> > +	.destroy_connection = destroy_device,
> It may be worth explaining in the commit message why you are moving from
> new_device to new_connection.

This change is required when this backend application runs in server mode.
I understand this change is irrelevant to the scope of this patch and will be taken out in a separate patch (in the new version of this series).

Thanks,
Gowrishankar
> 
> >   };
> >
> >   static int
> > @@ -376,6 +386,7 @@ vhost_crypto_worker(void *arg)
> >   	int callfds[VIRTIO_CRYPTO_MAX_NUM_BURST_VQS];
> >   	uint32_t lcore_id = rte_lcore_id();
> >   	uint32_t burst_size = MAX_PKT_BURST;
> > +	enum rte_crypto_op_type cop_type;
> >   	uint32_t i, j, k;
> >   	uint32_t to_fetch, fetched;
> >
> > @@ -383,9 +394,13 @@ vhost_crypto_worker(void *arg)
> >
> >   	RTE_LOG(INFO, USER1, "Processing on Core %u started\n", lcore_id);
> >
> > +	cop_type = RTE_CRYPTO_OP_TYPE_SYMMETRIC;
> > +	if (options.asymmetric_crypto)
> > +		cop_type = RTE_CRYPTO_OP_TYPE_ASYMMETRIC;
> > +
> >   	for (i = 0; i < NB_VIRTIO_QUEUES; i++) {
> >   		if (rte_crypto_op_bulk_alloc(info->cop_pool,
> > -				RTE_CRYPTO_OP_TYPE_SYMMETRIC, ops[i],
> > +				cop_type, ops[i],
> >   				burst_size) < burst_size) {
> >   			RTE_LOG(ERR, USER1, "Failed to alloc cops\n");
> >   			ret = -1;
> > @@ -411,12 +426,11 @@ vhost_crypto_worker(void *arg)
> >   						fetched);
> >   				if (unlikely(rte_crypto_op_bulk_alloc(
> >   						info->cop_pool,
> > -
> 	RTE_CRYPTO_OP_TYPE_SYMMETRIC,
> > +						cop_type,
> >   						ops[j], fetched) < fetched)) {
> >   					RTE_LOG(ERR, USER1, "Failed
> realloc\n");
> >   					return -1;
> >   				}
> > -
> >   				fetched = rte_cryptodev_dequeue_burst(
> >   						info->cid, info->qid,
> >   						ops_deq[j],
> RTE_MIN(burst_size, @@ -477,6 +491,7 @@ main(int
> > argc, char *argv[])
> >   	struct rte_cryptodev_qp_conf qp_conf;
> >   	struct rte_cryptodev_config config;
> >   	struct rte_cryptodev_info dev_info;
> > +	enum rte_crypto_op_type cop_type;
> >   	char name[128];
> >   	uint32_t i, j, lcore;
> >   	int ret;
> > @@ -539,12 +554,21 @@ main(int argc, char *argv[])
> >   			goto error_exit;
> >   		}
> >
> > -		snprintf(name, 127, "SESS_POOL_%u", lo->lcore_id);
> > -		info->sess_pool =
> rte_cryptodev_sym_session_pool_create(name,
> > -				SESSION_MAP_ENTRIES,
> > -				rte_cryptodev_sym_get_private_session_size(
> > -				info->cid), 0, 0,
> > -				rte_lcore_to_socket_id(lo->lcore_id));
> > +		if (!options.asymmetric_crypto) {
> > +			snprintf(name, 127, "SYM_SESS_POOL_%u", lo-
> >lcore_id);
> > +			info->sess_pool =
> rte_cryptodev_sym_session_pool_create(name,
> > +					SESSION_MAP_ENTRIES,
> > +
> 	rte_cryptodev_sym_get_private_session_size(
> > +					info->cid), 0, 0,
> > +					rte_lcore_to_socket_id(lo->lcore_id));
> > +			cop_type = RTE_CRYPTO_OP_TYPE_SYMMETRIC;
> > +		} else {
> > +			snprintf(name, 127, "ASYM_SESS_POOL_%u", lo-
> >lcore_id);
> > +			info->sess_pool =
> rte_cryptodev_asym_session_pool_create(name,
> > +					SESSION_MAP_ENTRIES, 0, 64,
> > +					rte_lcore_to_socket_id(lo->lcore_id));
> > +			cop_type = RTE_CRYPTO_OP_TYPE_ASYMMETRIC;
> > +		}
> >
> >   		if (!info->sess_pool) {
> >   			RTE_LOG(ERR, USER1, "Failed to create mempool");
> @@ -553,7 +577,7
> > @@ main(int argc, char *argv[])
> >
> >   		snprintf(name, 127, "COPPOOL_%u", lo->lcore_id);
> >   		info->cop_pool = rte_crypto_op_pool_create(name,
> > -				RTE_CRYPTO_OP_TYPE_SYMMETRIC,
> NB_MEMPOOL_OBJS,
> > +				cop_type, NB_MEMPOOL_OBJS,
> >   				NB_CACHE_OBJS,
> VHOST_CRYPTO_MAX_IV_LEN,
> >   				rte_lcore_to_socket_id(lo->lcore_id));
> >
> > @@ -567,6 +591,8 @@ main(int argc, char *argv[])
> >
> >   		qp_conf.nb_descriptors = NB_CRYPTO_DESCRIPTORS;
> >   		qp_conf.mp_session = info->sess_pool;
> > +		if (options.asymmetric_crypto)
> > +			qp_conf.mp_session = NULL;
> >
> >   		for (j = 0; j < dev_info.max_nb_queue_pairs; j++) {
> >   			ret = rte_cryptodev_queue_pair_setup(info->cid, j,


  reply	other threads:[~2025-01-30  9:29 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-24  7:36 [v1 00/16] crypto/virtio: vDPA and " Gowrishankar Muthukrishnan
2024-12-24  7:36 ` [v1 01/16] vhost: include AKCIPHER algorithms in crypto_config Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 02/16] crypto/virtio: remove redundant crypto queue free Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 03/16] crypto/virtio: add asymmetric RSA support Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 04/16] test/crypto: check for RSA capability Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 05/16] test/crypto: return proper codes in create session Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 06/16] test/crypto: add asymmetric tests for virtio PMD Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 07/16] vhost: add asymmetric RSA support Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 08/16] examples/vhost_crypto: add asymmetric support Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 09/16] crypto/virtio: fix dataqueues iteration Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 10/16] crypto/virtio: refactor queue operations Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 11/16] crypto/virtio: add packed ring support Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 12/16] common/virtio: common virtio log Gowrishankar Muthukrishnan
2024-12-24  8:14   ` David Marchand
2025-01-07 10:57     ` [EXTERNAL] " Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 13/16] common/virtio: move vDPA to common directory Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 14/16] common/virtio: support cryptodev in vdev setup Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 15/16] crypto/virtio: add vhost backend to virtio_user Gowrishankar Muthukrishnan
2024-12-24  7:37 ` [v1 16/16] test/crypto: test virtio_crypto_user PMD Gowrishankar Muthukrishnan
2025-01-07 17:52 ` [v2 0/2] crypto/virtio: add RSA support Gowrishankar Muthukrishnan
2025-01-07 17:52   ` [v2 1/2] crypto/virtio: add asymmetric " Gowrishankar Muthukrishnan
2025-01-07 17:52   ` [v2 2/2] test/crypto: add asymmetric tests for virtio PMD Gowrishankar Muthukrishnan
2025-01-07 18:02 ` [v2 0/2] vhost: add RSA support Gowrishankar Muthukrishnan
2025-01-07 18:02   ` [v2 1/2] vhost: add asymmetric " Gowrishankar Muthukrishnan
2025-01-29 16:07     ` Maxime Coquelin
2025-01-07 18:02   ` [v2 2/2] examples/vhost_crypto: add asymmetric support Gowrishankar Muthukrishnan
2025-01-29 16:13     ` Maxime Coquelin
2025-01-30  9:29       ` Gowrishankar Muthukrishnan [this message]
2025-01-07 18:08 ` [v2 0/2] crypto/virtio: add packed ring support Gowrishankar Muthukrishnan
2025-01-07 18:08   ` [v2 1/2] crypto/virtio: refactor queue operations Gowrishankar Muthukrishnan
2025-01-07 18:08   ` [v2 2/2] crypto/virtio: add packed ring support Gowrishankar Muthukrishnan
2025-01-07 18:44 ` [v2 0/4] crypto/virtio: add vDPA backend support Gowrishankar Muthukrishnan
2025-01-07 18:44   ` [v2 1/4] common/virtio: move vDPA to common directory Gowrishankar Muthukrishnan
2025-01-07 18:44   ` [v2 2/4] common/virtio: support cryptodev in vdev setup Gowrishankar Muthukrishnan
2025-01-07 18:44   ` [v2 3/4] crypto/virtio: add vhost backend to virtio_user Gowrishankar Muthukrishnan
2025-01-07 18:44   ` [v2 4/4] test/crypto: test virtio_crypto_user PMD Gowrishankar Muthukrishnan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO1PR18MB4714D6AC9923CA97E7D68482CBE92@CO1PR18MB4714.namprd18.prod.outlook.com \
    --to=gmuthukrishn@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=fanzhang.oss@gmail.com \
    --cc=gakhil@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=jianjay.zhou@huawei.com \
    --cc=maxime.coquelin@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).