cc12b58f38c44a05ea553f78a91881f2522582d9
[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                                 .iv_size = {
411                                         .min = 12,
412                                         .max = 16,
413                                         .increment = 4
414                                 }
415                         }, }
416                 }, }
417         },
418         {       /* 3DES CBC */
419                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
420                 {.sym = {
421                         .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
422                         {.cipher = {
423                                 .algo = RTE_CRYPTO_CIPHER_3DES_CBC,
424                                 .block_size = 8,
425                                 .key_size = {
426                                         .min = 16,
427                                         .max = 24,
428                                         .increment = 8
429                                 },
430                                 .iv_size = {
431                                         .min = 8,
432                                         .max = 8,
433                                         .increment = 0
434                                 }
435                         }, }
436                 }, }
437         },
438         {       /* 3DES CTR */
439                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
440                 {.sym = {
441                         .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
442                         {.cipher = {
443                                 .algo = RTE_CRYPTO_CIPHER_3DES_CTR,
444                                 .block_size = 8,
445                                 .key_size = {
446                                         .min = 16,
447                                         .max = 24,
448                                         .increment = 8
449                                 },
450                                 .iv_size = {
451                                         .min = 8,
452                                         .max = 8,
453                                         .increment = 0
454                                 }
455                         }, }
456                 }, }
457         },
458         {       /* DES DOCSIS BPI */
459                 .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,
460                 {.sym = {
461                         .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,
462                         {.cipher = {
463                                 .algo = RTE_CRYPTO_CIPHER_DES_DOCSISBPI,
464                                 .block_size = 8,
465                                 .key_size = {
466                                         .min = 8,
467                                         .max = 8,
468                                         .increment = 0
469                                 },
470                                 .iv_size = {
471                                         .min = 8,
472                                         .max = 8,
473                                         .increment = 0
474                                 }
475                         }, }
476                 }, }
477         },
478
479         RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()
480 };
481
482
483 /** Configure device */
484 static int
485 openssl_pmd_config(__rte_unused struct rte_cryptodev *dev,
486                 __rte_unused struct rte_cryptodev_config *config)
487 {
488         return 0;
489 }
490
491 /** Start device */
492 static int
493 openssl_pmd_start(__rte_unused struct rte_cryptodev *dev)
494 {
495         return 0;
496 }
497
498 /** Stop device */
499 static void
500 openssl_pmd_stop(__rte_unused struct rte_cryptodev *dev)
501 {
502 }
503
504 /** Close device */
505 static int
506 openssl_pmd_close(__rte_unused struct rte_cryptodev *dev)
507 {
508         return 0;
509 }
510
511
512 /** Get device statistics */
513 static void
514 openssl_pmd_stats_get(struct rte_cryptodev *dev,
515                 struct rte_cryptodev_stats *stats)
516 {
517         int qp_id;
518
519         for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
520                 struct openssl_qp *qp = dev->data->queue_pairs[qp_id];
521
522                 stats->enqueued_count += qp->stats.enqueued_count;
523                 stats->dequeued_count += qp->stats.dequeued_count;
524
525                 stats->enqueue_err_count += qp->stats.enqueue_err_count;
526                 stats->dequeue_err_count += qp->stats.dequeue_err_count;
527         }
528 }
529
530 /** Reset device statistics */
531 static void
532 openssl_pmd_stats_reset(struct rte_cryptodev *dev)
533 {
534         int qp_id;
535
536         for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
537                 struct openssl_qp *qp = dev->data->queue_pairs[qp_id];
538
539                 memset(&qp->stats, 0, sizeof(qp->stats));
540         }
541 }
542
543
544 /** Get device info */
545 static void
546 openssl_pmd_info_get(struct rte_cryptodev *dev,
547                 struct rte_cryptodev_info *dev_info)
548 {
549         struct openssl_private *internals = dev->data->dev_private;
550
551         if (dev_info != NULL) {
552                 dev_info->dev_type = dev->dev_type;
553                 dev_info->feature_flags = dev->feature_flags;
554                 dev_info->capabilities = openssl_pmd_capabilities;
555                 dev_info->max_nb_queue_pairs = internals->max_nb_qpairs;
556                 dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
557         }
558 }
559
560 /** Release queue pair */
561 static int
562 openssl_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)
563 {
564         if (dev->data->queue_pairs[qp_id] != NULL) {
565                 rte_free(dev->data->queue_pairs[qp_id]);
566                 dev->data->queue_pairs[qp_id] = NULL;
567         }
568         return 0;
569 }
570
571 /** set a unique name for the queue pair based on it's name, dev_id and qp_id */
572 static int
573 openssl_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
574                 struct openssl_qp *qp)
575 {
576         unsigned int n = snprintf(qp->name, sizeof(qp->name),
577                         "openssl_pmd_%u_qp_%u",
578                         dev->data->dev_id, qp->id);
579
580         if (n > sizeof(qp->name))
581                 return -1;
582
583         return 0;
584 }
585
586
587 /** Create a ring to place processed operations on */
588 static struct rte_ring *
589 openssl_pmd_qp_create_processed_ops_ring(struct openssl_qp *qp,
590                 unsigned int ring_size, int socket_id)
591 {
592         struct rte_ring *r;
593
594         r = rte_ring_lookup(qp->name);
595         if (r) {
596                 if (rte_ring_get_size(r) >= ring_size) {
597                         OPENSSL_LOG_INFO(
598                                 "Reusing existing ring %s for processed ops",
599                                  qp->name);
600                         return r;
601                 }
602
603                 OPENSSL_LOG_ERR(
604                         "Unable to reuse existing ring %s for processed ops",
605                          qp->name);
606                 return NULL;
607         }
608
609         return rte_ring_create(qp->name, ring_size, socket_id,
610                         RING_F_SP_ENQ | RING_F_SC_DEQ);
611 }
612
613
614 /** Setup a queue pair */
615 static int
616 openssl_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
617                 const struct rte_cryptodev_qp_conf *qp_conf,
618                  int socket_id)
619 {
620         struct openssl_qp *qp = NULL;
621
622         /* Free memory prior to re-allocation if needed. */
623         if (dev->data->queue_pairs[qp_id] != NULL)
624                 openssl_pmd_qp_release(dev, qp_id);
625
626         /* Allocate the queue pair data structure. */
627         qp = rte_zmalloc_socket("OPENSSL PMD Queue Pair", sizeof(*qp),
628                                         RTE_CACHE_LINE_SIZE, socket_id);
629         if (qp == NULL)
630                 return -ENOMEM;
631
632         qp->id = qp_id;
633         dev->data->queue_pairs[qp_id] = qp;
634
635         if (openssl_pmd_qp_set_unique_name(dev, qp))
636                 goto qp_setup_cleanup;
637
638         qp->processed_ops = openssl_pmd_qp_create_processed_ops_ring(qp,
639                         qp_conf->nb_descriptors, socket_id);
640         if (qp->processed_ops == NULL)
641                 goto qp_setup_cleanup;
642
643         qp->sess_mp = dev->data->session_pool;
644
645         memset(&qp->stats, 0, sizeof(qp->stats));
646
647         return 0;
648
649 qp_setup_cleanup:
650         if (qp)
651                 rte_free(qp);
652
653         return -1;
654 }
655
656 /** Start queue pair */
657 static int
658 openssl_pmd_qp_start(__rte_unused struct rte_cryptodev *dev,
659                 __rte_unused uint16_t queue_pair_id)
660 {
661         return -ENOTSUP;
662 }
663
664 /** Stop queue pair */
665 static int
666 openssl_pmd_qp_stop(__rte_unused struct rte_cryptodev *dev,
667                 __rte_unused uint16_t queue_pair_id)
668 {
669         return -ENOTSUP;
670 }
671
672 /** Return the number of allocated queue pairs */
673 static uint32_t
674 openssl_pmd_qp_count(struct rte_cryptodev *dev)
675 {
676         return dev->data->nb_queue_pairs;
677 }
678
679 /** Returns the size of the session structure */
680 static unsigned
681 openssl_pmd_session_get_size(struct rte_cryptodev *dev __rte_unused)
682 {
683         return sizeof(struct openssl_session);
684 }
685
686 /** Configure the session from a crypto xform chain */
687 static void *
688 openssl_pmd_session_configure(struct rte_cryptodev *dev __rte_unused,
689                 struct rte_crypto_sym_xform *xform,     void *sess)
690 {
691         if (unlikely(sess == NULL)) {
692                 OPENSSL_LOG_ERR("invalid session struct");
693                 return NULL;
694         }
695
696         if (openssl_set_session_parameters(
697                         sess, xform) != 0) {
698                 OPENSSL_LOG_ERR("failed configure session parameters");
699                 return NULL;
700         }
701
702         return sess;
703 }
704
705
706 /** Clear the memory of session so it doesn't leave key material behind */
707 static void
708 openssl_pmd_session_clear(struct rte_cryptodev *dev __rte_unused, void *sess)
709 {
710         /*
711          * Current just resetting the whole data structure, need to investigate
712          * whether a more selective reset of key would be more performant
713          */
714         if (sess) {
715                 openssl_reset_session(sess);
716                 memset(sess, 0, sizeof(struct openssl_session));
717         }
718 }
719
720 struct rte_cryptodev_ops openssl_pmd_ops = {
721                 .dev_configure          = openssl_pmd_config,
722                 .dev_start              = openssl_pmd_start,
723                 .dev_stop               = openssl_pmd_stop,
724                 .dev_close              = openssl_pmd_close,
725
726                 .stats_get              = openssl_pmd_stats_get,
727                 .stats_reset            = openssl_pmd_stats_reset,
728
729                 .dev_infos_get          = openssl_pmd_info_get,
730
731                 .queue_pair_setup       = openssl_pmd_qp_setup,
732                 .queue_pair_release     = openssl_pmd_qp_release,
733                 .queue_pair_start       = openssl_pmd_qp_start,
734                 .queue_pair_stop        = openssl_pmd_qp_stop,
735                 .queue_pair_count       = openssl_pmd_qp_count,
736
737                 .session_get_size       = openssl_pmd_session_get_size,
738                 .session_configure      = openssl_pmd_session_configure,
739                 .session_clear          = openssl_pmd_session_clear
740 };
741
742 struct rte_cryptodev_ops *rte_openssl_pmd_ops = &openssl_pmd_ops;