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