New upstream version 18.08
[deb_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 };
207
208 struct softnic_tmgr_port {
209         TAILQ_ENTRY(softnic_tmgr_port) node;
210         char name[NAME_SIZE];
211         struct rte_sched_port *s;
212 };
213
214 TAILQ_HEAD(softnic_tmgr_port_list, softnic_tmgr_port);
215
216 /**
217  * TAP
218  */
219 struct softnic_tap {
220         TAILQ_ENTRY(softnic_tap) node;
221         char name[NAME_SIZE];
222         int fd;
223 };
224
225 TAILQ_HEAD(softnic_tap_list, softnic_tap);
226
227 /**
228  * Input port action
229  */
230 struct softnic_port_in_action_profile_params {
231         uint64_t action_mask;
232         struct rte_port_in_action_fltr_config fltr;
233         struct rte_port_in_action_lb_config lb;
234 };
235
236 struct softnic_port_in_action_profile {
237         TAILQ_ENTRY(softnic_port_in_action_profile) node;
238         char name[NAME_SIZE];
239         struct softnic_port_in_action_profile_params params;
240         struct rte_port_in_action_profile *ap;
241 };
242
243 TAILQ_HEAD(softnic_port_in_action_profile_list, softnic_port_in_action_profile);
244
245 /**
246  * Table action
247  */
248 struct softnic_table_action_profile_params {
249         uint64_t action_mask;
250         struct rte_table_action_common_config common;
251         struct rte_table_action_lb_config lb;
252         struct rte_table_action_mtr_config mtr;
253         struct rte_table_action_tm_config tm;
254         struct rte_table_action_encap_config encap;
255         struct rte_table_action_nat_config nat;
256         struct rte_table_action_ttl_config ttl;
257         struct rte_table_action_stats_config stats;
258 };
259
260 struct softnic_table_action_profile {
261         TAILQ_ENTRY(softnic_table_action_profile) node;
262         char name[NAME_SIZE];
263         struct softnic_table_action_profile_params params;
264         struct rte_table_action_profile *ap;
265 };
266
267 TAILQ_HEAD(softnic_table_action_profile_list, softnic_table_action_profile);
268
269 /**
270  * Pipeline
271  */
272 struct pipeline_params {
273         uint32_t timer_period_ms;
274         uint32_t offset_port_id;
275 };
276
277 enum softnic_port_in_type {
278         PORT_IN_RXQ,
279         PORT_IN_SWQ,
280         PORT_IN_TMGR,
281         PORT_IN_TAP,
282         PORT_IN_SOURCE,
283 };
284
285 struct softnic_port_in_params {
286         /* Read */
287         enum softnic_port_in_type type;
288         const char *dev_name;
289         union {
290                 struct {
291                         uint16_t queue_id;
292                 } rxq;
293
294                 struct {
295                         const char *mempool_name;
296                         uint32_t mtu;
297                 } tap;
298
299                 struct {
300                         const char *mempool_name;
301                         const char *file_name;
302                         uint32_t n_bytes_per_pkt;
303                 } source;
304         };
305         uint32_t burst_size;
306
307         /* Action */
308         const char *action_profile_name;
309 };
310
311 enum softnic_port_out_type {
312         PORT_OUT_TXQ,
313         PORT_OUT_SWQ,
314         PORT_OUT_TMGR,
315         PORT_OUT_TAP,
316         PORT_OUT_SINK,
317 };
318
319 struct softnic_port_out_params {
320         enum softnic_port_out_type type;
321         const char *dev_name;
322         union {
323                 struct {
324                         uint16_t queue_id;
325                 } txq;
326
327                 struct {
328                         const char *file_name;
329                         uint32_t max_n_pkts;
330                 } sink;
331         };
332         uint32_t burst_size;
333         int retry;
334         uint32_t n_retries;
335 };
336
337 enum softnic_table_type {
338         TABLE_ACL,
339         TABLE_ARRAY,
340         TABLE_HASH,
341         TABLE_LPM,
342         TABLE_STUB,
343 };
344
345 struct softnic_table_acl_params {
346         uint32_t n_rules;
347         uint32_t ip_header_offset;
348         int ip_version;
349 };
350
351 struct softnic_table_array_params {
352         uint32_t n_keys;
353         uint32_t key_offset;
354 };
355
356 struct softnic_table_hash_params {
357         uint32_t n_keys;
358         uint32_t key_offset;
359         uint32_t key_size;
360         uint8_t *key_mask;
361         uint32_t n_buckets;
362         int extendable_bucket;
363 };
364
365 struct softnic_table_lpm_params {
366         uint32_t n_rules;
367         uint32_t key_offset;
368         uint32_t key_size;
369 };
370
371 struct softnic_table_params {
372         /* Match */
373         enum softnic_table_type match_type;
374         union {
375                 struct softnic_table_acl_params acl;
376                 struct softnic_table_array_params array;
377                 struct softnic_table_hash_params hash;
378                 struct softnic_table_lpm_params lpm;
379         } match;
380
381         /* Action */
382         const char *action_profile_name;
383 };
384
385 struct softnic_port_in {
386         struct softnic_port_in_params params;
387         struct softnic_port_in_action_profile *ap;
388         struct rte_port_in_action *a;
389 };
390
391 struct softnic_table {
392         struct softnic_table_params params;
393         struct softnic_table_action_profile *ap;
394         struct rte_table_action *a;
395 };
396
397 struct pipeline {
398         TAILQ_ENTRY(pipeline) node;
399         char name[NAME_SIZE];
400
401         struct rte_pipeline *p;
402         struct softnic_port_in port_in[RTE_PIPELINE_PORT_IN_MAX];
403         struct softnic_table table[RTE_PIPELINE_TABLE_MAX];
404         uint32_t n_ports_in;
405         uint32_t n_ports_out;
406         uint32_t n_tables;
407
408         struct rte_ring *msgq_req;
409         struct rte_ring *msgq_rsp;
410         uint32_t timer_period_ms;
411
412         int enabled;
413         uint32_t thread_id;
414         uint32_t cpu_id;
415 };
416
417 TAILQ_HEAD(pipeline_list, pipeline);
418
419 /**
420  * Thread
421  */
422 #ifndef THREAD_PIPELINES_MAX
423 #define THREAD_PIPELINES_MAX                               256
424 #endif
425
426 #ifndef THREAD_MSGQ_SIZE
427 #define THREAD_MSGQ_SIZE                                   64
428 #endif
429
430 #ifndef THREAD_TIMER_PERIOD_MS
431 #define THREAD_TIMER_PERIOD_MS                             100
432 #endif
433
434 /**
435  * Master thead: data plane thread context
436  */
437 struct softnic_thread {
438         struct rte_ring *msgq_req;
439         struct rte_ring *msgq_rsp;
440
441         uint32_t enabled;
442 };
443
444 /**
445  * Data plane threads: context
446  */
447 #ifndef TABLE_RULE_ACTION_SIZE_MAX
448 #define TABLE_RULE_ACTION_SIZE_MAX                         2048
449 #endif
450
451 struct softnic_table_data {
452         struct rte_table_action *a;
453 };
454
455 struct pipeline_data {
456         struct rte_pipeline *p;
457         struct softnic_table_data table_data[RTE_PIPELINE_TABLE_MAX];
458         uint32_t n_tables;
459
460         struct rte_ring *msgq_req;
461         struct rte_ring *msgq_rsp;
462         uint64_t timer_period; /* Measured in CPU cycles. */
463         uint64_t time_next;
464
465         uint8_t buffer[TABLE_RULE_ACTION_SIZE_MAX];
466 };
467
468 struct softnic_thread_data {
469         struct rte_pipeline *p[THREAD_PIPELINES_MAX];
470         uint32_t n_pipelines;
471
472         struct pipeline_data pipeline_data[THREAD_PIPELINES_MAX];
473         struct rte_ring *msgq_req;
474         struct rte_ring *msgq_rsp;
475         uint64_t timer_period; /* Measured in CPU cycles. */
476         uint64_t time_next;
477         uint64_t time_next_min;
478         uint64_t iter;
479 } __rte_cache_aligned;
480
481 /**
482  * PMD Internals
483  */
484 struct pmd_internals {
485         /** Params */
486         struct pmd_params params;
487
488         struct {
489                 struct tm_internals tm; /**< Traffic Management */
490         } soft;
491
492         struct softnic_conn *conn;
493         struct softnic_mempool_list mempool_list;
494         struct softnic_swq_list swq_list;
495         struct softnic_link_list link_list;
496         struct softnic_tmgr_port_list tmgr_port_list;
497         struct softnic_tap_list tap_list;
498         struct softnic_port_in_action_profile_list port_in_action_profile_list;
499         struct softnic_table_action_profile_list table_action_profile_list;
500         struct pipeline_list pipeline_list;
501         struct softnic_thread thread[RTE_MAX_LCORE];
502         struct softnic_thread_data thread_data[RTE_MAX_LCORE];
503 };
504
505 /**
506  * MEMPOOL
507  */
508 int
509 softnic_mempool_init(struct pmd_internals *p);
510
511 void
512 softnic_mempool_free(struct pmd_internals *p);
513
514 struct softnic_mempool *
515 softnic_mempool_find(struct pmd_internals *p,
516         const char *name);
517
518 struct softnic_mempool *
519 softnic_mempool_create(struct pmd_internals *p,
520         const char *name,
521         struct softnic_mempool_params *params);
522
523 /**
524  * SWQ
525  */
526 int
527 softnic_swq_init(struct pmd_internals *p);
528
529 void
530 softnic_swq_free(struct pmd_internals *p);
531
532 void
533 softnic_softnic_swq_free_keep_rxq_txq(struct pmd_internals *p);
534
535 struct softnic_swq *
536 softnic_swq_find(struct pmd_internals *p,
537         const char *name);
538
539 struct softnic_swq *
540 softnic_swq_create(struct pmd_internals *p,
541         const char *name,
542         struct softnic_swq_params *params);
543
544 /**
545  * LINK
546  */
547 int
548 softnic_link_init(struct pmd_internals *p);
549
550 void
551 softnic_link_free(struct pmd_internals *p);
552
553 struct softnic_link *
554 softnic_link_find(struct pmd_internals *p,
555         const char *name);
556
557 struct softnic_link *
558 softnic_link_create(struct pmd_internals *p,
559         const char *name,
560         struct softnic_link_params *params);
561
562 /**
563  * TMGR
564  */
565 int
566 softnic_tmgr_init(struct pmd_internals *p);
567
568 void
569 softnic_tmgr_free(struct pmd_internals *p);
570
571 struct softnic_tmgr_port *
572 softnic_tmgr_port_find(struct pmd_internals *p,
573         const char *name);
574
575 struct softnic_tmgr_port *
576 softnic_tmgr_port_create(struct pmd_internals *p,
577         const char *name);
578
579 void
580 tm_hierarchy_init(struct pmd_internals *p);
581
582 void
583 tm_hierarchy_free(struct pmd_internals *p);
584
585 static inline int
586 tm_used(struct rte_eth_dev *dev)
587 {
588         struct pmd_internals *p = dev->data->dev_private;
589
590         return p->soft.tm.h.n_tm_nodes[TM_NODE_LEVEL_PORT];
591 }
592
593 extern const struct rte_tm_ops pmd_tm_ops;
594
595 /**
596  * TAP
597  */
598 int
599 softnic_tap_init(struct pmd_internals *p);
600
601 void
602 softnic_tap_free(struct pmd_internals *p);
603
604 struct softnic_tap *
605 softnic_tap_find(struct pmd_internals *p,
606         const char *name);
607
608 struct softnic_tap *
609 softnic_tap_create(struct pmd_internals *p,
610         const char *name);
611
612 /**
613  * Input port action
614  */
615 int
616 softnic_port_in_action_profile_init(struct pmd_internals *p);
617
618 void
619 softnic_port_in_action_profile_free(struct pmd_internals *p);
620
621 struct softnic_port_in_action_profile *
622 softnic_port_in_action_profile_find(struct pmd_internals *p,
623         const char *name);
624
625 struct softnic_port_in_action_profile *
626 softnic_port_in_action_profile_create(struct pmd_internals *p,
627         const char *name,
628         struct softnic_port_in_action_profile_params *params);
629
630 /**
631  * Table action
632  */
633 int
634 softnic_table_action_profile_init(struct pmd_internals *p);
635
636 void
637 softnic_table_action_profile_free(struct pmd_internals *p);
638
639 struct softnic_table_action_profile *
640 softnic_table_action_profile_find(struct pmd_internals *p,
641         const char *name);
642
643 struct softnic_table_action_profile *
644 softnic_table_action_profile_create(struct pmd_internals *p,
645         const char *name,
646         struct softnic_table_action_profile_params *params);
647
648 /**
649  * Pipeline
650  */
651 int
652 softnic_pipeline_init(struct pmd_internals *p);
653
654 void
655 softnic_pipeline_free(struct pmd_internals *p);
656
657 void
658 softnic_pipeline_disable_all(struct pmd_internals *p);
659
660 struct pipeline *
661 softnic_pipeline_find(struct pmd_internals *p, const char *name);
662
663 struct pipeline *
664 softnic_pipeline_create(struct pmd_internals *p,
665         const char *name,
666         struct pipeline_params *params);
667
668 int
669 softnic_pipeline_port_in_create(struct pmd_internals *p,
670         const char *pipeline_name,
671         struct softnic_port_in_params *params,
672         int enabled);
673
674 int
675 softnic_pipeline_port_in_connect_to_table(struct pmd_internals *p,
676         const char *pipeline_name,
677         uint32_t port_id,
678         uint32_t table_id);
679
680 int
681 softnic_pipeline_port_out_create(struct pmd_internals *p,
682         const char *pipeline_name,
683         struct softnic_port_out_params *params);
684
685 int
686 softnic_pipeline_table_create(struct pmd_internals *p,
687         const char *pipeline_name,
688         struct softnic_table_params *params);
689
690 struct softnic_table_rule_match_acl {
691         int ip_version;
692
693         RTE_STD_C11
694         union {
695                 struct {
696                         uint32_t sa;
697                         uint32_t da;
698                 } ipv4;
699
700                 struct {
701                         uint8_t sa[16];
702                         uint8_t da[16];
703                 } ipv6;
704         };
705
706         uint32_t sa_depth;
707         uint32_t da_depth;
708         uint16_t sp0;
709         uint16_t sp1;
710         uint16_t dp0;
711         uint16_t dp1;
712         uint8_t proto;
713         uint8_t proto_mask;
714         uint32_t priority;
715 };
716
717 struct softnic_table_rule_match_array {
718         uint32_t pos;
719 };
720
721 #ifndef TABLE_RULE_MATCH_SIZE_MAX
722 #define TABLE_RULE_MATCH_SIZE_MAX                          256
723 #endif
724
725 struct softnic_table_rule_match_hash {
726         uint8_t key[TABLE_RULE_MATCH_SIZE_MAX];
727 };
728
729 struct softnic_table_rule_match_lpm {
730         int ip_version;
731
732         RTE_STD_C11
733         union {
734                 uint32_t ipv4;
735                 uint8_t ipv6[16];
736         };
737
738         uint8_t depth;
739 };
740
741 struct softnic_table_rule_match {
742         enum softnic_table_type match_type;
743
744         union {
745                 struct softnic_table_rule_match_acl acl;
746                 struct softnic_table_rule_match_array array;
747                 struct softnic_table_rule_match_hash hash;
748                 struct softnic_table_rule_match_lpm lpm;
749         } match;
750 };
751
752 struct softnic_table_rule_action {
753         uint64_t action_mask;
754         struct rte_table_action_fwd_params fwd;
755         struct rte_table_action_lb_params lb;
756         struct rte_table_action_mtr_params mtr;
757         struct rte_table_action_tm_params tm;
758         struct rte_table_action_encap_params encap;
759         struct rte_table_action_nat_params nat;
760         struct rte_table_action_ttl_params ttl;
761         struct rte_table_action_stats_params stats;
762         struct rte_table_action_time_params time;
763 };
764
765 int
766 softnic_pipeline_port_in_stats_read(struct pmd_internals *p,
767         const char *pipeline_name,
768         uint32_t port_id,
769         struct rte_pipeline_port_in_stats *stats,
770         int clear);
771
772 int
773 softnic_pipeline_port_in_enable(struct pmd_internals *p,
774         const char *pipeline_name,
775         uint32_t port_id);
776
777 int
778 softnic_pipeline_port_in_disable(struct pmd_internals *p,
779         const char *pipeline_name,
780         uint32_t port_id);
781
782 int
783 softnic_pipeline_port_out_stats_read(struct pmd_internals *p,
784         const char *pipeline_name,
785         uint32_t port_id,
786         struct rte_pipeline_port_out_stats *stats,
787         int clear);
788
789 int
790 softnic_pipeline_table_stats_read(struct pmd_internals *p,
791         const char *pipeline_name,
792         uint32_t table_id,
793         struct rte_pipeline_table_stats *stats,
794         int clear);
795
796 int
797 softnic_pipeline_table_rule_add(struct pmd_internals *p,
798         const char *pipeline_name,
799         uint32_t table_id,
800         struct softnic_table_rule_match *match,
801         struct softnic_table_rule_action *action,
802         void **data);
803
804 int
805 softnic_pipeline_table_rule_add_bulk(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         uint32_t *n_rules);
812
813 int
814 softnic_pipeline_table_rule_add_default(struct pmd_internals *p,
815         const char *pipeline_name,
816         uint32_t table_id,
817         struct softnic_table_rule_action *action,
818         void **data);
819
820 int
821 softnic_pipeline_table_rule_delete(struct pmd_internals *p,
822         const char *pipeline_name,
823         uint32_t table_id,
824         struct softnic_table_rule_match *match);
825
826 int
827 softnic_pipeline_table_rule_delete_default(struct pmd_internals *p,
828         const char *pipeline_name,
829         uint32_t table_id);
830
831 int
832 softnic_pipeline_table_rule_stats_read(struct pmd_internals *p,
833         const char *pipeline_name,
834         uint32_t table_id,
835         void *data,
836         struct rte_table_action_stats_counters *stats,
837         int clear);
838
839 int
840 softnic_pipeline_table_mtr_profile_add(struct pmd_internals *p,
841         const char *pipeline_name,
842         uint32_t table_id,
843         uint32_t meter_profile_id,
844         struct rte_table_action_meter_profile *profile);
845
846 int
847 softnic_pipeline_table_mtr_profile_delete(struct pmd_internals *p,
848         const char *pipeline_name,
849         uint32_t table_id,
850         uint32_t meter_profile_id);
851
852 int
853 softnic_pipeline_table_rule_mtr_read(struct pmd_internals *p,
854         const char *pipeline_name,
855         uint32_t table_id,
856         void *data,
857         uint32_t tc_mask,
858         struct rte_table_action_mtr_counters *stats,
859         int clear);
860
861 int
862 softnic_pipeline_table_dscp_table_update(struct pmd_internals *p,
863         const char *pipeline_name,
864         uint32_t table_id,
865         uint64_t dscp_mask,
866         struct rte_table_action_dscp_table *dscp_table);
867
868 int
869 softnic_pipeline_table_rule_ttl_read(struct pmd_internals *p,
870         const char *pipeline_name,
871         uint32_t table_id,
872         void *data,
873         struct rte_table_action_ttl_counters *stats,
874         int clear);
875
876 /**
877  * Thread
878  */
879 int
880 softnic_thread_init(struct pmd_internals *p);
881
882 void
883 softnic_thread_free(struct pmd_internals *p);
884
885 int
886 softnic_thread_pipeline_enable(struct pmd_internals *p,
887         uint32_t thread_id,
888         const char *pipeline_name);
889
890 int
891 softnic_thread_pipeline_disable(struct pmd_internals *p,
892         uint32_t thread_id,
893         const char *pipeline_name);
894
895 /**
896  * CLI
897  */
898 void
899 softnic_cli_process(char *in,
900         char *out,
901         size_t out_size,
902         void *arg);
903
904 int
905 softnic_cli_script_process(struct pmd_internals *softnic,
906         const char *file_name,
907         size_t msg_in_len_max,
908         size_t msg_out_len_max);
909
910 #endif /* __INCLUDE_RTE_ETH_SOFTNIC_INTERNALS_H__ */