net/softnic: implement start and stop
[dpdk.git] / drivers / net / softnic / rte_eth_softnic_internals.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2017 Intel Corporation
3  */
4
5 #ifndef __INCLUDE_RTE_ETH_SOFTNIC_INTERNALS_H__
6 #define __INCLUDE_RTE_ETH_SOFTNIC_INTERNALS_H__
7
8 #include <stddef.h>
9 #include <stdint.h>
10 #include <sys/queue.h>
11
12 #include <rte_mempool.h>
13 #include <rte_mbuf.h>
14 #include <rte_ring.h>
15 #include <rte_ethdev.h>
16 #include <rte_sched.h>
17 #include <rte_port_in_action.h>
18 #include <rte_table_action.h>
19 #include <rte_pipeline.h>
20
21 #include <rte_ethdev_driver.h>
22 #include <rte_tm_driver.h>
23
24 #include "rte_eth_softnic.h"
25 #include "conn.h"
26
27 #define NAME_SIZE                                            64
28
29 /**
30  * PMD Parameters
31  */
32
33 struct pmd_params {
34         const char *name;
35         const char *firmware;
36         uint16_t conn_port;
37         uint32_t cpu_id;
38
39         /** Traffic Management (TM) */
40         struct {
41                 uint32_t n_queues; /**< Number of queues */
42                 uint16_t qsize[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
43         } tm;
44 };
45
46 /**
47  * MEMPOOL
48  */
49 struct softnic_mempool_params {
50         uint32_t buffer_size;
51         uint32_t pool_size;
52         uint32_t cache_size;
53 };
54
55 struct softnic_mempool {
56         TAILQ_ENTRY(softnic_mempool) node;
57         char name[NAME_SIZE];
58         struct rte_mempool *m;
59         uint32_t buffer_size;
60 };
61
62 TAILQ_HEAD(softnic_mempool_list, softnic_mempool);
63
64 /**
65  * SWQ
66  */
67 struct softnic_swq_params {
68         uint32_t size;
69 };
70
71 struct softnic_swq {
72         TAILQ_ENTRY(softnic_swq) node;
73         char name[NAME_SIZE];
74         struct rte_ring *r;
75 };
76
77 TAILQ_HEAD(softnic_swq_list, softnic_swq);
78
79 /**
80  * LINK
81  */
82 struct softnic_link_params {
83         const char *dev_name;
84         uint16_t port_id; /**< Valid only when *dev_name* is NULL. */
85 };
86
87 struct softnic_link {
88         TAILQ_ENTRY(softnic_link) node;
89         char name[NAME_SIZE];
90         uint16_t port_id;
91         uint32_t n_rxq;
92         uint32_t n_txq;
93 };
94
95 TAILQ_HEAD(softnic_link_list, softnic_link);
96
97 /**
98  * TMGR
99  */
100
101 #ifndef TM_MAX_SUBPORTS
102 #define TM_MAX_SUBPORTS                                 8
103 #endif
104
105 #ifndef TM_MAX_PIPES_PER_SUBPORT
106 #define TM_MAX_PIPES_PER_SUBPORT                        4096
107 #endif
108
109 struct tm_params {
110         struct rte_sched_port_params port_params;
111
112         struct rte_sched_subport_params subport_params[TM_MAX_SUBPORTS];
113
114         struct rte_sched_pipe_params
115                 pipe_profiles[RTE_SCHED_PIPE_PROFILES_PER_PORT];
116         uint32_t n_pipe_profiles;
117         uint32_t pipe_to_profile[TM_MAX_SUBPORTS * TM_MAX_PIPES_PER_SUBPORT];
118 };
119
120 /* TM Levels */
121 enum tm_node_level {
122         TM_NODE_LEVEL_PORT = 0,
123         TM_NODE_LEVEL_SUBPORT,
124         TM_NODE_LEVEL_PIPE,
125         TM_NODE_LEVEL_TC,
126         TM_NODE_LEVEL_QUEUE,
127         TM_NODE_LEVEL_MAX,
128 };
129
130 /* TM Shaper Profile */
131 struct tm_shaper_profile {
132         TAILQ_ENTRY(tm_shaper_profile) node;
133         uint32_t shaper_profile_id;
134         uint32_t n_users;
135         struct rte_tm_shaper_params params;
136 };
137
138 TAILQ_HEAD(tm_shaper_profile_list, tm_shaper_profile);
139
140 /* TM Shared Shaper */
141 struct tm_shared_shaper {
142         TAILQ_ENTRY(tm_shared_shaper) node;
143         uint32_t shared_shaper_id;
144         uint32_t n_users;
145         uint32_t shaper_profile_id;
146 };
147
148 TAILQ_HEAD(tm_shared_shaper_list, tm_shared_shaper);
149
150 /* TM WRED Profile */
151 struct tm_wred_profile {
152         TAILQ_ENTRY(tm_wred_profile) node;
153         uint32_t wred_profile_id;
154         uint32_t n_users;
155         struct rte_tm_wred_params params;
156 };
157
158 TAILQ_HEAD(tm_wred_profile_list, tm_wred_profile);
159
160 /* TM Node */
161 struct tm_node {
162         TAILQ_ENTRY(tm_node) node;
163         uint32_t node_id;
164         uint32_t parent_node_id;
165         uint32_t priority;
166         uint32_t weight;
167         uint32_t level;
168         struct tm_node *parent_node;
169         struct tm_shaper_profile *shaper_profile;
170         struct tm_wred_profile *wred_profile;
171         struct rte_tm_node_params params;
172         struct rte_tm_node_stats stats;
173         uint32_t n_children;
174 };
175
176 TAILQ_HEAD(tm_node_list, tm_node);
177
178 /* TM Hierarchy Specification */
179 struct tm_hierarchy {
180         struct tm_shaper_profile_list shaper_profiles;
181         struct tm_shared_shaper_list shared_shapers;
182         struct tm_wred_profile_list wred_profiles;
183         struct tm_node_list nodes;
184
185         uint32_t n_shaper_profiles;
186         uint32_t n_shared_shapers;
187         uint32_t n_wred_profiles;
188         uint32_t n_nodes;
189
190         uint32_t n_tm_nodes[TM_NODE_LEVEL_MAX];
191 };
192
193 struct tm_internals {
194         /** Hierarchy specification
195          *
196          *     -Hierarchy is unfrozen at init and when port is stopped.
197          *     -Hierarchy is frozen on successful hierarchy commit.
198          *     -Run-time hierarchy changes are not allowed, therefore it makes
199          *      sense to keep the hierarchy frozen after the port is started.
200          */
201         struct tm_hierarchy h;
202         int hierarchy_frozen;
203
204         /** Blueprints */
205         struct tm_params params;
206         struct rte_sched_port *sched;
207 };
208
209 struct softnic_tmgr_port {
210         TAILQ_ENTRY(softnic_tmgr_port) node;
211         char name[NAME_SIZE];
212         struct rte_sched_port *s;
213 };
214
215 TAILQ_HEAD(softnic_tmgr_port_list, softnic_tmgr_port);
216
217 /**
218  * TAP
219  */
220 struct softnic_tap {
221         TAILQ_ENTRY(softnic_tap) node;
222         char name[NAME_SIZE];
223         int fd;
224 };
225
226 TAILQ_HEAD(softnic_tap_list, softnic_tap);
227
228 /**
229  * Input port action
230  */
231 struct softnic_port_in_action_profile_params {
232         uint64_t action_mask;
233         struct rte_port_in_action_fltr_config fltr;
234         struct rte_port_in_action_lb_config lb;
235 };
236
237 struct softnic_port_in_action_profile {
238         TAILQ_ENTRY(softnic_port_in_action_profile) node;
239         char name[NAME_SIZE];
240         struct softnic_port_in_action_profile_params params;
241         struct rte_port_in_action_profile *ap;
242 };
243
244 TAILQ_HEAD(softnic_port_in_action_profile_list, softnic_port_in_action_profile);
245
246 /**
247  * Table action
248  */
249 struct softnic_table_action_profile_params {
250         uint64_t action_mask;
251         struct rte_table_action_common_config common;
252         struct rte_table_action_lb_config lb;
253         struct rte_table_action_mtr_config mtr;
254         struct rte_table_action_tm_config tm;
255         struct rte_table_action_encap_config encap;
256         struct rte_table_action_nat_config nat;
257         struct rte_table_action_ttl_config ttl;
258         struct rte_table_action_stats_config stats;
259 };
260
261 struct softnic_table_action_profile {
262         TAILQ_ENTRY(softnic_table_action_profile) node;
263         char name[NAME_SIZE];
264         struct softnic_table_action_profile_params params;
265         struct rte_table_action_profile *ap;
266 };
267
268 TAILQ_HEAD(softnic_table_action_profile_list, softnic_table_action_profile);
269
270 /**
271  * Pipeline
272  */
273 struct pipeline_params {
274         uint32_t timer_period_ms;
275         uint32_t offset_port_id;
276 };
277
278 enum softnic_port_in_type {
279         PORT_IN_RXQ,
280         PORT_IN_SWQ,
281         PORT_IN_TMGR,
282         PORT_IN_TAP,
283         PORT_IN_SOURCE,
284 };
285
286 struct softnic_port_in_params {
287         /* Read */
288         enum softnic_port_in_type type;
289         const char *dev_name;
290         union {
291                 struct {
292                         uint16_t queue_id;
293                 } rxq;
294
295                 struct {
296                         const char *mempool_name;
297                         uint32_t mtu;
298                 } tap;
299
300                 struct {
301                         const char *mempool_name;
302                         const char *file_name;
303                         uint32_t n_bytes_per_pkt;
304                 } source;
305         };
306         uint32_t burst_size;
307
308         /* Action */
309         const char *action_profile_name;
310 };
311
312 enum softnic_port_out_type {
313         PORT_OUT_TXQ,
314         PORT_OUT_SWQ,
315         PORT_OUT_TMGR,
316         PORT_OUT_TAP,
317         PORT_OUT_SINK,
318 };
319
320 struct softnic_port_out_params {
321         enum softnic_port_out_type type;
322         const char *dev_name;
323         union {
324                 struct {
325                         uint16_t queue_id;
326                 } txq;
327
328                 struct {
329                         const char *file_name;
330                         uint32_t max_n_pkts;
331                 } sink;
332         };
333         uint32_t burst_size;
334         int retry;
335         uint32_t n_retries;
336 };
337
338 enum softnic_table_type {
339         TABLE_ACL,
340         TABLE_ARRAY,
341         TABLE_HASH,
342         TABLE_LPM,
343         TABLE_STUB,
344 };
345
346 struct softnic_table_acl_params {
347         uint32_t n_rules;
348         uint32_t ip_header_offset;
349         int ip_version;
350 };
351
352 struct softnic_table_array_params {
353         uint32_t n_keys;
354         uint32_t key_offset;
355 };
356
357 struct softnic_table_hash_params {
358         uint32_t n_keys;
359         uint32_t key_offset;
360         uint32_t key_size;
361         uint8_t *key_mask;
362         uint32_t n_buckets;
363         int extendable_bucket;
364 };
365
366 struct softnic_table_lpm_params {
367         uint32_t n_rules;
368         uint32_t key_offset;
369         uint32_t key_size;
370 };
371
372 struct softnic_table_params {
373         /* Match */
374         enum softnic_table_type match_type;
375         union {
376                 struct softnic_table_acl_params acl;
377                 struct softnic_table_array_params array;
378                 struct softnic_table_hash_params hash;
379                 struct softnic_table_lpm_params lpm;
380         } match;
381
382         /* Action */
383         const char *action_profile_name;
384 };
385
386 struct softnic_port_in {
387         struct softnic_port_in_params params;
388         struct softnic_port_in_action_profile *ap;
389         struct rte_port_in_action *a;
390 };
391
392 struct softnic_table {
393         struct softnic_table_params params;
394         struct softnic_table_action_profile *ap;
395         struct rte_table_action *a;
396 };
397
398 struct pipeline {
399         TAILQ_ENTRY(pipeline) node;
400         char name[NAME_SIZE];
401
402         struct rte_pipeline *p;
403         struct softnic_port_in port_in[RTE_PIPELINE_PORT_IN_MAX];
404         struct softnic_table table[RTE_PIPELINE_TABLE_MAX];
405         uint32_t n_ports_in;
406         uint32_t n_ports_out;
407         uint32_t n_tables;
408
409         struct rte_ring *msgq_req;
410         struct rte_ring *msgq_rsp;
411         uint32_t timer_period_ms;
412
413         int enabled;
414         uint32_t thread_id;
415         uint32_t cpu_id;
416 };
417
418 TAILQ_HEAD(pipeline_list, pipeline);
419
420 /**
421  * Thread
422  */
423 #ifndef THREAD_PIPELINES_MAX
424 #define THREAD_PIPELINES_MAX                               256
425 #endif
426
427 #ifndef THREAD_MSGQ_SIZE
428 #define THREAD_MSGQ_SIZE                                   64
429 #endif
430
431 #ifndef THREAD_TIMER_PERIOD_MS
432 #define THREAD_TIMER_PERIOD_MS                             100
433 #endif
434
435 /**
436  * Master thead: data plane thread context
437  */
438 struct softnic_thread {
439         struct rte_ring *msgq_req;
440         struct rte_ring *msgq_rsp;
441
442         uint32_t enabled;
443 };
444
445 /**
446  * Data plane threads: context
447  */
448 #ifndef TABLE_RULE_ACTION_SIZE_MAX
449 #define TABLE_RULE_ACTION_SIZE_MAX                         2048
450 #endif
451
452 struct softnic_table_data {
453         struct rte_table_action *a;
454 };
455
456 struct pipeline_data {
457         struct rte_pipeline *p;
458         struct softnic_table_data table_data[RTE_PIPELINE_TABLE_MAX];
459         uint32_t n_tables;
460
461         struct rte_ring *msgq_req;
462         struct rte_ring *msgq_rsp;
463         uint64_t timer_period; /* Measured in CPU cycles. */
464         uint64_t time_next;
465
466         uint8_t buffer[TABLE_RULE_ACTION_SIZE_MAX];
467 };
468
469 struct softnic_thread_data {
470         struct rte_pipeline *p[THREAD_PIPELINES_MAX];
471         uint32_t n_pipelines;
472
473         struct pipeline_data pipeline_data[THREAD_PIPELINES_MAX];
474         struct rte_ring *msgq_req;
475         struct rte_ring *msgq_rsp;
476         uint64_t timer_period; /* Measured in CPU cycles. */
477         uint64_t time_next;
478         uint64_t time_next_min;
479         uint64_t iter;
480 } __rte_cache_aligned;
481
482 /**
483  * PMD Internals
484  */
485 struct pmd_internals {
486         /** Params */
487         struct pmd_params params;
488
489         struct {
490                 struct tm_internals tm; /**< Traffic Management */
491         } soft;
492
493         struct softnic_conn *conn;
494         struct softnic_mempool_list mempool_list;
495         struct softnic_swq_list swq_list;
496         struct softnic_link_list link_list;
497         struct softnic_tmgr_port_list tmgr_port_list;
498         struct softnic_tap_list tap_list;
499         struct softnic_port_in_action_profile_list port_in_action_profile_list;
500         struct softnic_table_action_profile_list table_action_profile_list;
501         struct pipeline_list pipeline_list;
502         struct softnic_thread thread[RTE_MAX_LCORE];
503         struct softnic_thread_data thread_data[RTE_MAX_LCORE];
504 };
505
506 /**
507  * MEMPOOL
508  */
509 int
510 softnic_mempool_init(struct pmd_internals *p);
511
512 void
513 softnic_mempool_free(struct pmd_internals *p);
514
515 struct softnic_mempool *
516 softnic_mempool_find(struct pmd_internals *p,
517         const char *name);
518
519 struct softnic_mempool *
520 softnic_mempool_create(struct pmd_internals *p,
521         const char *name,
522         struct softnic_mempool_params *params);
523
524 /**
525  * SWQ
526  */
527 int
528 softnic_swq_init(struct pmd_internals *p);
529
530 void
531 softnic_swq_free(struct pmd_internals *p);
532
533 void
534 softnic_softnic_swq_free_keep_rxq_txq(struct pmd_internals *p);
535
536 struct softnic_swq *
537 softnic_swq_find(struct pmd_internals *p,
538         const char *name);
539
540 struct softnic_swq *
541 softnic_swq_create(struct pmd_internals *p,
542         const char *name,
543         struct softnic_swq_params *params);
544
545 /**
546  * LINK
547  */
548 int
549 softnic_link_init(struct pmd_internals *p);
550
551 void
552 softnic_link_free(struct pmd_internals *p);
553
554 struct softnic_link *
555 softnic_link_find(struct pmd_internals *p,
556         const char *name);
557
558 struct softnic_link *
559 softnic_link_create(struct pmd_internals *p,
560         const char *name,
561         struct softnic_link_params *params);
562
563 /**
564  * TMGR
565  */
566 int
567 softnic_tmgr_init(struct pmd_internals *p);
568
569 void
570 softnic_tmgr_free(struct pmd_internals *p);
571
572 struct softnic_tmgr_port *
573 softnic_tmgr_port_find(struct pmd_internals *p,
574         const char *name);
575
576 struct softnic_tmgr_port *
577 softnic_tmgr_port_create(struct pmd_internals *p,
578         const char *name,
579         struct rte_sched_port *sched);
580
581 int
582 tm_init(struct pmd_internals *p);
583
584 void
585 tm_free(struct pmd_internals *p);
586
587 int
588 tm_start(struct pmd_internals *p);
589
590 void
591 tm_stop(struct pmd_internals *p);
592
593 static inline int
594 tm_used(struct rte_eth_dev *dev)
595 {
596         struct pmd_internals *p = dev->data->dev_private;
597
598         return p->soft.tm.h.n_tm_nodes[TM_NODE_LEVEL_PORT];
599 }
600
601 extern const struct rte_tm_ops pmd_tm_ops;
602
603 /**
604  * TAP
605  */
606 int
607 softnic_tap_init(struct pmd_internals *p);
608
609 void
610 softnic_tap_free(struct pmd_internals *p);
611
612 struct softnic_tap *
613 softnic_tap_find(struct pmd_internals *p,
614         const char *name);
615
616 struct softnic_tap *
617 softnic_tap_create(struct pmd_internals *p,
618         const char *name);
619
620 /**
621  * Input port action
622  */
623 int
624 softnic_port_in_action_profile_init(struct pmd_internals *p);
625
626 void
627 softnic_port_in_action_profile_free(struct pmd_internals *p);
628
629 struct softnic_port_in_action_profile *
630 softnic_port_in_action_profile_find(struct pmd_internals *p,
631         const char *name);
632
633 struct softnic_port_in_action_profile *
634 softnic_port_in_action_profile_create(struct pmd_internals *p,
635         const char *name,
636         struct softnic_port_in_action_profile_params *params);
637
638 /**
639  * Table action
640  */
641 int
642 softnic_table_action_profile_init(struct pmd_internals *p);
643
644 void
645 softnic_table_action_profile_free(struct pmd_internals *p);
646
647 struct softnic_table_action_profile *
648 softnic_table_action_profile_find(struct pmd_internals *p,
649         const char *name);
650
651 struct softnic_table_action_profile *
652 softnic_table_action_profile_create(struct pmd_internals *p,
653         const char *name,
654         struct softnic_table_action_profile_params *params);
655
656 /**
657  * Pipeline
658  */
659 int
660 softnic_pipeline_init(struct pmd_internals *p);
661
662 void
663 softnic_pipeline_free(struct pmd_internals *p);
664
665 void
666 softnic_pipeline_disable_all(struct pmd_internals *p);
667
668 struct pipeline *
669 softnic_pipeline_find(struct pmd_internals *p, const char *name);
670
671 struct pipeline *
672 softnic_pipeline_create(struct pmd_internals *p,
673         const char *name,
674         struct pipeline_params *params);
675
676 int
677 softnic_pipeline_port_in_create(struct pmd_internals *p,
678         const char *pipeline_name,
679         struct softnic_port_in_params *params,
680         int enabled);
681
682 int
683 softnic_pipeline_port_in_connect_to_table(struct pmd_internals *p,
684         const char *pipeline_name,
685         uint32_t port_id,
686         uint32_t table_id);
687
688 int
689 softnic_pipeline_port_out_create(struct pmd_internals *p,
690         const char *pipeline_name,
691         struct softnic_port_out_params *params);
692
693 int
694 softnic_pipeline_table_create(struct pmd_internals *p,
695         const char *pipeline_name,
696         struct softnic_table_params *params);
697
698 struct softnic_table_rule_match_acl {
699         int ip_version;
700
701         RTE_STD_C11
702         union {
703                 struct {
704                         uint32_t sa;
705                         uint32_t da;
706                 } ipv4;
707
708                 struct {
709                         uint8_t sa[16];
710                         uint8_t da[16];
711                 } ipv6;
712         };
713
714         uint32_t sa_depth;
715         uint32_t da_depth;
716         uint16_t sp0;
717         uint16_t sp1;
718         uint16_t dp0;
719         uint16_t dp1;
720         uint8_t proto;
721         uint8_t proto_mask;
722         uint32_t priority;
723 };
724
725 struct softnic_table_rule_match_array {
726         uint32_t pos;
727 };
728
729 #ifndef TABLE_RULE_MATCH_SIZE_MAX
730 #define TABLE_RULE_MATCH_SIZE_MAX                          256
731 #endif
732
733 struct softnic_table_rule_match_hash {
734         uint8_t key[TABLE_RULE_MATCH_SIZE_MAX];
735 };
736
737 struct softnic_table_rule_match_lpm {
738         int ip_version;
739
740         RTE_STD_C11
741         union {
742                 uint32_t ipv4;
743                 uint8_t ipv6[16];
744         };
745
746         uint8_t depth;
747 };
748
749 struct softnic_table_rule_match {
750         enum softnic_table_type match_type;
751
752         union {
753                 struct softnic_table_rule_match_acl acl;
754                 struct softnic_table_rule_match_array array;
755                 struct softnic_table_rule_match_hash hash;
756                 struct softnic_table_rule_match_lpm lpm;
757         } match;
758 };
759
760 struct softnic_table_rule_action {
761         uint64_t action_mask;
762         struct rte_table_action_fwd_params fwd;
763         struct rte_table_action_lb_params lb;
764         struct rte_table_action_mtr_params mtr;
765         struct rte_table_action_tm_params tm;
766         struct rte_table_action_encap_params encap;
767         struct rte_table_action_nat_params nat;
768         struct rte_table_action_ttl_params ttl;
769         struct rte_table_action_stats_params stats;
770         struct rte_table_action_time_params time;
771 };
772
773 int
774 softnic_pipeline_port_in_stats_read(struct pmd_internals *p,
775         const char *pipeline_name,
776         uint32_t port_id,
777         struct rte_pipeline_port_in_stats *stats,
778         int clear);
779
780 int
781 softnic_pipeline_port_in_enable(struct pmd_internals *p,
782         const char *pipeline_name,
783         uint32_t port_id);
784
785 int
786 softnic_pipeline_port_in_disable(struct pmd_internals *p,
787         const char *pipeline_name,
788         uint32_t port_id);
789
790 int
791 softnic_pipeline_port_out_stats_read(struct pmd_internals *p,
792         const char *pipeline_name,
793         uint32_t port_id,
794         struct rte_pipeline_port_out_stats *stats,
795         int clear);
796
797 int
798 softnic_pipeline_table_stats_read(struct pmd_internals *p,
799         const char *pipeline_name,
800         uint32_t table_id,
801         struct rte_pipeline_table_stats *stats,
802         int clear);
803
804 int
805 softnic_pipeline_table_rule_add(struct pmd_internals *p,
806         const char *pipeline_name,
807         uint32_t table_id,
808         struct softnic_table_rule_match *match,
809         struct softnic_table_rule_action *action,
810         void **data);
811
812 int
813 softnic_pipeline_table_rule_add_bulk(struct pmd_internals *p,
814         const char *pipeline_name,
815         uint32_t table_id,
816         struct softnic_table_rule_match *match,
817         struct softnic_table_rule_action *action,
818         void **data,
819         uint32_t *n_rules);
820
821 int
822 softnic_pipeline_table_rule_add_default(struct pmd_internals *p,
823         const char *pipeline_name,
824         uint32_t table_id,
825         struct softnic_table_rule_action *action,
826         void **data);
827
828 int
829 softnic_pipeline_table_rule_delete(struct pmd_internals *p,
830         const char *pipeline_name,
831         uint32_t table_id,
832         struct softnic_table_rule_match *match);
833
834 int
835 softnic_pipeline_table_rule_delete_default(struct pmd_internals *p,
836         const char *pipeline_name,
837         uint32_t table_id);
838
839 int
840 softnic_pipeline_table_rule_stats_read(struct pmd_internals *p,
841         const char *pipeline_name,
842         uint32_t table_id,
843         void *data,
844         struct rte_table_action_stats_counters *stats,
845         int clear);
846
847 int
848 softnic_pipeline_table_mtr_profile_add(struct pmd_internals *p,
849         const char *pipeline_name,
850         uint32_t table_id,
851         uint32_t meter_profile_id,
852         struct rte_table_action_meter_profile *profile);
853
854 int
855 softnic_pipeline_table_mtr_profile_delete(struct pmd_internals *p,
856         const char *pipeline_name,
857         uint32_t table_id,
858         uint32_t meter_profile_id);
859
860 int
861 softnic_pipeline_table_rule_mtr_read(struct pmd_internals *p,
862         const char *pipeline_name,
863         uint32_t table_id,
864         void *data,
865         uint32_t tc_mask,
866         struct rte_table_action_mtr_counters *stats,
867         int clear);
868
869 int
870 softnic_pipeline_table_dscp_table_update(struct pmd_internals *p,
871         const char *pipeline_name,
872         uint32_t table_id,
873         uint64_t dscp_mask,
874         struct rte_table_action_dscp_table *dscp_table);
875
876 int
877 softnic_pipeline_table_rule_ttl_read(struct pmd_internals *p,
878         const char *pipeline_name,
879         uint32_t table_id,
880         void *data,
881         struct rte_table_action_ttl_counters *stats,
882         int clear);
883
884 /**
885  * Thread
886  */
887 int
888 softnic_thread_init(struct pmd_internals *p);
889
890 void
891 softnic_thread_free(struct pmd_internals *p);
892
893 int
894 softnic_thread_pipeline_enable(struct pmd_internals *p,
895         uint32_t thread_id,
896         const char *pipeline_name);
897
898 int
899 softnic_thread_pipeline_disable(struct pmd_internals *p,
900         uint32_t thread_id,
901         const char *pipeline_name);
902
903 /**
904  * CLI
905  */
906 void
907 softnic_cli_process(char *in,
908         char *out,
909         size_t out_size,
910         void *arg);
911
912 int
913 softnic_cli_script_process(struct pmd_internals *softnic,
914         const char *file_name,
915         size_t msg_in_len_max,
916         size_t msg_out_len_max);
917
918 #endif /* __INCLUDE_RTE_ETH_SOFTNIC_INTERNALS_H__ */