net/ice/base: add GENEVE offset
[dpdk.git] / drivers / net / ring / rte_eth_ring.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2015 Intel Corporation
3  */
4
5 #include "rte_eth_ring.h"
6 #include <rte_mbuf.h>
7 #include <rte_ethdev_driver.h>
8 #include <rte_malloc.h>
9 #include <rte_memcpy.h>
10 #include <rte_string_fns.h>
11 #include <rte_bus_vdev.h>
12 #include <rte_kvargs.h>
13 #include <rte_errno.h>
14
15 #define ETH_RING_NUMA_NODE_ACTION_ARG   "nodeaction"
16 #define ETH_RING_ACTION_CREATE          "CREATE"
17 #define ETH_RING_ACTION_ATTACH          "ATTACH"
18 #define ETH_RING_INTERNAL_ARG           "internal"
19
20 static const char *valid_arguments[] = {
21         ETH_RING_NUMA_NODE_ACTION_ARG,
22         ETH_RING_INTERNAL_ARG,
23         NULL
24 };
25
26 struct ring_internal_args {
27         struct rte_ring * const *rx_queues;
28         const unsigned int nb_rx_queues;
29         struct rte_ring * const *tx_queues;
30         const unsigned int nb_tx_queues;
31         const unsigned int numa_node;
32         void *addr; /* self addr for sanity check */
33 };
34
35 enum dev_action {
36         DEV_CREATE,
37         DEV_ATTACH
38 };
39
40 struct ring_queue {
41         struct rte_ring *rng;
42         rte_atomic64_t rx_pkts;
43         rte_atomic64_t tx_pkts;
44 };
45
46 struct pmd_internals {
47         unsigned int max_rx_queues;
48         unsigned int max_tx_queues;
49
50         struct ring_queue rx_ring_queues[RTE_PMD_RING_MAX_RX_RINGS];
51         struct ring_queue tx_ring_queues[RTE_PMD_RING_MAX_TX_RINGS];
52
53         struct rte_ether_addr address;
54         enum dev_action action;
55 };
56
57 static struct rte_eth_link pmd_link = {
58         .link_speed = ETH_SPEED_NUM_10G,
59         .link_duplex = ETH_LINK_FULL_DUPLEX,
60         .link_status = ETH_LINK_DOWN,
61         .link_autoneg = ETH_LINK_FIXED,
62 };
63
64 static int eth_ring_logtype;
65
66 #define PMD_LOG(level, fmt, args...) \
67         rte_log(RTE_LOG_ ## level, eth_ring_logtype, \
68                 "%s(): " fmt "\n", __func__, ##args)
69
70 static uint16_t
71 eth_ring_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
72 {
73         void **ptrs = (void *)&bufs[0];
74         struct ring_queue *r = q;
75         const uint16_t nb_rx = (uint16_t)rte_ring_dequeue_burst(r->rng,
76                         ptrs, nb_bufs, NULL);
77         if (r->rng->flags & RING_F_SC_DEQ)
78                 r->rx_pkts.cnt += nb_rx;
79         else
80                 rte_atomic64_add(&(r->rx_pkts), nb_rx);
81         return nb_rx;
82 }
83
84 static uint16_t
85 eth_ring_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
86 {
87         void **ptrs = (void *)&bufs[0];
88         struct ring_queue *r = q;
89         const uint16_t nb_tx = (uint16_t)rte_ring_enqueue_burst(r->rng,
90                         ptrs, nb_bufs, NULL);
91         if (r->rng->flags & RING_F_SP_ENQ)
92                 r->tx_pkts.cnt += nb_tx;
93         else
94                 rte_atomic64_add(&(r->tx_pkts), nb_tx);
95         return nb_tx;
96 }
97
98 static int
99 eth_dev_configure(struct rte_eth_dev *dev __rte_unused) { return 0; }
100
101 static int
102 eth_dev_start(struct rte_eth_dev *dev)
103 {
104         dev->data->dev_link.link_status = ETH_LINK_UP;
105         return 0;
106 }
107
108 static void
109 eth_dev_stop(struct rte_eth_dev *dev)
110 {
111         dev->data->dev_link.link_status = ETH_LINK_DOWN;
112 }
113
114 static int
115 eth_dev_set_link_down(struct rte_eth_dev *dev)
116 {
117         dev->data->dev_link.link_status = ETH_LINK_DOWN;
118         return 0;
119 }
120
121 static int
122 eth_dev_set_link_up(struct rte_eth_dev *dev)
123 {
124         dev->data->dev_link.link_status = ETH_LINK_UP;
125         return 0;
126 }
127
128 static int
129 eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
130                                     uint16_t nb_rx_desc __rte_unused,
131                                     unsigned int socket_id __rte_unused,
132                                     const struct rte_eth_rxconf *rx_conf __rte_unused,
133                                     struct rte_mempool *mb_pool __rte_unused)
134 {
135         struct pmd_internals *internals = dev->data->dev_private;
136
137         dev->data->rx_queues[rx_queue_id] = &internals->rx_ring_queues[rx_queue_id];
138         return 0;
139 }
140
141 static int
142 eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
143                                     uint16_t nb_tx_desc __rte_unused,
144                                     unsigned int socket_id __rte_unused,
145                                     const struct rte_eth_txconf *tx_conf __rte_unused)
146 {
147         struct pmd_internals *internals = dev->data->dev_private;
148
149         dev->data->tx_queues[tx_queue_id] = &internals->tx_ring_queues[tx_queue_id];
150         return 0;
151 }
152
153
154 static int
155 eth_dev_info(struct rte_eth_dev *dev,
156              struct rte_eth_dev_info *dev_info)
157 {
158         struct pmd_internals *internals = dev->data->dev_private;
159
160         dev_info->max_mac_addrs = 1;
161         dev_info->max_rx_pktlen = (uint32_t)-1;
162         dev_info->max_rx_queues = (uint16_t)internals->max_rx_queues;
163         dev_info->max_tx_queues = (uint16_t)internals->max_tx_queues;
164         dev_info->min_rx_bufsize = 0;
165
166         return 0;
167 }
168
169 static int
170 eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
171 {
172         unsigned int i;
173         unsigned long rx_total = 0, tx_total = 0;
174         const struct pmd_internals *internal = dev->data->dev_private;
175
176         for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS &&
177                         i < dev->data->nb_rx_queues; i++) {
178                 stats->q_ipackets[i] = internal->rx_ring_queues[i].rx_pkts.cnt;
179                 rx_total += stats->q_ipackets[i];
180         }
181
182         for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS &&
183                         i < dev->data->nb_tx_queues; i++) {
184                 stats->q_opackets[i] = internal->tx_ring_queues[i].tx_pkts.cnt;
185                 tx_total += stats->q_opackets[i];
186         }
187
188         stats->ipackets = rx_total;
189         stats->opackets = tx_total;
190
191         return 0;
192 }
193
194 static void
195 eth_stats_reset(struct rte_eth_dev *dev)
196 {
197         unsigned int i;
198         struct pmd_internals *internal = dev->data->dev_private;
199
200         for (i = 0; i < dev->data->nb_rx_queues; i++)
201                 internal->rx_ring_queues[i].rx_pkts.cnt = 0;
202         for (i = 0; i < dev->data->nb_tx_queues; i++)
203                 internal->tx_ring_queues[i].tx_pkts.cnt = 0;
204 }
205
206 static void
207 eth_mac_addr_remove(struct rte_eth_dev *dev __rte_unused,
208         uint32_t index __rte_unused)
209 {
210 }
211
212 static int
213 eth_mac_addr_add(struct rte_eth_dev *dev __rte_unused,
214         struct rte_ether_addr *mac_addr __rte_unused,
215         uint32_t index __rte_unused,
216         uint32_t vmdq __rte_unused)
217 {
218         return 0;
219 }
220
221 static void
222 eth_queue_release(void *q __rte_unused) { ; }
223 static int
224 eth_link_update(struct rte_eth_dev *dev __rte_unused,
225                 int wait_to_complete __rte_unused) { return 0; }
226
227 static const struct eth_dev_ops ops = {
228         .dev_start = eth_dev_start,
229         .dev_stop = eth_dev_stop,
230         .dev_set_link_up = eth_dev_set_link_up,
231         .dev_set_link_down = eth_dev_set_link_down,
232         .dev_configure = eth_dev_configure,
233         .dev_infos_get = eth_dev_info,
234         .rx_queue_setup = eth_rx_queue_setup,
235         .tx_queue_setup = eth_tx_queue_setup,
236         .rx_queue_release = eth_queue_release,
237         .tx_queue_release = eth_queue_release,
238         .link_update = eth_link_update,
239         .stats_get = eth_stats_get,
240         .stats_reset = eth_stats_reset,
241         .mac_addr_remove = eth_mac_addr_remove,
242         .mac_addr_add = eth_mac_addr_add,
243 };
244
245 static int
246 do_eth_dev_ring_create(const char *name,
247                 struct rte_ring * const rx_queues[],
248                 const unsigned int nb_rx_queues,
249                 struct rte_ring *const tx_queues[],
250                 const unsigned int nb_tx_queues,
251                 const unsigned int numa_node, enum dev_action action,
252                 struct rte_eth_dev **eth_dev_p)
253 {
254         struct rte_eth_dev_data *data = NULL;
255         struct pmd_internals *internals = NULL;
256         struct rte_eth_dev *eth_dev = NULL;
257         void **rx_queues_local = NULL;
258         void **tx_queues_local = NULL;
259         unsigned int i;
260
261         PMD_LOG(INFO, "Creating rings-backed ethdev on numa socket %u",
262                         numa_node);
263
264         rx_queues_local = rte_calloc_socket(name, nb_rx_queues,
265                                             sizeof(void *), 0, numa_node);
266         if (rx_queues_local == NULL) {
267                 rte_errno = ENOMEM;
268                 goto error;
269         }
270
271         tx_queues_local = rte_calloc_socket(name, nb_tx_queues,
272                                             sizeof(void *), 0, numa_node);
273         if (tx_queues_local == NULL) {
274                 rte_errno = ENOMEM;
275                 goto error;
276         }
277
278         internals = rte_zmalloc_socket(name, sizeof(*internals), 0, numa_node);
279         if (internals == NULL) {
280                 rte_errno = ENOMEM;
281                 goto error;
282         }
283
284         /* reserve an ethdev entry */
285         eth_dev = rte_eth_dev_allocate(name);
286         if (eth_dev == NULL) {
287                 rte_errno = ENOSPC;
288                 goto error;
289         }
290
291         /* now put it all together
292          * - store queue data in internals,
293          * - store numa_node info in eth_dev_data
294          * - point eth_dev_data to internals
295          * - and point eth_dev structure to new eth_dev_data structure
296          */
297
298         data = eth_dev->data;
299         data->rx_queues = rx_queues_local;
300         data->tx_queues = tx_queues_local;
301
302         internals->action = action;
303         internals->max_rx_queues = nb_rx_queues;
304         internals->max_tx_queues = nb_tx_queues;
305         for (i = 0; i < nb_rx_queues; i++) {
306                 internals->rx_ring_queues[i].rng = rx_queues[i];
307                 data->rx_queues[i] = &internals->rx_ring_queues[i];
308         }
309         for (i = 0; i < nb_tx_queues; i++) {
310                 internals->tx_ring_queues[i].rng = tx_queues[i];
311                 data->tx_queues[i] = &internals->tx_ring_queues[i];
312         }
313
314         data->dev_private = internals;
315         data->nb_rx_queues = (uint16_t)nb_rx_queues;
316         data->nb_tx_queues = (uint16_t)nb_tx_queues;
317         data->dev_link = pmd_link;
318         data->mac_addrs = &internals->address;
319
320         eth_dev->dev_ops = &ops;
321         data->kdrv = RTE_KDRV_NONE;
322         data->numa_node = numa_node;
323
324         /* finally assign rx and tx ops */
325         eth_dev->rx_pkt_burst = eth_ring_rx;
326         eth_dev->tx_pkt_burst = eth_ring_tx;
327
328         rte_eth_dev_probing_finish(eth_dev);
329         *eth_dev_p = eth_dev;
330
331         return data->port_id;
332
333 error:
334         rte_free(rx_queues_local);
335         rte_free(tx_queues_local);
336         rte_free(internals);
337
338         return -1;
339 }
340
341 int
342 rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
343                 const unsigned int nb_rx_queues,
344                 struct rte_ring *const tx_queues[],
345                 const unsigned int nb_tx_queues,
346                 const unsigned int numa_node)
347 {
348         struct ring_internal_args args = {
349                 .rx_queues = rx_queues,
350                 .nb_rx_queues = nb_rx_queues,
351                 .tx_queues = tx_queues,
352                 .nb_tx_queues = nb_tx_queues,
353                 .numa_node = numa_node,
354                 .addr = &args,
355         };
356         char args_str[32];
357         char ring_name[RTE_RING_NAMESIZE];
358         uint16_t port_id = RTE_MAX_ETHPORTS;
359         int ret;
360
361         /* do some parameter checking */
362         if (rx_queues == NULL && nb_rx_queues > 0) {
363                 rte_errno = EINVAL;
364                 return -1;
365         }
366         if (tx_queues == NULL && nb_tx_queues > 0) {
367                 rte_errno = EINVAL;
368                 return -1;
369         }
370         if (nb_rx_queues > RTE_PMD_RING_MAX_RX_RINGS) {
371                 rte_errno = EINVAL;
372                 return -1;
373         }
374
375         snprintf(args_str, sizeof(args_str), "%s=%p",
376                  ETH_RING_INTERNAL_ARG, &args);
377
378         ret = snprintf(ring_name, sizeof(ring_name), "net_ring_%s", name);
379         if (ret >= (int)sizeof(ring_name)) {
380                 rte_errno = ENAMETOOLONG;
381                 return -1;
382         }
383
384         ret = rte_vdev_init(ring_name, args_str);
385         if (ret) {
386                 rte_errno = EINVAL;
387                 return -1;
388         }
389
390         ret = rte_eth_dev_get_port_by_name(ring_name, &port_id);
391         if (ret) {
392                 rte_errno = ENODEV;
393                 return -1;
394         }
395
396         return port_id;
397 }
398
399 int
400 rte_eth_from_ring(struct rte_ring *r)
401 {
402         return rte_eth_from_rings(r->name, &r, 1, &r, 1,
403                         r->memzone ? r->memzone->socket_id : SOCKET_ID_ANY);
404 }
405
406 static int
407 eth_dev_ring_create(const char *name, const unsigned int numa_node,
408                 enum dev_action action, struct rte_eth_dev **eth_dev)
409 {
410         /* rx and tx are so-called from point of view of first port.
411          * They are inverted from the point of view of second port
412          */
413         struct rte_ring *rxtx[RTE_PMD_RING_MAX_RX_RINGS];
414         unsigned int i;
415         char rng_name[RTE_RING_NAMESIZE];
416         unsigned int num_rings = RTE_MIN(RTE_PMD_RING_MAX_RX_RINGS,
417                         RTE_PMD_RING_MAX_TX_RINGS);
418
419         for (i = 0; i < num_rings; i++) {
420                 int cc;
421
422                 cc = snprintf(rng_name, sizeof(rng_name),
423                               "ETH_RXTX%u_%s", i, name);
424                 if (cc >= (int)sizeof(rng_name)) {
425                         rte_errno = ENAMETOOLONG;
426                         return -1;
427                 }
428
429                 rxtx[i] = (action == DEV_CREATE) ?
430                                 rte_ring_create(rng_name, 1024, numa_node,
431                                                 RING_F_SP_ENQ|RING_F_SC_DEQ) :
432                                 rte_ring_lookup(rng_name);
433                 if (rxtx[i] == NULL)
434                         return -1;
435         }
436
437         if (do_eth_dev_ring_create(name, rxtx, num_rings, rxtx, num_rings,
438                 numa_node, action, eth_dev) < 0)
439                 return -1;
440
441         return 0;
442 }
443
444 struct node_action_pair {
445         char name[PATH_MAX];
446         unsigned int node;
447         enum dev_action action;
448 };
449
450 struct node_action_list {
451         unsigned int total;
452         unsigned int count;
453         struct node_action_pair *list;
454 };
455
456 static int parse_kvlist(const char *key __rte_unused,
457                         const char *value, void *data)
458 {
459         struct node_action_list *info = data;
460         int ret;
461         char *name;
462         char *action;
463         char *node;
464         char *end;
465
466         name = strdup(value);
467
468         ret = -EINVAL;
469
470         if (!name) {
471                 PMD_LOG(WARNING, "command line parameter is empty for ring pmd!");
472                 goto out;
473         }
474
475         node = strchr(name, ':');
476         if (!node) {
477                 PMD_LOG(WARNING, "could not parse node value from %s",
478                         name);
479                 goto out;
480         }
481
482         *node = '\0';
483         node++;
484
485         action = strchr(node, ':');
486         if (!action) {
487                 PMD_LOG(WARNING, "could not parse action value from %s",
488                         node);
489                 goto out;
490         }
491
492         *action = '\0';
493         action++;
494
495         /*
496          * Need to do some sanity checking here
497          */
498
499         if (strcmp(action, ETH_RING_ACTION_ATTACH) == 0)
500                 info->list[info->count].action = DEV_ATTACH;
501         else if (strcmp(action, ETH_RING_ACTION_CREATE) == 0)
502                 info->list[info->count].action = DEV_CREATE;
503         else
504                 goto out;
505
506         errno = 0;
507         info->list[info->count].node = strtol(node, &end, 10);
508
509         if ((errno != 0) || (*end != '\0')) {
510                 PMD_LOG(WARNING,
511                         "node value %s is unparseable as a number", node);
512                 goto out;
513         }
514
515         strlcpy(info->list[info->count].name, name,
516                 sizeof(info->list[info->count].name));
517
518         info->count++;
519
520         ret = 0;
521 out:
522         free(name);
523         return ret;
524 }
525
526 static int
527 parse_internal_args(const char *key __rte_unused, const char *value,
528                 void *data)
529 {
530         struct ring_internal_args **internal_args = data;
531         void *args;
532
533         sscanf(value, "%p", &args);
534
535         *internal_args = args;
536
537         if ((*internal_args)->addr != args)
538                 return -1;
539
540         return 0;
541 }
542
543 static int
544 rte_pmd_ring_probe(struct rte_vdev_device *dev)
545 {
546         const char *name, *params;
547         struct rte_kvargs *kvlist = NULL;
548         int ret = 0;
549         struct node_action_list *info = NULL;
550         struct rte_eth_dev *eth_dev = NULL;
551         struct ring_internal_args *internal_args;
552
553         name = rte_vdev_device_name(dev);
554         params = rte_vdev_device_args(dev);
555
556         PMD_LOG(INFO, "Initializing pmd_ring for %s", name);
557
558         if (params == NULL || params[0] == '\0') {
559                 ret = eth_dev_ring_create(name, rte_socket_id(), DEV_CREATE,
560                                 &eth_dev);
561                 if (ret == -1) {
562                         PMD_LOG(INFO,
563                                 "Attach to pmd_ring for %s", name);
564                         ret = eth_dev_ring_create(name, rte_socket_id(),
565                                                   DEV_ATTACH, &eth_dev);
566                 }
567         } else {
568                 kvlist = rte_kvargs_parse(params, valid_arguments);
569
570                 if (!kvlist) {
571                         PMD_LOG(INFO,
572                                 "Ignoring unsupported parameters when creatingrings-backed ethernet device");
573                         ret = eth_dev_ring_create(name, rte_socket_id(),
574                                                   DEV_CREATE, &eth_dev);
575                         if (ret == -1) {
576                                 PMD_LOG(INFO,
577                                         "Attach to pmd_ring for %s",
578                                         name);
579                                 ret = eth_dev_ring_create(name, rte_socket_id(),
580                                                           DEV_ATTACH, &eth_dev);
581                         }
582
583                         if (eth_dev)
584                                 eth_dev->device = &dev->device;
585
586                         return ret;
587                 }
588
589                 if (rte_kvargs_count(kvlist, ETH_RING_INTERNAL_ARG) == 1) {
590                         ret = rte_kvargs_process(kvlist, ETH_RING_INTERNAL_ARG,
591                                                  parse_internal_args,
592                                                  &internal_args);
593                         if (ret < 0)
594                                 goto out_free;
595
596                         ret = do_eth_dev_ring_create(name,
597                                 internal_args->rx_queues,
598                                 internal_args->nb_rx_queues,
599                                 internal_args->tx_queues,
600                                 internal_args->nb_tx_queues,
601                                 internal_args->numa_node,
602                                 DEV_ATTACH,
603                                 &eth_dev);
604                         if (ret >= 0)
605                                 ret = 0;
606                 } else {
607                         ret = rte_kvargs_count(kvlist, ETH_RING_NUMA_NODE_ACTION_ARG);
608                         info = rte_zmalloc("struct node_action_list",
609                                            sizeof(struct node_action_list) +
610                                            (sizeof(struct node_action_pair) * ret),
611                                            0);
612                         if (!info)
613                                 goto out_free;
614
615                         info->total = ret;
616                         info->list = (struct node_action_pair *)(info + 1);
617
618                         ret = rte_kvargs_process(kvlist, ETH_RING_NUMA_NODE_ACTION_ARG,
619                                                  parse_kvlist, info);
620
621                         if (ret < 0)
622                                 goto out_free;
623
624                         for (info->count = 0; info->count < info->total; info->count++) {
625                                 ret = eth_dev_ring_create(info->list[info->count].name,
626                                                           info->list[info->count].node,
627                                                           info->list[info->count].action,
628                                                           &eth_dev);
629                                 if ((ret == -1) &&
630                                     (info->list[info->count].action == DEV_CREATE)) {
631                                         PMD_LOG(INFO,
632                                                 "Attach to pmd_ring for %s",
633                                                 name);
634                                         ret = eth_dev_ring_create(name,
635                                                         info->list[info->count].node,
636                                                         DEV_ATTACH,
637                                                         &eth_dev);
638                                 }
639                         }
640                 }
641         }
642
643         if (eth_dev)
644                 eth_dev->device = &dev->device;
645
646 out_free:
647         rte_kvargs_free(kvlist);
648         rte_free(info);
649         return ret;
650 }
651
652 static int
653 rte_pmd_ring_remove(struct rte_vdev_device *dev)
654 {
655         const char *name = rte_vdev_device_name(dev);
656         struct rte_eth_dev *eth_dev = NULL;
657         struct pmd_internals *internals = NULL;
658         struct ring_queue *r = NULL;
659         uint16_t i;
660
661         PMD_LOG(INFO, "Un-Initializing pmd_ring for %s", name);
662
663         if (name == NULL)
664                 return -EINVAL;
665
666         /* find an ethdev entry */
667         eth_dev = rte_eth_dev_allocated(name);
668         if (eth_dev == NULL)
669                 return -ENODEV;
670
671         eth_dev_stop(eth_dev);
672
673         internals = eth_dev->data->dev_private;
674         if (internals->action == DEV_CREATE) {
675                 /*
676                  * it is only necessary to delete the rings in rx_queues because
677                  * they are the same used in tx_queues
678                  */
679                 for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
680                         r = eth_dev->data->rx_queues[i];
681                         rte_ring_free(r->rng);
682                 }
683         }
684
685         /* mac_addrs must not be freed alone because part of dev_private */
686         eth_dev->data->mac_addrs = NULL;
687         rte_eth_dev_release_port(eth_dev);
688         return 0;
689 }
690
691 static struct rte_vdev_driver pmd_ring_drv = {
692         .probe = rte_pmd_ring_probe,
693         .remove = rte_pmd_ring_remove,
694 };
695
696 RTE_PMD_REGISTER_VDEV(net_ring, pmd_ring_drv);
697 RTE_PMD_REGISTER_ALIAS(net_ring, eth_ring);
698 RTE_PMD_REGISTER_PARAM_STRING(net_ring,
699         ETH_RING_NUMA_NODE_ACTION_ARG "=name:node:action(ATTACH|CREATE)");
700
701 RTE_INIT(eth_ring_init_log)
702 {
703         eth_ring_logtype = rte_log_register("pmd.net.ring");
704         if (eth_ring_logtype >= 0)
705                 rte_log_set_level(eth_ring_logtype, RTE_LOG_NOTICE);
706 }