12046f5a000c077bf207876d6c68aa8f9ca02777
[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 RTE_LOG_REGISTER(eth_ring_logtype, pmd.net.ring, NOTICE);
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 int
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         return 0;
206 }
207
208 static void
209 eth_mac_addr_remove(struct rte_eth_dev *dev __rte_unused,
210         uint32_t index __rte_unused)
211 {
212 }
213
214 static int
215 eth_mac_addr_add(struct rte_eth_dev *dev __rte_unused,
216         struct rte_ether_addr *mac_addr __rte_unused,
217         uint32_t index __rte_unused,
218         uint32_t vmdq __rte_unused)
219 {
220         return 0;
221 }
222
223 static void
224 eth_queue_release(void *q __rte_unused) { ; }
225 static int
226 eth_link_update(struct rte_eth_dev *dev __rte_unused,
227                 int wait_to_complete __rte_unused) { return 0; }
228
229 static int
230 eth_dev_close(struct rte_eth_dev *dev)
231 {
232         struct pmd_internals *internals = NULL;
233         struct ring_queue *r = NULL;
234         uint16_t i;
235
236         if (rte_eal_process_type() != RTE_PROC_PRIMARY)
237                 return 0;
238
239         eth_dev_stop(dev);
240
241         internals = dev->data->dev_private;
242         if (internals->action == DEV_CREATE) {
243                 /*
244                  * it is only necessary to delete the rings in rx_queues because
245                  * they are the same used in tx_queues
246                  */
247                 for (i = 0; i < dev->data->nb_rx_queues; i++) {
248                         r = dev->data->rx_queues[i];
249                         rte_ring_free(r->rng);
250                 }
251         }
252
253         /* mac_addrs must not be freed alone because part of dev_private */
254         dev->data->mac_addrs = NULL;
255
256         return 0;
257 }
258
259 static const struct eth_dev_ops ops = {
260         .dev_close = eth_dev_close,
261         .dev_start = eth_dev_start,
262         .dev_stop = eth_dev_stop,
263         .dev_set_link_up = eth_dev_set_link_up,
264         .dev_set_link_down = eth_dev_set_link_down,
265         .dev_configure = eth_dev_configure,
266         .dev_infos_get = eth_dev_info,
267         .rx_queue_setup = eth_rx_queue_setup,
268         .tx_queue_setup = eth_tx_queue_setup,
269         .rx_queue_release = eth_queue_release,
270         .tx_queue_release = eth_queue_release,
271         .link_update = eth_link_update,
272         .stats_get = eth_stats_get,
273         .stats_reset = eth_stats_reset,
274         .mac_addr_remove = eth_mac_addr_remove,
275         .mac_addr_add = eth_mac_addr_add,
276 };
277
278 static int
279 do_eth_dev_ring_create(const char *name,
280                 struct rte_vdev_device *vdev,
281                 struct rte_ring * const rx_queues[],
282                 const unsigned int nb_rx_queues,
283                 struct rte_ring *const tx_queues[],
284                 const unsigned int nb_tx_queues,
285                 const unsigned int numa_node, enum dev_action action,
286                 struct rte_eth_dev **eth_dev_p)
287 {
288         struct rte_eth_dev_data *data = NULL;
289         struct pmd_internals *internals = NULL;
290         struct rte_eth_dev *eth_dev = NULL;
291         void **rx_queues_local = NULL;
292         void **tx_queues_local = NULL;
293         unsigned int i;
294
295         PMD_LOG(INFO, "Creating rings-backed ethdev on numa socket %u",
296                         numa_node);
297
298         rx_queues_local = rte_calloc_socket(name, nb_rx_queues,
299                                             sizeof(void *), 0, numa_node);
300         if (rx_queues_local == NULL) {
301                 rte_errno = ENOMEM;
302                 goto error;
303         }
304
305         tx_queues_local = rte_calloc_socket(name, nb_tx_queues,
306                                             sizeof(void *), 0, numa_node);
307         if (tx_queues_local == NULL) {
308                 rte_errno = ENOMEM;
309                 goto error;
310         }
311
312         internals = rte_zmalloc_socket(name, sizeof(*internals), 0, numa_node);
313         if (internals == NULL) {
314                 rte_errno = ENOMEM;
315                 goto error;
316         }
317
318         /* reserve an ethdev entry */
319         eth_dev = rte_eth_dev_allocate(name);
320         if (eth_dev == NULL) {
321                 rte_errno = ENOSPC;
322                 goto error;
323         }
324
325         /* now put it all together
326          * - store EAL device in eth_dev,
327          * - store queue data in internals,
328          * - store numa_node info in eth_dev_data
329          * - point eth_dev_data to internals
330          * - and point eth_dev structure to new eth_dev_data structure
331          */
332
333         eth_dev->device = &vdev->device;
334
335         data = eth_dev->data;
336         data->rx_queues = rx_queues_local;
337         data->tx_queues = tx_queues_local;
338
339         internals->action = action;
340         internals->max_rx_queues = nb_rx_queues;
341         internals->max_tx_queues = nb_tx_queues;
342         for (i = 0; i < nb_rx_queues; i++) {
343                 internals->rx_ring_queues[i].rng = rx_queues[i];
344                 data->rx_queues[i] = &internals->rx_ring_queues[i];
345         }
346         for (i = 0; i < nb_tx_queues; i++) {
347                 internals->tx_ring_queues[i].rng = tx_queues[i];
348                 data->tx_queues[i] = &internals->tx_ring_queues[i];
349         }
350
351         data->dev_private = internals;
352         data->nb_rx_queues = (uint16_t)nb_rx_queues;
353         data->nb_tx_queues = (uint16_t)nb_tx_queues;
354         data->dev_link = pmd_link;
355         data->mac_addrs = &internals->address;
356         data->promiscuous = 1;
357         data->all_multicast = 1;
358
359         eth_dev->dev_ops = &ops;
360         data->numa_node = numa_node;
361
362         /* finally assign rx and tx ops */
363         eth_dev->rx_pkt_burst = eth_ring_rx;
364         eth_dev->tx_pkt_burst = eth_ring_tx;
365
366         rte_eth_dev_probing_finish(eth_dev);
367         *eth_dev_p = eth_dev;
368
369         return data->port_id;
370
371 error:
372         rte_free(rx_queues_local);
373         rte_free(tx_queues_local);
374         rte_free(internals);
375
376         return -1;
377 }
378
379 int
380 rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
381                 const unsigned int nb_rx_queues,
382                 struct rte_ring *const tx_queues[],
383                 const unsigned int nb_tx_queues,
384                 const unsigned int numa_node)
385 {
386         struct ring_internal_args args = {
387                 .rx_queues = rx_queues,
388                 .nb_rx_queues = nb_rx_queues,
389                 .tx_queues = tx_queues,
390                 .nb_tx_queues = nb_tx_queues,
391                 .numa_node = numa_node,
392                 .addr = &args,
393         };
394         char args_str[32];
395         char ring_name[RTE_RING_NAMESIZE];
396         uint16_t port_id = RTE_MAX_ETHPORTS;
397         int ret;
398
399         /* do some parameter checking */
400         if (rx_queues == NULL && nb_rx_queues > 0) {
401                 rte_errno = EINVAL;
402                 return -1;
403         }
404         if (tx_queues == NULL && nb_tx_queues > 0) {
405                 rte_errno = EINVAL;
406                 return -1;
407         }
408         if (nb_rx_queues > RTE_PMD_RING_MAX_RX_RINGS) {
409                 rte_errno = EINVAL;
410                 return -1;
411         }
412
413         snprintf(args_str, sizeof(args_str), "%s=%p",
414                  ETH_RING_INTERNAL_ARG, &args);
415
416         ret = snprintf(ring_name, sizeof(ring_name), "net_ring_%s", name);
417         if (ret >= (int)sizeof(ring_name)) {
418                 rte_errno = ENAMETOOLONG;
419                 return -1;
420         }
421
422         ret = rte_vdev_init(ring_name, args_str);
423         if (ret) {
424                 rte_errno = EINVAL;
425                 return -1;
426         }
427
428         ret = rte_eth_dev_get_port_by_name(ring_name, &port_id);
429         if (ret) {
430                 rte_errno = ENODEV;
431                 return -1;
432         }
433
434         return port_id;
435 }
436
437 int
438 rte_eth_from_ring(struct rte_ring *r)
439 {
440         return rte_eth_from_rings(r->name, &r, 1, &r, 1,
441                         r->memzone ? r->memzone->socket_id : SOCKET_ID_ANY);
442 }
443
444 static int
445 eth_dev_ring_create(const char *name,
446                 struct rte_vdev_device *vdev,
447                 const unsigned int numa_node,
448                 enum dev_action action, struct rte_eth_dev **eth_dev)
449 {
450         /* rx and tx are so-called from point of view of first port.
451          * They are inverted from the point of view of second port
452          */
453         struct rte_ring *rxtx[RTE_PMD_RING_MAX_RX_RINGS];
454         unsigned int i;
455         char rng_name[RTE_RING_NAMESIZE];
456         unsigned int num_rings = RTE_MIN(RTE_PMD_RING_MAX_RX_RINGS,
457                         RTE_PMD_RING_MAX_TX_RINGS);
458
459         for (i = 0; i < num_rings; i++) {
460                 int cc;
461
462                 cc = snprintf(rng_name, sizeof(rng_name),
463                               "ETH_RXTX%u_%s", i, name);
464                 if (cc >= (int)sizeof(rng_name)) {
465                         rte_errno = ENAMETOOLONG;
466                         return -1;
467                 }
468
469                 rxtx[i] = (action == DEV_CREATE) ?
470                                 rte_ring_create(rng_name, 1024, numa_node,
471                                                 RING_F_SP_ENQ|RING_F_SC_DEQ) :
472                                 rte_ring_lookup(rng_name);
473                 if (rxtx[i] == NULL)
474                         return -1;
475         }
476
477         if (do_eth_dev_ring_create(name, vdev, rxtx, num_rings, rxtx, num_rings,
478                 numa_node, action, eth_dev) < 0)
479                 return -1;
480
481         return 0;
482 }
483
484 struct node_action_pair {
485         char name[PATH_MAX];
486         unsigned int node;
487         enum dev_action action;
488 };
489
490 struct node_action_list {
491         unsigned int total;
492         unsigned int count;
493         struct node_action_pair *list;
494 };
495
496 static int parse_kvlist(const char *key __rte_unused,
497                         const char *value, void *data)
498 {
499         struct node_action_list *info = data;
500         int ret;
501         char *name;
502         char *action;
503         char *node;
504         char *end;
505
506         name = strdup(value);
507
508         ret = -EINVAL;
509
510         if (!name) {
511                 PMD_LOG(WARNING, "command line parameter is empty for ring pmd!");
512                 goto out;
513         }
514
515         node = strchr(name, ':');
516         if (!node) {
517                 PMD_LOG(WARNING, "could not parse node value from %s",
518                         name);
519                 goto out;
520         }
521
522         *node = '\0';
523         node++;
524
525         action = strchr(node, ':');
526         if (!action) {
527                 PMD_LOG(WARNING, "could not parse action value from %s",
528                         node);
529                 goto out;
530         }
531
532         *action = '\0';
533         action++;
534
535         /*
536          * Need to do some sanity checking here
537          */
538
539         if (strcmp(action, ETH_RING_ACTION_ATTACH) == 0)
540                 info->list[info->count].action = DEV_ATTACH;
541         else if (strcmp(action, ETH_RING_ACTION_CREATE) == 0)
542                 info->list[info->count].action = DEV_CREATE;
543         else
544                 goto out;
545
546         errno = 0;
547         info->list[info->count].node = strtol(node, &end, 10);
548
549         if ((errno != 0) || (*end != '\0')) {
550                 PMD_LOG(WARNING,
551                         "node value %s is unparseable as a number", node);
552                 goto out;
553         }
554
555         strlcpy(info->list[info->count].name, name,
556                 sizeof(info->list[info->count].name));
557
558         info->count++;
559
560         ret = 0;
561 out:
562         free(name);
563         return ret;
564 }
565
566 static int
567 parse_internal_args(const char *key __rte_unused, const char *value,
568                 void *data)
569 {
570         struct ring_internal_args **internal_args = data;
571         void *args;
572
573         sscanf(value, "%p", &args);
574
575         *internal_args = args;
576
577         if ((*internal_args)->addr != args)
578                 return -1;
579
580         return 0;
581 }
582
583 static int
584 rte_pmd_ring_probe(struct rte_vdev_device *dev)
585 {
586         const char *name, *params;
587         struct rte_kvargs *kvlist = NULL;
588         int ret = 0;
589         struct node_action_list *info = NULL;
590         struct rte_eth_dev *eth_dev = NULL;
591         struct ring_internal_args *internal_args;
592
593         name = rte_vdev_device_name(dev);
594         params = rte_vdev_device_args(dev);
595
596         PMD_LOG(INFO, "Initializing pmd_ring for %s", name);
597
598         if (params == NULL || params[0] == '\0') {
599                 ret = eth_dev_ring_create(name, dev, rte_socket_id(), DEV_CREATE,
600                                 &eth_dev);
601                 if (ret == -1) {
602                         PMD_LOG(INFO,
603                                 "Attach to pmd_ring for %s", name);
604                         ret = eth_dev_ring_create(name, dev, rte_socket_id(),
605                                                   DEV_ATTACH, &eth_dev);
606                 }
607         } else {
608                 kvlist = rte_kvargs_parse(params, valid_arguments);
609
610                 if (!kvlist) {
611                         PMD_LOG(INFO,
612                                 "Ignoring unsupported parameters when creatingrings-backed ethernet device");
613                         ret = eth_dev_ring_create(name, dev, rte_socket_id(),
614                                                   DEV_CREATE, &eth_dev);
615                         if (ret == -1) {
616                                 PMD_LOG(INFO,
617                                         "Attach to pmd_ring for %s",
618                                         name);
619                                 ret = eth_dev_ring_create(name, dev, rte_socket_id(),
620                                                           DEV_ATTACH, &eth_dev);
621                         }
622
623                         return ret;
624                 }
625
626                 if (rte_kvargs_count(kvlist, ETH_RING_INTERNAL_ARG) == 1) {
627                         ret = rte_kvargs_process(kvlist, ETH_RING_INTERNAL_ARG,
628                                                  parse_internal_args,
629                                                  &internal_args);
630                         if (ret < 0)
631                                 goto out_free;
632
633                         ret = do_eth_dev_ring_create(name, dev,
634                                 internal_args->rx_queues,
635                                 internal_args->nb_rx_queues,
636                                 internal_args->tx_queues,
637                                 internal_args->nb_tx_queues,
638                                 internal_args->numa_node,
639                                 DEV_ATTACH,
640                                 &eth_dev);
641                         if (ret >= 0)
642                                 ret = 0;
643                 } else {
644                         ret = rte_kvargs_count(kvlist, ETH_RING_NUMA_NODE_ACTION_ARG);
645                         info = rte_zmalloc("struct node_action_list",
646                                            sizeof(struct node_action_list) +
647                                            (sizeof(struct node_action_pair) * ret),
648                                            0);
649                         if (!info)
650                                 goto out_free;
651
652                         info->total = ret;
653                         info->list = (struct node_action_pair *)(info + 1);
654
655                         ret = rte_kvargs_process(kvlist, ETH_RING_NUMA_NODE_ACTION_ARG,
656                                                  parse_kvlist, info);
657
658                         if (ret < 0)
659                                 goto out_free;
660
661                         for (info->count = 0; info->count < info->total; info->count++) {
662                                 ret = eth_dev_ring_create(info->list[info->count].name,
663                                                           dev,
664                                                           info->list[info->count].node,
665                                                           info->list[info->count].action,
666                                                           &eth_dev);
667                                 if ((ret == -1) &&
668                                     (info->list[info->count].action == DEV_CREATE)) {
669                                         PMD_LOG(INFO,
670                                                 "Attach to pmd_ring for %s",
671                                                 name);
672                                         ret = eth_dev_ring_create(name, dev,
673                                                         info->list[info->count].node,
674                                                         DEV_ATTACH,
675                                                         &eth_dev);
676                                 }
677                         }
678                 }
679         }
680
681 out_free:
682         rte_kvargs_free(kvlist);
683         rte_free(info);
684         return ret;
685 }
686
687 static int
688 rte_pmd_ring_remove(struct rte_vdev_device *dev)
689 {
690         const char *name = rte_vdev_device_name(dev);
691         struct rte_eth_dev *eth_dev = NULL;
692
693         PMD_LOG(INFO, "Un-Initializing pmd_ring for %s", name);
694
695         if (name == NULL)
696                 return -EINVAL;
697
698         /* find an ethdev entry */
699         eth_dev = rte_eth_dev_allocated(name);
700         if (eth_dev == NULL)
701                 return 0; /* port already released */
702
703         eth_dev_close(eth_dev);
704         rte_eth_dev_release_port(eth_dev);
705         return 0;
706 }
707
708 static struct rte_vdev_driver pmd_ring_drv = {
709         .probe = rte_pmd_ring_probe,
710         .remove = rte_pmd_ring_remove,
711 };
712
713 RTE_PMD_REGISTER_VDEV(net_ring, pmd_ring_drv);
714 RTE_PMD_REGISTER_ALIAS(net_ring, eth_ring);
715 RTE_PMD_REGISTER_PARAM_STRING(net_ring,
716         ETH_RING_NUMA_NODE_ACTION_ARG "=name:node:action(ATTACH|CREATE)");