4 * Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
16 * * Neither the name of Intel Corporation nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #include <rte_common.h>
34 #include <rte_hexdump.h>
35 #include <rte_cryptodev.h>
36 #include <rte_cryptodev_pmd.h>
38 #include <rte_malloc.h>
39 #include <rte_cpuflags.h>
41 #include "rte_aesni_mb_pmd_private.h"
43 typedef void (*hash_one_block_t)(void *data, void *digest);
44 typedef void (*aes_keyexp_t)(void *key, void *enc_exp_keys, void *dec_exp_keys);
47 * Calculate the authentication pre-computes
49 * @param one_block_hash Function pointer to calculate digest on ipad/opad
50 * @param ipad Inner pad output byte array
51 * @param opad Outer pad output byte array
52 * @param hkey Authentication key
53 * @param hkey_len Authentication key length
54 * @param blocksize Block size of selected hash algo
57 calculate_auth_precomputes(hash_one_block_t one_block_hash,
58 uint8_t *ipad, uint8_t *opad,
59 uint8_t *hkey, uint16_t hkey_len,
64 uint8_t ipad_buf[blocksize] __rte_aligned(16);
65 uint8_t opad_buf[blocksize] __rte_aligned(16);
67 /* Setup inner and outer pads */
68 memset(ipad_buf, HMAC_IPAD_VALUE, blocksize);
69 memset(opad_buf, HMAC_OPAD_VALUE, blocksize);
71 /* XOR hash key with inner and outer pads */
72 length = hkey_len > blocksize ? blocksize : hkey_len;
74 for (i = 0; i < length; i++) {
75 ipad_buf[i] ^= hkey[i];
76 opad_buf[i] ^= hkey[i];
79 /* Compute partial hashes */
80 (*one_block_hash)(ipad_buf, ipad);
81 (*one_block_hash)(opad_buf, opad);
84 memset(ipad_buf, 0, blocksize);
85 memset(opad_buf, 0, blocksize);
88 /** Get xform chain order */
89 static enum aesni_mb_operation
90 aesni_mb_get_chain_order(const struct rte_crypto_sym_xform *xform)
93 return AESNI_MB_OP_NOT_SUPPORTED;
95 if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) {
96 if (xform->next == NULL)
97 return AESNI_MB_OP_CIPHER_ONLY;
98 if (xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH)
99 return AESNI_MB_OP_CIPHER_HASH;
102 if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) {
103 if (xform->next == NULL)
104 return AESNI_MB_OP_HASH_ONLY;
105 if (xform->next->type == RTE_CRYPTO_SYM_XFORM_CIPHER)
106 return AESNI_MB_OP_HASH_CIPHER;
109 return AESNI_MB_OP_NOT_SUPPORTED;
112 /** Set session authentication parameters */
114 aesni_mb_set_session_auth_parameters(const struct aesni_mb_ops *mb_ops,
115 struct aesni_mb_session *sess,
116 const struct rte_crypto_sym_xform *xform)
118 hash_one_block_t hash_oneblock_fn;
121 sess->auth.algo = NULL_HASH;
125 if (xform->type != RTE_CRYPTO_SYM_XFORM_AUTH) {
126 MB_LOG_ERR("Crypto xform struct not of type auth");
130 /* Select auth generate/verify */
131 sess->auth.operation = xform->auth.op;
133 /* Set Authentication Parameters */
134 if (xform->auth.algo == RTE_CRYPTO_AUTH_AES_XCBC_MAC) {
135 sess->auth.algo = AES_XCBC;
136 (*mb_ops->aux.keyexp.aes_xcbc)(xform->auth.key.data,
137 sess->auth.xcbc.k1_expanded,
138 sess->auth.xcbc.k2, sess->auth.xcbc.k3);
142 switch (xform->auth.algo) {
143 case RTE_CRYPTO_AUTH_MD5_HMAC:
144 sess->auth.algo = MD5;
145 hash_oneblock_fn = mb_ops->aux.one_block.md5;
147 case RTE_CRYPTO_AUTH_SHA1_HMAC:
148 sess->auth.algo = SHA1;
149 hash_oneblock_fn = mb_ops->aux.one_block.sha1;
151 case RTE_CRYPTO_AUTH_SHA224_HMAC:
152 sess->auth.algo = SHA_224;
153 hash_oneblock_fn = mb_ops->aux.one_block.sha224;
155 case RTE_CRYPTO_AUTH_SHA256_HMAC:
156 sess->auth.algo = SHA_256;
157 hash_oneblock_fn = mb_ops->aux.one_block.sha256;
159 case RTE_CRYPTO_AUTH_SHA384_HMAC:
160 sess->auth.algo = SHA_384;
161 hash_oneblock_fn = mb_ops->aux.one_block.sha384;
163 case RTE_CRYPTO_AUTH_SHA512_HMAC:
164 sess->auth.algo = SHA_512;
165 hash_oneblock_fn = mb_ops->aux.one_block.sha512;
168 MB_LOG_ERR("Unsupported authentication algorithm selection");
172 /* Calculate Authentication precomputes */
173 calculate_auth_precomputes(hash_oneblock_fn,
174 sess->auth.pads.inner, sess->auth.pads.outer,
175 xform->auth.key.data,
176 xform->auth.key.length,
177 get_auth_algo_blocksize(sess->auth.algo));
182 /** Set session cipher parameters */
184 aesni_mb_set_session_cipher_parameters(const struct aesni_mb_ops *mb_ops,
185 struct aesni_mb_session *sess,
186 const struct rte_crypto_sym_xform *xform)
188 aes_keyexp_t aes_keyexp_fn;
191 sess->cipher.mode = NULL_CIPHER;
195 if (xform->type != RTE_CRYPTO_SYM_XFORM_CIPHER) {
196 MB_LOG_ERR("Crypto xform struct not of type cipher");
200 /* Select cipher direction */
201 switch (xform->cipher.op) {
202 case RTE_CRYPTO_CIPHER_OP_ENCRYPT:
203 sess->cipher.direction = ENCRYPT;
205 case RTE_CRYPTO_CIPHER_OP_DECRYPT:
206 sess->cipher.direction = DECRYPT;
209 MB_LOG_ERR("Unsupported cipher operation parameter");
213 /* Select cipher mode */
214 switch (xform->cipher.algo) {
215 case RTE_CRYPTO_CIPHER_AES_CBC:
216 sess->cipher.mode = CBC;
218 case RTE_CRYPTO_CIPHER_AES_CTR:
219 sess->cipher.mode = CNTR;
222 MB_LOG_ERR("Unsupported cipher mode parameter");
226 /* Check key length and choose key expansion function */
227 switch (xform->cipher.key.length) {
229 sess->cipher.key_length_in_bytes = AES_128_BYTES;
230 aes_keyexp_fn = mb_ops->aux.keyexp.aes128;
233 sess->cipher.key_length_in_bytes = AES_192_BYTES;
234 aes_keyexp_fn = mb_ops->aux.keyexp.aes192;
237 sess->cipher.key_length_in_bytes = AES_256_BYTES;
238 aes_keyexp_fn = mb_ops->aux.keyexp.aes256;
241 MB_LOG_ERR("Unsupported cipher key length");
245 /* Expanded cipher keys */
246 (*aes_keyexp_fn)(xform->cipher.key.data,
247 sess->cipher.expanded_aes_keys.encode,
248 sess->cipher.expanded_aes_keys.decode);
253 /** Parse crypto xform chain and set private session parameters */
255 aesni_mb_set_session_parameters(const struct aesni_mb_ops *mb_ops,
256 struct aesni_mb_session *sess,
257 const struct rte_crypto_sym_xform *xform)
259 const struct rte_crypto_sym_xform *auth_xform = NULL;
260 const struct rte_crypto_sym_xform *cipher_xform = NULL;
262 /* Select Crypto operation - hash then cipher / cipher then hash */
263 switch (aesni_mb_get_chain_order(xform)) {
264 case AESNI_MB_OP_HASH_CIPHER:
265 sess->chain_order = HASH_CIPHER;
267 cipher_xform = xform->next;
269 case AESNI_MB_OP_CIPHER_HASH:
270 sess->chain_order = CIPHER_HASH;
271 auth_xform = xform->next;
272 cipher_xform = xform;
274 case AESNI_MB_OP_HASH_ONLY:
275 sess->chain_order = HASH_CIPHER;
279 case AESNI_MB_OP_CIPHER_ONLY:
281 * Multi buffer library operates only at two modes,
282 * CIPHER_HASH and HASH_CIPHER. When doing ciphering only,
283 * chain order depends on cipher operation: encryption is always
284 * the first operation and decryption the last one.
286 if (xform->cipher.op == RTE_CRYPTO_CIPHER_OP_ENCRYPT)
287 sess->chain_order = CIPHER_HASH;
289 sess->chain_order = HASH_CIPHER;
291 cipher_xform = xform;
293 case AESNI_MB_OP_NOT_SUPPORTED:
295 MB_LOG_ERR("Unsupported operation chain order parameter");
299 if (aesni_mb_set_session_auth_parameters(mb_ops, sess, auth_xform)) {
300 MB_LOG_ERR("Invalid/unsupported authentication parameters");
304 if (aesni_mb_set_session_cipher_parameters(mb_ops, sess,
306 MB_LOG_ERR("Invalid/unsupported cipher parameters");
312 /** Get multi buffer session */
313 static struct aesni_mb_session *
314 get_session(struct aesni_mb_qp *qp, struct rte_crypto_op *op)
316 struct aesni_mb_session *sess = NULL;
318 if (op->sym->sess_type == RTE_CRYPTO_SYM_OP_WITH_SESSION) {
319 if (unlikely(op->sym->session->dev_type !=
320 RTE_CRYPTODEV_AESNI_MB_PMD))
323 sess = (struct aesni_mb_session *)op->sym->session->_private;
327 if (rte_mempool_get(qp->sess_mp, (void **)&_sess))
330 sess = (struct aesni_mb_session *)
331 ((struct rte_cryptodev_sym_session *)_sess)->_private;
333 if (unlikely(aesni_mb_set_session_parameters(qp->ops,
334 sess, op->sym->xform) != 0)) {
335 rte_mempool_put(qp->sess_mp, _sess);
338 op->sym->session = (struct rte_cryptodev_sym_session *)_sess;
345 * Process a crypto operation and complete a JOB_AES_HMAC job structure for
346 * submission to the multi buffer library for processing.
348 * @param qp queue pair
349 * @param job JOB_AES_HMAC structure to fill
350 * @param m mbuf to process
353 * - Completed JOB_AES_HMAC structure pointer on success
354 * - NULL pointer if completion of JOB_AES_HMAC structure isn't possible
356 static JOB_AES_HMAC *
357 process_crypto_op(struct aesni_mb_qp *qp, struct rte_crypto_op *op,
358 struct aesni_mb_session *session)
362 struct rte_mbuf *m_src = op->sym->m_src, *m_dst;
363 uint16_t m_offset = 0;
365 job = (*qp->ops->job.get_next)(&qp->mb_mgr);
366 if (unlikely(job == NULL))
369 /* Set crypto operation */
370 job->chain_order = session->chain_order;
372 /* Set cipher parameters */
373 job->cipher_direction = session->cipher.direction;
374 job->cipher_mode = session->cipher.mode;
376 job->aes_key_len_in_bytes = session->cipher.key_length_in_bytes;
377 job->aes_enc_key_expanded = session->cipher.expanded_aes_keys.encode;
378 job->aes_dec_key_expanded = session->cipher.expanded_aes_keys.decode;
381 /* Set authentication parameters */
382 job->hash_alg = session->auth.algo;
383 if (job->hash_alg == AES_XCBC) {
384 job->_k1_expanded = session->auth.xcbc.k1_expanded;
385 job->_k2 = session->auth.xcbc.k2;
386 job->_k3 = session->auth.xcbc.k3;
388 job->hashed_auth_key_xor_ipad = session->auth.pads.inner;
389 job->hashed_auth_key_xor_opad = session->auth.pads.outer;
392 /* Mutable crypto operation parameters */
393 if (op->sym->m_dst) {
394 m_src = m_dst = op->sym->m_dst;
396 /* append space for output data to mbuf */
397 char *odata = rte_pktmbuf_append(m_dst,
398 rte_pktmbuf_data_len(op->sym->m_src));
400 MB_LOG_ERR("failed to allocate space in destination "
401 "mbuf for source data");
405 memcpy(odata, rte_pktmbuf_mtod(op->sym->m_src, void*),
406 rte_pktmbuf_data_len(op->sym->m_src));
409 m_offset = op->sym->cipher.data.offset;
412 /* Set digest output location */
413 if (job->hash_alg != NULL_HASH &&
414 session->auth.operation == RTE_CRYPTO_AUTH_OP_VERIFY) {
415 job->auth_tag_output = (uint8_t *)rte_pktmbuf_append(m_dst,
416 get_digest_byte_length(job->hash_alg));
418 if (job->auth_tag_output == NULL) {
419 MB_LOG_ERR("failed to allocate space in output mbuf "
424 memset(job->auth_tag_output, 0,
425 sizeof(get_digest_byte_length(job->hash_alg)));
428 job->auth_tag_output = op->sym->auth.digest.data;
432 * Multi-buffer library current only support returning a truncated
433 * digest length as specified in the relevant IPsec RFCs
435 job->auth_tag_output_len_in_bytes =
436 get_truncated_digest_byte_length(job->hash_alg);
438 /* Set IV parameters */
439 job->iv = op->sym->cipher.iv.data;
440 job->iv_len_in_bytes = op->sym->cipher.iv.length;
443 job->src = rte_pktmbuf_mtod(m_src, uint8_t *);
444 job->dst = rte_pktmbuf_mtod_offset(m_dst, uint8_t *, m_offset);
446 job->cipher_start_src_offset_in_bytes = op->sym->cipher.data.offset;
447 job->msg_len_to_cipher_in_bytes = op->sym->cipher.data.length;
449 job->hash_start_src_offset_in_bytes = op->sym->auth.data.offset;
450 job->msg_len_to_hash_in_bytes = op->sym->auth.data.length;
452 /* Set user data to be crypto operation data struct */
454 job->user_data2 = m_dst;
460 * Process a completed job and return rte_mbuf which job processed
462 * @param job JOB_AES_HMAC job to process
465 * - Returns processed mbuf which is trimmed of output digest used in
466 * verification of supplied digest in the case of a HASH_CIPHER operation
467 * - Returns NULL on invalid job
469 static struct rte_crypto_op *
470 post_process_mb_job(struct aesni_mb_qp *qp, JOB_AES_HMAC *job)
472 struct rte_crypto_op *op =
473 (struct rte_crypto_op *)job->user_data;
474 struct rte_mbuf *m_dst =
475 (struct rte_mbuf *)job->user_data2;
476 struct aesni_mb_session *sess;
478 if (op == NULL || m_dst == NULL)
481 /* set status as successful by default */
482 op->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
484 /* check if job has been processed */
485 if (unlikely(job->status != STS_COMPLETED)) {
486 op->status = RTE_CRYPTO_OP_STATUS_ERROR;
488 } else if (job->hash_alg != NULL_HASH) {
489 sess = (struct aesni_mb_session *)op->sym->session->_private;
490 if (sess->auth.operation == RTE_CRYPTO_AUTH_OP_VERIFY) {
491 /* Verify digest if required */
492 if (memcmp(job->auth_tag_output,
493 op->sym->auth.digest.data,
494 job->auth_tag_output_len_in_bytes) != 0)
495 op->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
497 /* trim area used for digest from mbuf */
498 rte_pktmbuf_trim(m_dst,
499 get_digest_byte_length(job->hash_alg));
503 /* Free session if a session-less crypto op */
504 if (op->sym->sess_type == RTE_CRYPTO_SYM_OP_SESSIONLESS) {
505 rte_mempool_put(qp->sess_mp, op->sym->session);
506 op->sym->session = NULL;
513 * Process a completed JOB_AES_HMAC job and keep processing jobs until
514 * get_completed_job return NULL
516 * @param qp Queue Pair to process
517 * @param job JOB_AES_HMAC job
520 * - Number of processed jobs
523 handle_completed_jobs(struct aesni_mb_qp *qp, JOB_AES_HMAC *job)
525 struct rte_crypto_op *op = NULL;
526 unsigned processed_jobs = 0;
530 op = post_process_mb_job(qp, job);
532 rte_ring_enqueue(qp->processed_ops, (void *)op);
534 qp->stats.dequeue_err_count++;
535 job = (*qp->ops->job.get_completed_job)(&qp->mb_mgr);
538 return processed_jobs;
542 aesni_mb_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
545 struct aesni_mb_session *sess;
546 struct aesni_mb_qp *qp = queue_pair;
548 JOB_AES_HMAC *job = NULL;
550 int i, processed_jobs = 0;
552 for (i = 0; i < nb_ops; i++) {
553 #ifdef RTE_LIBRTE_PMD_AESNI_MB_DEBUG
554 if (unlikely(ops[i]->type != RTE_CRYPTO_OP_TYPE_SYMMETRIC)) {
555 MB_LOG_ERR("PMD only supports symmetric crypto "
556 "operation requests, op (%p) is not a "
557 "symmetric operation.", ops[i]);
558 qp->stats.enqueue_err_count++;
562 if (!rte_pktmbuf_is_contiguous(ops[i]->sym->m_src) ||
563 (ops[i]->sym->m_dst != NULL &&
564 !rte_pktmbuf_is_contiguous(
565 ops[i]->sym->m_dst))) {
566 MB_LOG_ERR("PMD supports only contiguous mbufs, "
567 "op (%p) provides noncontiguous mbuf as "
568 "source/destination buffer.\n", ops[i]);
569 ops[i]->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
570 qp->stats.enqueue_err_count++;
575 sess = get_session(qp, ops[i]);
576 if (unlikely(sess == NULL)) {
577 qp->stats.enqueue_err_count++;
581 job = process_crypto_op(qp, ops[i], sess);
582 if (unlikely(job == NULL)) {
583 qp->stats.enqueue_err_count++;
588 job = (*qp->ops->job.submit)(&qp->mb_mgr);
591 * If submit returns a processed job then handle it,
592 * before submitting subsequent jobs
595 processed_jobs += handle_completed_jobs(qp, job);
598 if (processed_jobs == 0)
601 qp->stats.enqueued_count += processed_jobs;
606 * If we haven't processed any jobs in submit loop, then flush jobs
607 * queue to stop the output stalling
609 job = (*qp->ops->job.flush_job)(&qp->mb_mgr);
611 qp->stats.enqueued_count += handle_completed_jobs(qp, job);
617 aesni_mb_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
620 struct aesni_mb_qp *qp = queue_pair;
622 unsigned nb_dequeued;
624 nb_dequeued = rte_ring_dequeue_burst(qp->processed_ops,
625 (void **)ops, nb_ops);
626 qp->stats.dequeued_count += nb_dequeued;
632 static int cryptodev_aesni_mb_remove(const char *name);
635 cryptodev_aesni_mb_create(struct rte_crypto_vdev_init_params *init_params)
637 struct rte_cryptodev *dev;
638 struct aesni_mb_private *internals;
639 enum aesni_mb_vector_mode vector_mode;
641 if (init_params->name[0] == '\0') {
642 int ret = rte_cryptodev_pmd_create_dev_name(
644 RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
647 MB_LOG_ERR("failed to create unique name");
652 /* Check CPU for supported vector instruction set */
653 if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F))
654 vector_mode = RTE_AESNI_MB_AVX512;
655 else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2))
656 vector_mode = RTE_AESNI_MB_AVX2;
657 else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX))
658 vector_mode = RTE_AESNI_MB_AVX;
659 else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1))
660 vector_mode = RTE_AESNI_MB_SSE;
662 MB_LOG_ERR("Vector instructions are not supported by CPU");
666 dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name,
667 sizeof(struct aesni_mb_private), init_params->socket_id);
669 MB_LOG_ERR("failed to create cryptodev vdev");
673 dev->dev_type = RTE_CRYPTODEV_AESNI_MB_PMD;
674 dev->dev_ops = rte_aesni_mb_pmd_ops;
676 /* register rx/tx burst functions for data path */
677 dev->dequeue_burst = aesni_mb_pmd_dequeue_burst;
678 dev->enqueue_burst = aesni_mb_pmd_enqueue_burst;
680 dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
681 RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
682 RTE_CRYPTODEV_FF_CPU_AESNI;
684 switch (vector_mode) {
685 case RTE_AESNI_MB_SSE:
686 dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_SSE;
688 case RTE_AESNI_MB_AVX:
689 dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX;
691 case RTE_AESNI_MB_AVX2:
692 dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX2;
694 case RTE_AESNI_MB_AVX512:
695 dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AVX512;
701 /* Set vector instructions mode supported */
702 internals = dev->data->dev_private;
704 internals->vector_mode = vector_mode;
705 internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;
706 internals->max_nb_sessions = init_params->max_nb_sessions;
710 MB_LOG_ERR("driver %s: cryptodev_aesni_create failed",
713 cryptodev_aesni_mb_remove(init_params->name);
719 cryptodev_aesni_mb_probe(const char *name,
720 const char *input_args)
722 struct rte_crypto_vdev_init_params init_params = {
723 RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS,
724 RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS,
729 rte_cryptodev_parse_vdev_init_params(&init_params, input_args);
731 RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
732 init_params.socket_id);
733 if (init_params.name[0] != '\0')
734 RTE_LOG(INFO, PMD, " User defined name = %s\n",
736 RTE_LOG(INFO, PMD, " Max number of queue pairs = %d\n",
737 init_params.max_nb_queue_pairs);
738 RTE_LOG(INFO, PMD, " Max number of sessions = %d\n",
739 init_params.max_nb_sessions);
741 return cryptodev_aesni_mb_create(&init_params);
745 cryptodev_aesni_mb_remove(const char *name)
750 RTE_LOG(INFO, PMD, "Closing AESNI crypto device %s on numa socket %u\n",
751 name, rte_socket_id());
756 static struct rte_vdev_driver cryptodev_aesni_mb_pmd_drv = {
757 .probe = cryptodev_aesni_mb_probe,
758 .remove = cryptodev_aesni_mb_remove
761 RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_MB_PMD, cryptodev_aesni_mb_pmd_drv);
762 RTE_PMD_REGISTER_ALIAS(CRYPTODEV_NAME_AESNI_MB_PMD, cryptodev_aesni_mb_pmd);
763 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_MB_PMD,
764 "max_nb_queue_pairs=<int> "
765 "max_nb_sessions=<int> "