cryptodev: change queue pair configure structure
[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_priv,
151                                 (void **)&_sess_private_data))
152                         return NULL;
153
154                 sess = (struct snow3g_session *)_sess_private_data;
155
156                 if (unlikely(snow3g_set_session_parameters(sess,
157                                 op->sym->xform) != 0)) {
158                         rte_mempool_put(qp->sess_mp, _sess);
159                         rte_mempool_put(qp->sess_mp_priv, _sess_private_data);
160                         sess = NULL;
161                 }
162                 op->sym->session = (struct rte_cryptodev_sym_session *)_sess;
163                 set_sym_session_private_data(op->sym->session,
164                                 cryptodev_driver_id, _sess_private_data);
165         }
166
167         if (unlikely(sess == NULL))
168                 op->status = RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
169
170
171         return sess;
172 }
173
174 /** Encrypt/decrypt mbufs with same cipher key. */
175 static uint8_t
176 process_snow3g_cipher_op(struct rte_crypto_op **ops,
177                 struct snow3g_session *session,
178                 uint8_t num_ops)
179 {
180         unsigned i;
181         uint8_t processed_ops = 0;
182         uint8_t *src[SNOW3G_MAX_BURST], *dst[SNOW3G_MAX_BURST];
183         uint8_t *iv[SNOW3G_MAX_BURST];
184         uint32_t num_bytes[SNOW3G_MAX_BURST];
185
186         for (i = 0; i < num_ops; i++) {
187                 src[i] = rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) +
188                                 (ops[i]->sym->cipher.data.offset >> 3);
189                 dst[i] = ops[i]->sym->m_dst ?
190                         rte_pktmbuf_mtod(ops[i]->sym->m_dst, uint8_t *) +
191                                 (ops[i]->sym->cipher.data.offset >> 3) :
192                         rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) +
193                                 (ops[i]->sym->cipher.data.offset >> 3);
194                 iv[i] = rte_crypto_op_ctod_offset(ops[i], uint8_t *,
195                                 session->cipher_iv_offset);
196                 num_bytes[i] = ops[i]->sym->cipher.data.length >> 3;
197
198                 processed_ops++;
199         }
200
201         sso_snow3g_f8_n_buffer(&session->pKeySched_cipher, iv, src, dst,
202                         num_bytes, processed_ops);
203
204         return processed_ops;
205 }
206
207 /** Encrypt/decrypt mbuf (bit level function). */
208 static uint8_t
209 process_snow3g_cipher_op_bit(struct rte_crypto_op *op,
210                 struct snow3g_session *session)
211 {
212         uint8_t *src, *dst;
213         uint8_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                 SNOW3G_LOG(ERR, "bit-level in-place not supported\n");
221                 return 0;
222         }
223         dst = rte_pktmbuf_mtod(op->sym->m_dst, uint8_t *);
224         iv = rte_crypto_op_ctod_offset(op, uint8_t *,
225                                 session->cipher_iv_offset);
226         length_in_bits = op->sym->cipher.data.length;
227
228         sso_snow3g_f8_1_buffer_bit(&session->pKeySched_cipher, iv,
229                         src, dst, length_in_bits, offset_in_bits);
230
231         return 1;
232 }
233
234 /** Generate/verify hash from mbufs with same hash key. */
235 static int
236 process_snow3g_hash_op(struct snow3g_qp *qp, struct rte_crypto_op **ops,
237                 struct snow3g_session *session,
238                 uint8_t num_ops)
239 {
240         unsigned i;
241         uint8_t processed_ops = 0;
242         uint8_t *src, *dst;
243         uint32_t length_in_bits;
244         uint8_t *iv;
245
246         for (i = 0; i < num_ops; i++) {
247                 /* Data must be byte aligned */
248                 if ((ops[i]->sym->auth.data.offset % BYTE_LEN) != 0) {
249                         ops[i]->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
250                         SNOW3G_LOG(ERR, "Offset");
251                         break;
252                 }
253
254                 length_in_bits = ops[i]->sym->auth.data.length;
255
256                 src = rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) +
257                                 (ops[i]->sym->auth.data.offset >> 3);
258                 iv = rte_crypto_op_ctod_offset(ops[i], uint8_t *,
259                                 session->auth_iv_offset);
260
261                 if (session->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY) {
262                         dst = qp->temp_digest;
263
264                         sso_snow3g_f9_1_buffer(&session->pKeySched_hash,
265                                         iv, src,
266                                         length_in_bits, dst);
267                         /* Verify digest. */
268                         if (memcmp(dst, ops[i]->sym->auth.digest.data,
269                                         SNOW3G_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_snow3g_f9_1_buffer(&session->pKeySched_hash,
275                                         iv, src,
276                                         length_in_bits, dst);
277                 }
278                 processed_ops++;
279         }
280
281         return processed_ops;
282 }
283
284 /** Process a batch of crypto ops which shares the same session. */
285 static int
286 process_ops(struct rte_crypto_op **ops, struct snow3g_session *session,
287                 struct snow3g_qp *qp, uint8_t num_ops,
288                 uint16_t *accumulated_enqueued_ops)
289 {
290         unsigned i;
291         unsigned enqueued_ops, processed_ops;
292
293 #ifdef RTE_LIBRTE_PMD_SNOW3G_DEBUG
294         for (i = 0; i < num_ops; i++) {
295                 if (!rte_pktmbuf_is_contiguous(ops[i]->sym->m_src) ||
296                                 (ops[i]->sym->m_dst != NULL &&
297                                 !rte_pktmbuf_is_contiguous(
298                                                 ops[i]->sym->m_dst))) {
299                         SNOW3G_LOG(ERR, "PMD supports only contiguous mbufs, "
300                                 "op (%p) provides noncontiguous mbuf as "
301                                 "source/destination buffer.\n", ops[i]);
302                         ops[i]->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
303                         return 0;
304                 }
305         }
306 #endif
307
308         switch (session->op) {
309         case SNOW3G_OP_ONLY_CIPHER:
310                 processed_ops = process_snow3g_cipher_op(ops,
311                                 session, num_ops);
312                 break;
313         case SNOW3G_OP_ONLY_AUTH:
314                 processed_ops = process_snow3g_hash_op(qp, ops, session,
315                                 num_ops);
316                 break;
317         case SNOW3G_OP_CIPHER_AUTH:
318                 processed_ops = process_snow3g_cipher_op(ops, session,
319                                 num_ops);
320                 process_snow3g_hash_op(qp, ops, session, processed_ops);
321                 break;
322         case SNOW3G_OP_AUTH_CIPHER:
323                 processed_ops = process_snow3g_hash_op(qp, ops, session,
324                                 num_ops);
325                 process_snow3g_cipher_op(ops, session, processed_ops);
326                 break;
327         default:
328                 /* Operation not supported. */
329                 processed_ops = 0;
330         }
331
332         for (i = 0; i < num_ops; i++) {
333                 /*
334                  * If there was no error/authentication failure,
335                  * change status to successful.
336                  */
337                 if (ops[i]->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED)
338                         ops[i]->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
339                 /* Free session if a session-less crypto op. */
340                 if (ops[i]->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
341                         memset(session, 0, sizeof(struct snow3g_session));
342                         memset(ops[i]->sym->session, 0,
343                                         rte_cryptodev_sym_get_header_session_size());
344                         rte_mempool_put(qp->sess_mp_priv, session);
345                         rte_mempool_put(qp->sess_mp, ops[i]->sym->session);
346                         ops[i]->sym->session = NULL;
347                 }
348         }
349
350         enqueued_ops = rte_ring_enqueue_burst(qp->processed_ops,
351                         (void **)ops, processed_ops, NULL);
352         qp->qp_stats.enqueued_count += enqueued_ops;
353         *accumulated_enqueued_ops += enqueued_ops;
354
355         return enqueued_ops;
356 }
357
358 /** Process a crypto op with length/offset in bits. */
359 static int
360 process_op_bit(struct rte_crypto_op *op, struct snow3g_session *session,
361                 struct snow3g_qp *qp, uint16_t *accumulated_enqueued_ops)
362 {
363         unsigned enqueued_op, processed_op;
364
365         switch (session->op) {
366         case SNOW3G_OP_ONLY_CIPHER:
367                 processed_op = process_snow3g_cipher_op_bit(op,
368                                 session);
369                 break;
370         case SNOW3G_OP_ONLY_AUTH:
371                 processed_op = process_snow3g_hash_op(qp, &op, session, 1);
372                 break;
373         case SNOW3G_OP_CIPHER_AUTH:
374                 processed_op = process_snow3g_cipher_op_bit(op, session);
375                 if (processed_op == 1)
376                         process_snow3g_hash_op(qp, &op, session, 1);
377                 break;
378         case SNOW3G_OP_AUTH_CIPHER:
379                 processed_op = process_snow3g_hash_op(qp, &op, session, 1);
380                 if (processed_op == 1)
381                         process_snow3g_cipher_op_bit(op, session);
382                 break;
383         default:
384                 /* Operation not supported. */
385                 processed_op = 0;
386         }
387
388         /*
389          * If there was no error/authentication failure,
390          * change status to successful.
391          */
392         if (op->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED)
393                 op->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
394
395         /* Free session if a session-less crypto op. */
396         if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS) {
397                 memset(op->sym->session, 0, sizeof(struct snow3g_session));
398                 rte_cryptodev_sym_session_free(op->sym->session);
399                 op->sym->session = NULL;
400         }
401
402         enqueued_op = rte_ring_enqueue_burst(qp->processed_ops,
403                         (void **)&op, processed_op, NULL);
404         qp->qp_stats.enqueued_count += enqueued_op;
405         *accumulated_enqueued_ops += enqueued_op;
406
407         return enqueued_op;
408 }
409
410 static uint16_t
411 snow3g_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
412                 uint16_t nb_ops)
413 {
414         struct rte_crypto_op *c_ops[SNOW3G_MAX_BURST];
415         struct rte_crypto_op *curr_c_op;
416
417         struct snow3g_session *prev_sess = NULL, *curr_sess = NULL;
418         struct snow3g_qp *qp = queue_pair;
419         unsigned i;
420         uint8_t burst_size = 0;
421         uint16_t enqueued_ops = 0;
422         uint8_t processed_ops;
423
424         for (i = 0; i < nb_ops; i++) {
425                 curr_c_op = ops[i];
426
427                 /* Set status as enqueued (not processed yet) by default. */
428                 curr_c_op->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
429
430                 curr_sess = snow3g_get_session(qp, curr_c_op);
431                 if (unlikely(curr_sess == NULL ||
432                                 curr_sess->op == SNOW3G_OP_NOT_SUPPORTED)) {
433                         curr_c_op->status =
434                                         RTE_CRYPTO_OP_STATUS_INVALID_SESSION;
435                         break;
436                 }
437
438                 /* If length/offset is at bit-level, process this buffer alone. */
439                 if (((curr_c_op->sym->cipher.data.length % BYTE_LEN) != 0)
440                                 || ((curr_c_op->sym->cipher.data.offset
441                                         % BYTE_LEN) != 0)) {
442                         /* Process the ops of the previous session. */
443                         if (prev_sess != NULL) {
444                                 processed_ops = process_ops(c_ops, prev_sess,
445                                 qp, burst_size, &enqueued_ops);
446                                 if (processed_ops < burst_size) {
447                                         burst_size = 0;
448                                         break;
449                                 }
450
451                                 burst_size = 0;
452                                 prev_sess = NULL;
453                         }
454
455                         processed_ops = process_op_bit(curr_c_op, curr_sess,
456                                                         qp, &enqueued_ops);
457                         if (processed_ops != 1)
458                                 break;
459
460                         continue;
461                 }
462
463                 /* Batch ops that share the same session. */
464                 if (prev_sess == NULL) {
465                         prev_sess = curr_sess;
466                         c_ops[burst_size++] = curr_c_op;
467                 } else if (curr_sess == prev_sess) {
468                         c_ops[burst_size++] = curr_c_op;
469                         /*
470                          * When there are enough ops to process in a batch,
471                          * process them, and start a new batch.
472                          */
473                         if (burst_size == SNOW3G_MAX_BURST) {
474                                 processed_ops = process_ops(c_ops, prev_sess,
475                                                 qp, burst_size, &enqueued_ops);
476                                 if (processed_ops < burst_size) {
477                                         burst_size = 0;
478                                         break;
479                                 }
480
481                                 burst_size = 0;
482                                 prev_sess = NULL;
483                         }
484                 } else {
485                         /*
486                          * Different session, process the ops
487                          * of the previous session.
488                          */
489                         processed_ops = process_ops(c_ops, prev_sess,
490                                         qp, burst_size, &enqueued_ops);
491                         if (processed_ops < burst_size) {
492                                 burst_size = 0;
493                                 break;
494                         }
495
496                         burst_size = 0;
497                         prev_sess = curr_sess;
498
499                         c_ops[burst_size++] = curr_c_op;
500                 }
501         }
502
503         if (burst_size != 0) {
504                 /* Process the crypto ops of the last session. */
505                 processed_ops = process_ops(c_ops, prev_sess,
506                                 qp, burst_size, &enqueued_ops);
507         }
508
509         qp->qp_stats.enqueue_err_count += nb_ops - enqueued_ops;
510         return enqueued_ops;
511 }
512
513 static uint16_t
514 snow3g_pmd_dequeue_burst(void *queue_pair,
515                 struct rte_crypto_op **c_ops, uint16_t nb_ops)
516 {
517         struct snow3g_qp *qp = queue_pair;
518
519         unsigned nb_dequeued;
520
521         nb_dequeued = rte_ring_dequeue_burst(qp->processed_ops,
522                         (void **)c_ops, nb_ops, NULL);
523         qp->qp_stats.dequeued_count += nb_dequeued;
524
525         return nb_dequeued;
526 }
527
528 static int cryptodev_snow3g_remove(struct rte_vdev_device *vdev);
529
530 static int
531 cryptodev_snow3g_create(const char *name,
532                         struct rte_vdev_device *vdev,
533                         struct rte_cryptodev_pmd_init_params *init_params)
534 {
535         struct rte_cryptodev *dev;
536         struct snow3g_private *internals;
537         uint64_t cpu_flags = RTE_CRYPTODEV_FF_CPU_SSE;
538
539         dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params);
540         if (dev == NULL) {
541                 SNOW3G_LOG(ERR, "failed to create cryptodev vdev");
542                 goto init_error;
543         }
544
545         dev->driver_id = cryptodev_driver_id;
546         dev->dev_ops = rte_snow3g_pmd_ops;
547
548         /* Register RX/TX burst functions for data path. */
549         dev->dequeue_burst = snow3g_pmd_dequeue_burst;
550         dev->enqueue_burst = snow3g_pmd_enqueue_burst;
551
552         dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
553                         RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
554                         cpu_flags;
555
556         internals = dev->data->dev_private;
557
558         internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;
559
560         return 0;
561 init_error:
562         SNOW3G_LOG(ERR, "driver %s: cryptodev_snow3g_create failed",
563                         init_params->name);
564
565         cryptodev_snow3g_remove(vdev);
566         return -EFAULT;
567 }
568
569 static int
570 cryptodev_snow3g_probe(struct rte_vdev_device *vdev)
571 {
572         struct rte_cryptodev_pmd_init_params init_params = {
573                 "",
574                 sizeof(struct snow3g_private),
575                 rte_socket_id(),
576                 RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
577         };
578         const char *name;
579         const char *input_args;
580
581         name = rte_vdev_device_name(vdev);
582         if (name == NULL)
583                 return -EINVAL;
584         input_args = rte_vdev_device_args(vdev);
585
586         rte_cryptodev_pmd_parse_input_args(&init_params, input_args);
587
588         return cryptodev_snow3g_create(name, vdev, &init_params);
589 }
590
591 static int
592 cryptodev_snow3g_remove(struct rte_vdev_device *vdev)
593 {
594         struct rte_cryptodev *cryptodev;
595         const char *name;
596
597         name = rte_vdev_device_name(vdev);
598         if (name == NULL)
599                 return -EINVAL;
600
601         cryptodev = rte_cryptodev_pmd_get_named_dev(name);
602         if (cryptodev == NULL)
603                 return -ENODEV;
604
605         return rte_cryptodev_pmd_destroy(cryptodev);
606 }
607
608 static struct rte_vdev_driver cryptodev_snow3g_pmd_drv = {
609         .probe = cryptodev_snow3g_probe,
610         .remove = cryptodev_snow3g_remove
611 };
612
613 static struct cryptodev_driver snow3g_crypto_drv;
614
615 RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_SNOW3G_PMD, cryptodev_snow3g_pmd_drv);
616 RTE_PMD_REGISTER_ALIAS(CRYPTODEV_NAME_SNOW3G_PMD, cryptodev_snow3g_pmd);
617 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SNOW3G_PMD,
618         "max_nb_queue_pairs=<int> "
619         "socket_id=<int>");
620 RTE_PMD_REGISTER_CRYPTO_DRIVER(snow3g_crypto_drv,
621                 cryptodev_snow3g_pmd_drv.driver, cryptodev_driver_id);
622
623 RTE_INIT(snow3g_init_log)
624 {
625         snow3g_logtype_driver = rte_log_register("pmd.crypto.snow3g");
626 }