New upstream version 18.08
[deb_dpdk.git] / drivers / crypto / kasumi / rte_kasumi_pmd.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2016-2018 Intel Corporation
3  */
4
5 #include <rte_common.h>
6 #include <rte_hexdump.h>
7 #include <rte_cryptodev.h>
8 #include <rte_cryptodev_pmd.h>
9 #include <rte_bus_vdev.h>
10 #include <rte_malloc.h>
11 #include <rte_cpuflags.h>
12
13 #include "rte_kasumi_pmd_private.h"
14
15 #define KASUMI_KEY_LENGTH 16
16 #define KASUMI_IV_LENGTH 8
17 #define KASUMI_MAX_BURST 4
18 #define BYTE_LEN 8
19
20 static uint8_t cryptodev_driver_id;
21
22 /** Get xform chain order. */
23 static enum kasumi_operation
24 kasumi_get_mode(const struct rte_crypto_sym_xform *xform)
25 {
26         if (xform == NULL)
27                 return KASUMI_OP_NOT_SUPPORTED;
28
29         if (xform->next)
30                 if (xform->next->next != NULL)
31                         return KASUMI_OP_NOT_SUPPORTED;
32
33         if (xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) {
34                 if (xform->next == NULL)
35                         return KASUMI_OP_ONLY_AUTH;
36                 else if (xform->next->type == RTE_CRYPTO_SYM_XFORM_CIPHER)
37                         return KASUMI_OP_AUTH_CIPHER;
38                 else
39                         return KASUMI_OP_NOT_SUPPORTED;
40         }
41
42         if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) {
43                 if (xform->next == NULL)
44                         return KASUMI_OP_ONLY_CIPHER;
45                 else if (xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH)
46                         return KASUMI_OP_CIPHER_AUTH;
47                 else
48                         return KASUMI_OP_NOT_SUPPORTED;
49         }
50
51         return KASUMI_OP_NOT_SUPPORTED;
52 }
53
54
55 /** Parse crypto xform chain and set private session parameters. */
56 int
57 kasumi_set_session_parameters(struct kasumi_session *sess,
58                 const struct rte_crypto_sym_xform *xform)
59 {
60         const struct rte_crypto_sym_xform *auth_xform = NULL;
61         const struct rte_crypto_sym_xform *cipher_xform = NULL;
62         enum kasumi_operation mode;
63
64         /* Select Crypto operation - hash then cipher / cipher then hash */
65         mode = kasumi_get_mode(xform);
66
67         switch (mode) {
68         case KASUMI_OP_CIPHER_AUTH:
69                 auth_xform = xform->next;
70                 /* Fall-through */
71         case KASUMI_OP_ONLY_CIPHER:
72                 cipher_xform = xform;
73                 break;
74         case KASUMI_OP_AUTH_CIPHER:
75                 cipher_xform = xform->next;
76                 /* Fall-through */
77         case KASUMI_OP_ONLY_AUTH:
78                 auth_xform = xform;
79                 break;
80         case KASUMI_OP_NOT_SUPPORTED:
81         default:
82                 KASUMI_LOG(ERR, "Unsupported operation chain order parameter");
83                 return -ENOTSUP;
84         }
85
86         if (cipher_xform) {
87                 /* Only KASUMI F8 supported */
88                 if (cipher_xform->cipher.algo != RTE_CRYPTO_CIPHER_KASUMI_F8) {
89                         KASUMI_LOG(ERR, "Unsupported cipher algorithm ");
90                         return -ENOTSUP;
91                 }
92
93                 sess->cipher_iv_offset = cipher_xform->cipher.iv.offset;
94                 if (cipher_xform->cipher.iv.length != KASUMI_IV_LENGTH) {
95                         KASUMI_LOG(ERR, "Wrong IV length");
96                         return -EINVAL;
97                 }
98
99                 /* Initialize key */
100                 sso_kasumi_init_f8_key_sched(cipher_xform->cipher.key.data,
101                                 &sess->pKeySched_cipher);
102         }
103
104         if (auth_xform) {
105                 /* Only KASUMI F9 supported */
106                 if (auth_xform->auth.algo != RTE_CRYPTO_AUTH_KASUMI_F9) {
107                         KASUMI_LOG(ERR, "Unsupported authentication");
108                         return -ENOTSUP;
109                 }
110
111                 if (auth_xform->auth.digest_length != KASUMI_DIGEST_LENGTH) {
112                         KASUMI_LOG(ERR, "Wrong digest length");
113                         return -EINVAL;
114                 }
115
116                 sess->auth_op = auth_xform->auth.op;
117
118                 /* Initialize key */
119                 sso_kasumi_init_f9_key_sched(auth_xform->auth.key.data,
120                                 &sess->pKeySched_hash);
121         }
122
123
124         sess->op = mode;
125
126         return 0;
127 }
128
129 /** Get KASUMI session. */
130 static struct kasumi_session *
131 kasumi_get_session(struct kasumi_qp *qp, struct rte_crypto_op *op)
132 {
133         struct kasumi_session *sess = NULL;
134
135         if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION) {
136                 if (likely(op->sym->session != NULL))
137                         sess = (struct kasumi_session *)
138                                         get_sym_session_private_data(
139                                         op->sym->session,
140                                         cryptodev_driver_id);
141         } else {
142                 void *_sess = NULL;
143                 void *_sess_private_data = NULL;
144
145                 if (rte_mempool_get(qp->sess_mp, (void **)&_sess))
146                         return NULL;
147
148                 if (rte_mempool_get(qp->sess_mp, (void **)&_sess_private_data))
149                         return NULL;
150
151                 sess = (struct kasumi_session *)_sess_private_data;
152
153                 if (unlikely(kasumi_set_session_parameters(sess,
154                                 op->sym->xform) != 0)) {
155                         rte_mempool_put(qp->sess_mp, _sess);
156                         rte_mempool_put(qp->sess_mp, _sess_private_data);
157                         sess = NULL;
158                 }
159                 op->sym->session = (struct rte_cryptodev_sym_session *)_sess;
160                 set_sym_session_private_data(op->sym->session,
161                                 cryptodev_driver_id, _sess_private_data);
162         }
163
164         if (unlikely(sess == NULL))
165                 op->status = RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
166
167         return sess;
168 }
169
170 /** Encrypt/decrypt mbufs with same cipher key. */
171 static uint8_t
172 process_kasumi_cipher_op(struct rte_crypto_op **ops,
173                 struct kasumi_session *session,
174                 uint8_t num_ops)
175 {
176         unsigned i;
177         uint8_t processed_ops = 0;
178         uint8_t *src[num_ops], *dst[num_ops];
179         uint8_t *iv_ptr;
180         uint64_t iv[num_ops];
181         uint32_t num_bytes[num_ops];
182
183         for (i = 0; i < num_ops; i++) {
184                 src[i] = rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) +
185                                 (ops[i]->sym->cipher.data.offset >> 3);
186                 dst[i] = ops[i]->sym->m_dst ?
187                         rte_pktmbuf_mtod(ops[i]->sym->m_dst, uint8_t *) +
188                                 (ops[i]->sym->cipher.data.offset >> 3) :
189                         rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) +
190                                 (ops[i]->sym->cipher.data.offset >> 3);
191                 iv_ptr = rte_crypto_op_ctod_offset(ops[i], uint8_t *,
192                                 session->cipher_iv_offset);
193                 iv[i] = *((uint64_t *)(iv_ptr));
194                 num_bytes[i] = ops[i]->sym->cipher.data.length >> 3;
195
196                 processed_ops++;
197         }
198
199         if (processed_ops != 0)
200                 sso_kasumi_f8_n_buffer(&session->pKeySched_cipher, iv,
201                         src, dst, num_bytes, processed_ops);
202
203         return processed_ops;
204 }
205
206 /** Encrypt/decrypt mbuf (bit level function). */
207 static uint8_t
208 process_kasumi_cipher_op_bit(struct rte_crypto_op *op,
209                 struct kasumi_session *session)
210 {
211         uint8_t *src, *dst;
212         uint8_t *iv_ptr;
213         uint64_t iv;
214         uint32_t length_in_bits, offset_in_bits;
215
216         offset_in_bits = op->sym->cipher.data.offset;
217         src = rte_pktmbuf_mtod(op->sym->m_src, uint8_t *);
218         if (op->sym->m_dst == NULL) {
219                 op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
220                 KASUMI_LOG(ERR, "bit-level in-place not supported");
221                 return 0;
222         }
223         dst = rte_pktmbuf_mtod(op->sym->m_dst, uint8_t *);
224         iv_ptr = rte_crypto_op_ctod_offset(op, uint8_t *,
225                         session->cipher_iv_offset);
226         iv = *((uint64_t *)(iv_ptr));
227         length_in_bits = op->sym->cipher.data.length;
228
229         sso_kasumi_f8_1_buffer_bit(&session->pKeySched_cipher, iv,
230                         src, dst, length_in_bits, offset_in_bits);
231
232         return 1;
233 }
234
235 /** Generate/verify hash from mbufs with same hash key. */
236 static int
237 process_kasumi_hash_op(struct kasumi_qp *qp, struct rte_crypto_op **ops,
238                 struct kasumi_session *session,
239                 uint8_t num_ops)
240 {
241         unsigned i;
242         uint8_t processed_ops = 0;
243         uint8_t *src, *dst;
244         uint32_t length_in_bits;
245         uint32_t num_bytes;
246
247         for (i = 0; i < num_ops; i++) {
248                 /* Data must be byte aligned */
249                 if ((ops[i]->sym->auth.data.offset % BYTE_LEN) != 0) {
250                         ops[i]->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
251                         KASUMI_LOG(ERR, "Invalid Offset");
252                         break;
253                 }
254
255                 length_in_bits = ops[i]->sym->auth.data.length;
256
257                 src = rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) +
258                                 (ops[i]->sym->auth.data.offset >> 3);
259                 /* Direction from next bit after end of message */
260                 num_bytes = length_in_bits >> 3;
261
262                 if (session->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) {
263                         dst = qp->temp_digest;
264                         sso_kasumi_f9_1_buffer(&session->pKeySched_hash, src,
265                                         num_bytes, dst);
266
267                         /* Verify digest. */
268                         if (memcmp(dst, ops[i]->sym->auth.digest.data,
269                                         KASUMI_DIGEST_LENGTH) != 0)
270                                 ops[i]->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
271                 } else  {
272                         dst = ops[i]->sym->auth.digest.data;
273
274                         sso_kasumi_f9_1_buffer(&session->pKeySched_hash, src,
275                                         num_bytes, dst);
276                 }
277                 processed_ops++;
278         }
279
280         return processed_ops;
281 }
282
283 /** Process a batch of crypto ops which shares the same session. */
284 static int
285 process_ops(struct rte_crypto_op **ops, struct kasumi_session *session,
286                 struct kasumi_qp *qp, uint8_t num_ops,
287                 uint16_t *accumulated_enqueued_ops)
288 {
289         unsigned i;
290         unsigned enqueued_ops, processed_ops;
291
292         switch (session->op) {
293         case KASUMI_OP_ONLY_CIPHER:
294                 processed_ops = process_kasumi_cipher_op(ops,
295                                 session, num_ops);
296                 break;
297         case KASUMI_OP_ONLY_AUTH:
298                 processed_ops = process_kasumi_hash_op(qp, ops, session,
299                                 num_ops);
300                 break;
301         case KASUMI_OP_CIPHER_AUTH:
302                 processed_ops = process_kasumi_cipher_op(ops, session,
303                                 num_ops);
304                 process_kasumi_hash_op(qp, ops, session, processed_ops);
305                 break;
306         case KASUMI_OP_AUTH_CIPHER:
307                 processed_ops = process_kasumi_hash_op(qp, ops, session,
308                                 num_ops);
309                 process_kasumi_cipher_op(ops, session, processed_ops);
310                 break;
311         default:
312                 /* Operation not supported. */
313                 processed_ops = 0;
314         }
315
316         for (i = 0; i < num_ops; i++) {
317                 /*
318                  * If there was no error/authentication failure,
319                  * change status to successful.
320                  */
321                 if (ops[i]->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED)
322                         ops[i]->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
323                 /* Free session if a session-less crypto op. */
324                 if (ops[i]->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
325                         memset(session, 0, sizeof(struct kasumi_session));
326                         memset(ops[i]->sym->session, 0,
327                                         rte_cryptodev_sym_get_header_session_size());
328                         rte_mempool_put(qp->sess_mp, session);
329                         rte_mempool_put(qp->sess_mp, ops[i]->sym->session);
330                         ops[i]->sym->session = NULL;
331                 }
332         }
333
334         enqueued_ops = rte_ring_enqueue_burst(qp->processed_ops,
335                                 (void **)ops, processed_ops, NULL);
336         qp->qp_stats.enqueued_count += enqueued_ops;
337         *accumulated_enqueued_ops += enqueued_ops;
338
339         return enqueued_ops;
340 }
341
342 /** Process a crypto op with length/offset in bits. */
343 static int
344 process_op_bit(struct rte_crypto_op *op, struct kasumi_session *session,
345                 struct kasumi_qp *qp, uint16_t *accumulated_enqueued_ops)
346 {
347         unsigned enqueued_op, processed_op;
348
349         switch (session->op) {
350         case KASUMI_OP_ONLY_CIPHER:
351                 processed_op = process_kasumi_cipher_op_bit(op,
352                                 session);
353                 break;
354         case KASUMI_OP_ONLY_AUTH:
355                 processed_op = process_kasumi_hash_op(qp, &op, session, 1);
356                 break;
357         case KASUMI_OP_CIPHER_AUTH:
358                 processed_op = process_kasumi_cipher_op_bit(op, session);
359                 if (processed_op == 1)
360                         process_kasumi_hash_op(qp, &op, session, 1);
361                 break;
362         case KASUMI_OP_AUTH_CIPHER:
363                 processed_op = process_kasumi_hash_op(qp, &op, session, 1);
364                 if (processed_op == 1)
365                         process_kasumi_cipher_op_bit(op, session);
366                 break;
367         default:
368                 /* Operation not supported. */
369                 processed_op = 0;
370         }
371
372         /*
373          * If there was no error/authentication failure,
374          * change status to successful.
375          */
376         if (op->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED)
377                 op->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
378
379         /* Free session if a session-less crypto op. */
380         if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
381                 memset(op->sym->session, 0, sizeof(struct kasumi_session));
382                 rte_cryptodev_sym_session_free(op->sym->session);
383                 op->sym->session = NULL;
384         }
385
386         enqueued_op = rte_ring_enqueue_burst(qp->processed_ops, (void **)&op,
387                                 processed_op, NULL);
388         qp->qp_stats.enqueued_count += enqueued_op;
389         *accumulated_enqueued_ops += enqueued_op;
390
391         return enqueued_op;
392 }
393
394 static uint16_t
395 kasumi_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
396                 uint16_t nb_ops)
397 {
398         struct rte_crypto_op *c_ops[nb_ops];
399         struct rte_crypto_op *curr_c_op;
400
401         struct kasumi_session *prev_sess = NULL, *curr_sess = NULL;
402         struct kasumi_qp *qp = queue_pair;
403         unsigned i;
404         uint8_t burst_size = 0;
405         uint16_t enqueued_ops = 0;
406         uint8_t processed_ops;
407
408         for (i = 0; i < nb_ops; i++) {
409                 curr_c_op = ops[i];
410
411 #ifdef RTE_LIBRTE_PMD_KASUMI_DEBUG
412                 if (!rte_pktmbuf_is_contiguous(curr_c_op->sym->m_src) ||
413                                 (curr_c_op->sym->m_dst != NULL &&
414                                 !rte_pktmbuf_is_contiguous(
415                                                 curr_c_op->sym->m_dst))) {
416                         KASUMI_LOG(ERR, "PMD supports only contiguous mbufs, "
417                                 "op (%p) provides noncontiguous mbuf as "
418                                 "source/destination buffer.", curr_c_op);
419                         curr_c_op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
420                         break;
421                 }
422 #endif
423
424                 /* Set status as enqueued (not processed yet) by default. */
425                 curr_c_op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
426
427                 curr_sess = kasumi_get_session(qp, curr_c_op);
428                 if (unlikely(curr_sess == NULL ||
429                                 curr_sess->op == KASUMI_OP_NOT_SUPPORTED)) {
430                         curr_c_op->status =
431                                         RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
432                         break;
433                 }
434
435                 /* If length/offset is at bit-level, process this buffer alone. */
436                 if (((curr_c_op->sym->cipher.data.length % BYTE_LEN) != 0)
437                                 || ((ops[i]->sym->cipher.data.offset
438                                         % BYTE_LEN) != 0)) {
439                         /* Process the ops of the previous session. */
440                         if (prev_sess != NULL) {
441                                 processed_ops = process_ops(c_ops, prev_sess,
442                                                 qp, burst_size, &enqueued_ops);
443                                 if (processed_ops < burst_size) {
444                                         burst_size = 0;
445                                         break;
446                                 }
447
448                                 burst_size = 0;
449                                 prev_sess = NULL;
450                         }
451
452                         processed_ops = process_op_bit(curr_c_op, curr_sess,
453                                                 qp, &enqueued_ops);
454                         if (processed_ops != 1)
455                                 break;
456
457                         continue;
458                 }
459
460                 /* Batch ops that share the same session. */
461                 if (prev_sess == NULL) {
462                         prev_sess = curr_sess;
463                         c_ops[burst_size++] = curr_c_op;
464                 } else if (curr_sess == prev_sess) {
465                         c_ops[burst_size++] = curr_c_op;
466                         /*
467                          * When there are enough ops to process in a batch,
468                          * process them, and start a new batch.
469                          */
470                         if (burst_size == KASUMI_MAX_BURST) {
471                                 processed_ops = process_ops(c_ops, prev_sess,
472                                                 qp, burst_size, &enqueued_ops);
473                                 if (processed_ops < burst_size) {
474                                         burst_size = 0;
475                                         break;
476                                 }
477
478                                 burst_size = 0;
479                                 prev_sess = NULL;
480                         }
481                 } else {
482                         /*
483                          * Different session, process the ops
484                          * of the previous session.
485                          */
486                         processed_ops = process_ops(c_ops, prev_sess,
487                                         qp, burst_size, &enqueued_ops);
488                         if (processed_ops < burst_size) {
489                                 burst_size = 0;
490                                 break;
491                         }
492
493                         burst_size = 0;
494                         prev_sess = curr_sess;
495
496                         c_ops[burst_size++] = curr_c_op;
497                 }
498         }
499
500         if (burst_size != 0) {
501                 /* Process the crypto ops of the last session. */
502                 processed_ops = process_ops(c_ops, prev_sess,
503                                 qp, burst_size, &enqueued_ops);
504         }
505
506         qp->qp_stats.enqueue_err_count += nb_ops - enqueued_ops;
507         return enqueued_ops;
508 }
509
510 static uint16_t
511 kasumi_pmd_dequeue_burst(void *queue_pair,
512                 struct rte_crypto_op **c_ops, uint16_t nb_ops)
513 {
514         struct kasumi_qp *qp = queue_pair;
515
516         unsigned nb_dequeued;
517
518         nb_dequeued = rte_ring_dequeue_burst(qp->processed_ops,
519                         (void **)c_ops, nb_ops, NULL);
520         qp->qp_stats.dequeued_count += nb_dequeued;
521
522         return nb_dequeued;
523 }
524
525 static int cryptodev_kasumi_remove(struct rte_vdev_device *vdev);
526
527 static int
528 cryptodev_kasumi_create(const char *name,
529                         struct rte_vdev_device *vdev,
530                         struct rte_cryptodev_pmd_init_params *init_params)
531 {
532         struct rte_cryptodev *dev;
533         struct kasumi_private *internals;
534         uint64_t cpu_flags = 0;
535
536         dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params);
537         if (dev == NULL) {
538                 KASUMI_LOG(ERR, "failed to create cryptodev vdev");
539                 goto init_error;
540         }
541
542         /* Check CPU for supported vector instruction set */
543         if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX))
544                 cpu_flags |= RTE_CRYPTODEV_FF_CPU_AVX;
545         else
546                 cpu_flags |= RTE_CRYPTODEV_FF_CPU_SSE;
547
548         dev->driver_id = cryptodev_driver_id;
549         dev->dev_ops = rte_kasumi_pmd_ops;
550
551         /* Register RX/TX burst functions for data path. */
552         dev->dequeue_burst = kasumi_pmd_dequeue_burst;
553         dev->enqueue_burst = kasumi_pmd_enqueue_burst;
554
555         dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
556                         RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
557                         cpu_flags;
558
559         internals = dev->data->dev_private;
560
561         internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;
562
563         return 0;
564 init_error:
565         KASUMI_LOG(ERR, "driver %s: failed",
566                         init_params->name);
567
568         cryptodev_kasumi_remove(vdev);
569         return -EFAULT;
570 }
571
572 static int
573 cryptodev_kasumi_probe(struct rte_vdev_device *vdev)
574 {
575         struct rte_cryptodev_pmd_init_params init_params = {
576                 "",
577                 sizeof(struct kasumi_private),
578                 rte_socket_id(),
579                 RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
580         };
581         const char *name;
582         const char *input_args;
583
584         name = rte_vdev_device_name(vdev);
585         if (name == NULL)
586                 return -EINVAL;
587         input_args = rte_vdev_device_args(vdev);
588
589         rte_cryptodev_pmd_parse_input_args(&init_params, input_args);
590
591         return cryptodev_kasumi_create(name, vdev, &init_params);
592 }
593
594 static int
595 cryptodev_kasumi_remove(struct rte_vdev_device *vdev)
596 {
597         struct rte_cryptodev *cryptodev;
598         const char *name;
599
600         name = rte_vdev_device_name(vdev);
601         if (name == NULL)
602                 return -EINVAL;
603
604         cryptodev = rte_cryptodev_pmd_get_named_dev(name);
605         if (cryptodev == NULL)
606                 return -ENODEV;
607
608         return rte_cryptodev_pmd_destroy(cryptodev);
609 }
610
611 static struct rte_vdev_driver cryptodev_kasumi_pmd_drv = {
612         .probe = cryptodev_kasumi_probe,
613         .remove = cryptodev_kasumi_remove
614 };
615
616 static struct cryptodev_driver kasumi_crypto_drv;
617
618 RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_KASUMI_PMD, cryptodev_kasumi_pmd_drv);
619 RTE_PMD_REGISTER_ALIAS(CRYPTODEV_NAME_KASUMI_PMD, cryptodev_kasumi_pmd);
620 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_KASUMI_PMD,
621         "max_nb_queue_pairs=<int> "
622         "socket_id=<int>");
623 RTE_PMD_REGISTER_CRYPTO_DRIVER(kasumi_crypto_drv,
624                 cryptodev_kasumi_pmd_drv.driver, cryptodev_driver_id);
625
626 RTE_INIT(kasumi_init_log)
627 {
628         kasumi_logtype_driver = rte_log_register("pmd.crypto.kasumi");
629 }