cryptodev: add auth IV
[dpdk.git] / drivers / crypto / openssl / rte_openssl_pmd_ops.c
1 /*-
2  *   BSD LICENSE
3  *
4  *   Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
5  *
6  *   Redistribution and use in source and binary forms, with or without
7  *   modification, are permitted provided that the following conditions
8  *   are met:
9  *
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
15  *       distribution.
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.
19  *
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.
31  */
32
33 #include <string.h>
34
35 #include <rte_common.h>
36 #include <rte_malloc.h>
37 #include <rte_cryptodev_pmd.h>
38
39 #include "rte_openssl_pmd_private.h"
40
41
42 static const struct rte_cryptodev_capabilities openssl_pmd_capabilities[] = {
43         {       /* MD5 HMAC */
44                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
45                 {.sym = {
46                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
47                         {.auth = {
48                                 .algo = RTE_CRYPTO_AUTH_MD5_HMAC,
49                                 .block_size = 64,
50                                 .key_size = {
51                                         .min = 64,
52                                         .max = 64,
53                                         .increment = 0
54                                 },
55                                 .digest_size = {
56                                         .min = 16,
57                                         .max = 16,
58                                         .increment = 0
59                                 },
60                                 .aad_size = { 0 },
61                                 .iv_size = { 0 }
62                         }, }
63                 }, }
64         },
65         {       /* MD5 */
66                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
67                 {.sym = {
68                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
69                         {.auth = {
70                                 .algo = RTE_CRYPTO_AUTH_MD5,
71                                 .block_size = 64,
72                                 .key_size = {
73                                         .min = 0,
74                                         .max = 0,
75                                         .increment = 0
76                                 },
77                                 .digest_size = {
78                                         .min = 16,
79                                         .max = 16,
80                                         .increment = 0
81                                 },
82                                 .aad_size = { 0 },
83                                 .iv_size = { 0 }
84                         }, }
85                 }, }
86         },
87         {       /* SHA1 HMAC */
88                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
89                 {.sym = {
90                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
91                         {.auth = {
92                                 .algo = RTE_CRYPTO_AUTH_SHA1_HMAC,
93                                 .block_size = 64,
94                                 .key_size = {
95                                         .min = 64,
96                                         .max = 64,
97                                         .increment = 0
98                                 },
99                                 .digest_size = {
100                                         .min = 20,
101                                         .max = 20,
102                                         .increment = 0
103                                 },
104                                 .aad_size = { 0 },
105                                 .iv_size = { 0 }
106                         }, }
107                 }, }
108         },
109         {       /* SHA1 */
110                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
111                 {.sym = {
112                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
113                         {.auth = {
114                                 .algo = RTE_CRYPTO_AUTH_SHA1,
115                                 .block_size = 64,
116                                 .key_size = {
117                                         .min = 0,
118                                         .max = 0,
119                                         .increment = 0
120                                 },
121                                 .digest_size = {
122                                         .min = 20,
123                                         .max = 20,
124                                         .increment = 0
125                                 },
126                                 .aad_size = { 0 },
127                                 .iv_size = { 0 }
128                         }, }
129                 }, }
130         },
131         {       /* SHA224 HMAC */
132                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
133                 {.sym = {
134                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
135                         {.auth = {
136                                 .algo = RTE_CRYPTO_AUTH_SHA224_HMAC,
137                                 .block_size = 64,
138                                 .key_size = {
139                                         .min = 64,
140                                         .max = 64,
141                                         .increment = 0
142                                 },
143                                 .digest_size = {
144                                         .min = 28,
145                                         .max = 28,
146                                         .increment = 0
147                                 },
148                                 .aad_size = { 0 },
149                                 .iv_size = { 0 }
150                         }, }
151                 }, }
152         },
153         {       /* SHA224 */
154                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
155                 {.sym = {
156                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
157                         {.auth = {
158                                 .algo = RTE_CRYPTO_AUTH_SHA224,
159                                 .block_size = 64,
160                                 .key_size = {
161                                         .min = 0,
162                                         .max = 0,
163                                         .increment = 0
164                                 },
165                                 .digest_size = {
166                                         .min = 28,
167                                         .max = 28,
168                                         .increment = 0
169                                 },
170                                 .aad_size = { 0 },
171                                 .iv_size = { 0 }
172                         }, }
173                 }, }
174         },
175         {       /* SHA256 HMAC */
176                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
177                 {.sym = {
178                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
179                         {.auth = {
180                                 .algo = RTE_CRYPTO_AUTH_SHA256_HMAC,
181                                 .block_size = 64,
182                                 .key_size = {
183                                         .min = 64,
184                                         .max = 64,
185                                         .increment = 0
186                                 },
187                                 .digest_size = {
188                                         .min = 32,
189                                         .max = 32,
190                                         .increment = 0
191                                 },
192                                 .aad_size = { 0 },
193                                 .iv_size = { 0 }
194                         }, }
195                 }, }
196         },
197         {       /* SHA256 */
198                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
199                 {.sym = {
200                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
201                         {.auth = {
202                                 .algo = RTE_CRYPTO_AUTH_SHA256,
203                                 .block_size = 64,
204                                 .key_size = {
205                                         .min = 0,
206                                         .max = 0,
207                                         .increment = 0
208                                 },
209                                 .digest_size = {
210                                         .min = 32,
211                                         .max = 32,
212                                         .increment = 0
213                                 },
214                                 .aad_size = { 0 },
215                                 .iv_size = { 0 }
216                         }, }
217                 }, }
218         },
219         {       /* SHA384 HMAC */
220                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
221                 {.sym = {
222                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
223                         {.auth = {
224                                 .algo = RTE_CRYPTO_AUTH_SHA384_HMAC,
225                                 .block_size = 128,
226                                 .key_size = {
227                                         .min = 128,
228                                         .max = 128,
229                                         .increment = 0
230                                 },
231                                 .digest_size = {
232                                         .min = 48,
233                                         .max = 48,
234                                         .increment = 0
235                                 },
236                                 .aad_size = { 0 },
237                                 .iv_size = { 0 }
238                         }, }
239                 }, }
240         },
241         {       /* SHA384 */
242                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
243                 {.sym = {
244                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
245                         {.auth = {
246                                 .algo = RTE_CRYPTO_AUTH_SHA384,
247                                 .block_size = 128,
248                                 .key_size = {
249                                         .min = 0,
250                                         .max = 0,
251                                         .increment = 0
252                                 },
253                                 .digest_size = {
254                                         .min = 48,
255                                         .max = 48,
256                                         .increment = 0
257                                 },
258                                 .aad_size = { 0 },
259                                 .iv_size = { 0 }
260                         }, }
261                 }, }
262         },
263         {       /* SHA512 HMAC */
264                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
265                 {.sym = {
266                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
267                         {.auth = {
268                                 .algo = RTE_CRYPTO_AUTH_SHA512_HMAC,
269                                 .block_size = 128,
270                                 .key_size = {
271                                         .min = 128,
272                                         .max = 128,
273                                         .increment = 0
274                                 },
275                                 .digest_size = {
276                                         .min = 64,
277                                         .max = 64,
278                                         .increment = 0
279                                 },
280                                 .aad_size = { 0 },
281                                 .iv_size = { 0 }
282                         }, }
283                 }, }
284         },
285         {       /* SHA512  */
286                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
287                 {.sym = {
288                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
289                         {.auth = {
290                                 .algo = RTE_CRYPTO_AUTH_SHA512,
291                                 .block_size = 128,
292                                 .key_size = {
293                                         .min = 0,
294                                         .max = 0,
295                                         .increment = 0
296                                 },
297                                 .digest_size = {
298                                         .min = 64,
299                                         .max = 64,
300                                         .increment = 0
301                                 },
302                                 .aad_size = { 0 },
303                                 .iv_size = { 0 }
304                         }, }
305                 }, }
306         },
307         {       /* AES CBC */
308                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
309                 {.sym = {
310                         .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
311                         {.cipher = {
312                                 .algo = RTE_CRYPTO_CIPHER_AES_CBC,
313                                 .block_size = 16,
314                                 .key_size = {
315                                         .min = 16,
316                                         .max = 32,
317                                         .increment = 8
318                                 },
319                                 .iv_size = {
320                                         .min = 16,
321                                         .max = 16,
322                                         .increment = 0
323                                 }
324                         }, }
325                 }, }
326         },
327         {       /* AES CTR */
328                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
329                 {.sym = {
330                         .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
331                         {.cipher = {
332                                 .algo = RTE_CRYPTO_CIPHER_AES_CTR,
333                                 .block_size = 16,
334                                 .key_size = {
335                                         .min = 16,
336                                         .max = 32,
337                                         .increment = 8
338                                 },
339                                 .iv_size = {
340                                         .min = 16,
341                                         .max = 16,
342                                         .increment = 0
343                                 }
344                         }, }
345                 }, }
346         },
347         {       /* AES GCM (AUTH) */
348                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
349                 {.sym = {
350                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
351                         {.auth = {
352                                 .algo = RTE_CRYPTO_AUTH_AES_GCM,
353                                 .block_size = 16,
354                                 .key_size = {
355                                         .min = 16,
356                                         .max = 32,
357                                         .increment = 8
358                                 },
359                                 .digest_size = {
360                                         .min = 16,
361                                         .max = 16,
362                                         .increment = 0
363                                 },
364                                 .aad_size = {
365                                         .min = 0,
366                                         .max = 65535,
367                                         .increment = 1
368                                 },
369                                 .iv_size = { 0 }
370                         }, }
371                 }, }
372         },
373         {       /* AES GCM (CIPHER) */
374                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
375                 {.sym = {
376                         .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
377                         {.cipher = {
378                                 .algo = RTE_CRYPTO_CIPHER_AES_GCM,
379                                 .block_size = 16,
380                                 .key_size = {
381                                         .min = 16,
382                                         .max = 32,
383                                         .increment = 8
384                                 },
385                                 .iv_size = {
386                                         .min = 12,
387                                         .max = 16,
388                                         .increment = 4
389                                 }
390                         }, }
391                 }, }
392         },
393         {       /* AES GMAC (AUTH) */
394                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
395                 {.sym = {
396                         .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH,
397                         {.auth = {
398                                 .algo = RTE_CRYPTO_AUTH_AES_GMAC,
399                                 .block_size = 16,
400                                 .key_size = {
401                                         .min = 16,
402                                         .max = 32,
403                                         .increment = 8
404                                 },
405                                 .digest_size = {
406                                         .min = 16,
407                                         .max = 16,
408                                         .increment = 0
409                                 },
410                                 .aad_size = {
411                                         .min = 8,
412                                         .max = 65532,
413                                         .increment = 4
414                                 },
415                                 .iv_size = { 0 }
416                         }, }
417                 }, }
418         },
419         {       /* 3DES CBC */
420                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
421                 {.sym = {
422                         .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
423                         {.cipher = {
424                                 .algo = RTE_CRYPTO_CIPHER_3DES_CBC,
425                                 .block_size = 8,
426                                 .key_size = {
427                                         .min = 16,
428                                         .max = 24,
429                                         .increment = 8
430                                 },
431                                 .iv_size = {
432                                         .min = 8,
433                                         .max = 8,
434                                         .increment = 0
435                                 }
436                         }, }
437                 }, }
438         },
439         {       /* 3DES CTR */
440                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
441                 {.sym = {
442                         .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
443                         {.cipher = {
444                                 .algo = RTE_CRYPTO_CIPHER_3DES_CTR,
445                                 .block_size = 8,
446                                 .key_size = {
447                                         .min = 16,
448                                         .max = 24,
449                                         .increment = 8
450                                 },
451                                 .iv_size = {
452                                         .min = 8,
453                                         .max = 8,
454                                         .increment = 0
455                                 }
456                         }, }
457                 }, }
458         },
459         {       /* DES DOCSIS BPI */
460                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
461                 {.sym = {
462                         .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
463                         {.cipher = {
464                                 .algo = RTE_CRYPTO_CIPHER_DES_DOCSISBPI,
465                                 .block_size = 8,
466                                 .key_size = {
467                                         .min = 8,
468                                         .max = 8,
469                                         .increment = 0
470                                 },
471                                 .iv_size = {
472                                         .min = 8,
473                                         .max = 8,
474                                         .increment = 0
475                                 }
476                         }, }
477                 }, }
478         },
479
480         RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
481 };
482
483
484 /** Configure device */
485 static int
486 openssl_pmd_config(__rte_unused struct rte_cryptodev *dev,
487                 __rte_unused struct rte_cryptodev_config *config)
488 {
489         return 0;
490 }
491
492 /** Start device */
493 static int
494 openssl_pmd_start(__rte_unused struct rte_cryptodev *dev)
495 {
496         return 0;
497 }
498
499 /** Stop device */
500 static void
501 openssl_pmd_stop(__rte_unused struct rte_cryptodev *dev)
502 {
503 }
504
505 /** Close device */
506 static int
507 openssl_pmd_close(__rte_unused struct rte_cryptodev *dev)
508 {
509         return 0;
510 }
511
512
513 /** Get device statistics */
514 static void
515 openssl_pmd_stats_get(struct rte_cryptodev *dev,
516                 struct rte_cryptodev_stats *stats)
517 {
518         int qp_id;
519
520         for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
521                 struct openssl_qp *qp = dev->data->queue_pairs[qp_id];
522
523                 stats->enqueued_count += qp->stats.enqueued_count;
524                 stats->dequeued_count += qp->stats.dequeued_count;
525
526                 stats->enqueue_err_count += qp->stats.enqueue_err_count;
527                 stats->dequeue_err_count += qp->stats.dequeue_err_count;
528         }
529 }
530
531 /** Reset device statistics */
532 static void
533 openssl_pmd_stats_reset(struct rte_cryptodev *dev)
534 {
535         int qp_id;
536
537         for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
538                 struct openssl_qp *qp = dev->data->queue_pairs[qp_id];
539
540                 memset(&qp->stats, 0, sizeof(qp->stats));
541         }
542 }
543
544
545 /** Get device info */
546 static void
547 openssl_pmd_info_get(struct rte_cryptodev *dev,
548                 struct rte_cryptodev_info *dev_info)
549 {
550         struct openssl_private *internals = dev->data->dev_private;
551
552         if (dev_info != NULL) {
553                 dev_info->dev_type = dev->dev_type;
554                 dev_info->feature_flags = dev->feature_flags;
555                 dev_info->capabilities = openssl_pmd_capabilities;
556                 dev_info->max_nb_queue_pairs = internals->max_nb_qpairs;
557                 dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
558         }
559 }
560
561 /** Release queue pair */
562 static int
563 openssl_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)
564 {
565         if (dev->data->queue_pairs[qp_id] != NULL) {
566                 rte_free(dev->data->queue_pairs[qp_id]);
567                 dev->data->queue_pairs[qp_id] = NULL;
568         }
569         return 0;
570 }
571
572 /** set a unique name for the queue pair based on it's name, dev_id and qp_id */
573 static int
574 openssl_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
575                 struct openssl_qp *qp)
576 {
577         unsigned int n = snprintf(qp->name, sizeof(qp->name),
578                         "openssl_pmd_%u_qp_%u",
579                         dev->data->dev_id, qp->id);
580
581         if (n > sizeof(qp->name))
582                 return -1;
583
584         return 0;
585 }
586
587
588 /** Create a ring to place processed operations on */
589 static struct rte_ring *
590 openssl_pmd_qp_create_processed_ops_ring(struct openssl_qp *qp,
591                 unsigned int ring_size, int socket_id)
592 {
593         struct rte_ring *r;
594
595         r = rte_ring_lookup(qp->name);
596         if (r) {
597                 if (rte_ring_get_size(r) >= ring_size) {
598                         OPENSSL_LOG_INFO(
599                                 "Reusing existing ring %s for processed ops",
600                                  qp->name);
601                         return r;
602                 }
603
604                 OPENSSL_LOG_ERR(
605                         "Unable to reuse existing ring %s for processed ops",
606                          qp->name);
607                 return NULL;
608         }
609
610         return rte_ring_create(qp->name, ring_size, socket_id,
611                         RING_F_SP_ENQ | RING_F_SC_DEQ);
612 }
613
614
615 /** Setup a queue pair */
616 static int
617 openssl_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
618                 const struct rte_cryptodev_qp_conf *qp_conf,
619                  int socket_id)
620 {
621         struct openssl_qp *qp = NULL;
622
623         /* Free memory prior to re-allocation if needed. */
624         if (dev->data->queue_pairs[qp_id] != NULL)
625                 openssl_pmd_qp_release(dev, qp_id);
626
627         /* Allocate the queue pair data structure. */
628         qp = rte_zmalloc_socket("OPENSSL PMD Queue Pair", sizeof(*qp),
629                                         RTE_CACHE_LINE_SIZE, socket_id);
630         if (qp == NULL)
631                 return -ENOMEM;
632
633         qp->id = qp_id;
634         dev->data->queue_pairs[qp_id] = qp;
635
636         if (openssl_pmd_qp_set_unique_name(dev, qp))
637                 goto qp_setup_cleanup;
638
639         qp->processed_ops = openssl_pmd_qp_create_processed_ops_ring(qp,
640                         qp_conf->nb_descriptors, socket_id);
641         if (qp->processed_ops == NULL)
642                 goto qp_setup_cleanup;
643
644         qp->sess_mp = dev->data->session_pool;
645
646         memset(&qp->stats, 0, sizeof(qp->stats));
647
648         return 0;
649
650 qp_setup_cleanup:
651         if (qp)
652                 rte_free(qp);
653
654         return -1;
655 }
656
657 /** Start queue pair */
658 static int
659 openssl_pmd_qp_start(__rte_unused struct rte_cryptodev *dev,
660                 __rte_unused uint16_t queue_pair_id)
661 {
662         return -ENOTSUP;
663 }
664
665 /** Stop queue pair */
666 static int
667 openssl_pmd_qp_stop(__rte_unused struct rte_cryptodev *dev,
668                 __rte_unused uint16_t queue_pair_id)
669 {
670         return -ENOTSUP;
671 }
672
673 /** Return the number of allocated queue pairs */
674 static uint32_t
675 openssl_pmd_qp_count(struct rte_cryptodev *dev)
676 {
677         return dev->data->nb_queue_pairs;
678 }
679
680 /** Returns the size of the session structure */
681 static unsigned
682 openssl_pmd_session_get_size(struct rte_cryptodev *dev __rte_unused)
683 {
684         return sizeof(struct openssl_session);
685 }
686
687 /** Configure the session from a crypto xform chain */
688 static void *
689 openssl_pmd_session_configure(struct rte_cryptodev *dev __rte_unused,
690                 struct rte_crypto_sym_xform *xform,     void *sess)
691 {
692         if (unlikely(sess == NULL)) {
693                 OPENSSL_LOG_ERR("invalid session struct");
694                 return NULL;
695         }
696
697         if (openssl_set_session_parameters(
698                         sess, xform) != 0) {
699                 OPENSSL_LOG_ERR("failed configure session parameters");
700                 return NULL;
701         }
702
703         return sess;
704 }
705
706
707 /** Clear the memory of session so it doesn't leave key material behind */
708 static void
709 openssl_pmd_session_clear(struct rte_cryptodev *dev __rte_unused, void *sess)
710 {
711         /*
712          * Current just resetting the whole data structure, need to investigate
713          * whether a more selective reset of key would be more performant
714          */
715         if (sess) {
716                 openssl_reset_session(sess);
717                 memset(sess, 0, sizeof(struct openssl_session));
718         }
719 }
720
721 struct rte_cryptodev_ops openssl_pmd_ops = {
722                 .dev_configure          = openssl_pmd_config,
723                 .dev_start              = openssl_pmd_start,
724                 .dev_stop               = openssl_pmd_stop,
725                 .dev_close              = openssl_pmd_close,
726
727                 .stats_get              = openssl_pmd_stats_get,
728                 .stats_reset            = openssl_pmd_stats_reset,
729
730                 .dev_infos_get          = openssl_pmd_info_get,
731
732                 .queue_pair_setup       = openssl_pmd_qp_setup,
733                 .queue_pair_release     = openssl_pmd_qp_release,
734                 .queue_pair_start       = openssl_pmd_qp_start,
735                 .queue_pair_stop        = openssl_pmd_qp_stop,
736                 .queue_pair_count       = openssl_pmd_qp_count,
737
738                 .session_get_size       = openssl_pmd_session_get_size,
739                 .session_configure      = openssl_pmd_session_configure,
740                 .session_clear          = openssl_pmd_session_clear
741 };
742
743 struct rte_cryptodev_ops *rte_openssl_pmd_ops = &openssl_pmd_ops;