1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
|
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2017 Intel Corporation
*/
#include <stdio.h>
#include <sys/stat.h>
#include <rte_cycles.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
#include <rte_ethdev.h>
#include <rte_flow.h>
#include <rte_meter.h>
#include <rte_eth_softnic.h>
#include <rte_tm.h>
#include "testpmd.h"
#define SUBPORT_NODES_PER_PORT 1
#define PIPE_NODES_PER_SUBPORT 4096
#define TC_NODES_PER_PIPE 4
#define QUEUE_NODES_PER_TC 4
#define NUM_PIPE_NODES \
(SUBPORT_NODES_PER_PORT * PIPE_NODES_PER_SUBPORT)
#define NUM_TC_NODES \
(NUM_PIPE_NODES * TC_NODES_PER_PIPE)
#define ROOT_NODE_ID 1000000
#define SUBPORT_NODES_START_ID 900000
#define PIPE_NODES_START_ID 800000
#define TC_NODES_START_ID 700000
#define STATS_MASK_DEFAULT \
(RTE_TM_STATS_N_PKTS | \
RTE_TM_STATS_N_BYTES | \
RTE_TM_STATS_N_PKTS_GREEN_DROPPED | \
RTE_TM_STATS_N_BYTES_GREEN_DROPPED)
#define STATS_MASK_QUEUE \
(STATS_MASK_DEFAULT | \
RTE_TM_STATS_N_PKTS_QUEUED)
#define BYTES_IN_MBPS (1000 * 1000 / 8)
#define TOKEN_BUCKET_SIZE 1000000
/* TM Hierarchy Levels */
enum tm_hierarchy_level {
TM_NODE_LEVEL_PORT = 0,
TM_NODE_LEVEL_SUBPORT,
TM_NODE_LEVEL_PIPE,
TM_NODE_LEVEL_TC,
TM_NODE_LEVEL_QUEUE,
TM_NODE_LEVEL_MAX,
};
struct tm_hierarchy {
/* TM Nodes */
uint32_t root_node_id;
uint32_t subport_node_id[SUBPORT_NODES_PER_PORT];
uint32_t pipe_node_id[SUBPORT_NODES_PER_PORT][PIPE_NODES_PER_SUBPORT];
uint32_t tc_node_id[NUM_PIPE_NODES][TC_NODES_PER_PIPE];
uint32_t queue_node_id[NUM_TC_NODES][QUEUE_NODES_PER_TC];
/* TM Hierarchy Nodes Shaper Rates */
uint32_t root_node_shaper_rate;
uint32_t subport_node_shaper_rate;
uint32_t pipe_node_shaper_rate;
uint32_t tc_node_shaper_rate;
uint32_t tc_node_shared_shaper_rate;
uint32_t n_shapers;
};
static struct fwd_lcore *softnic_fwd_lcore;
static uint16_t softnic_port_id;
struct fwd_engine softnic_fwd_engine;
/*
* Softnic packet forward
*/
static void
softnic_fwd(struct fwd_stream *fs)
{
struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
uint16_t nb_rx;
uint16_t nb_tx;
uint32_t retry;
#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
uint64_t start_tsc;
uint64_t end_tsc;
uint64_t core_cycles;
#endif
#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
start_tsc = rte_rdtsc();
#endif
/* Packets Receive */
nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue,
pkts_burst, nb_pkt_per_burst);
fs->rx_packets += nb_rx;
#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
fs->rx_burst_stats.pkt_burst_spread[nb_rx]++;
#endif
nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
pkts_burst, nb_rx);
/* Retry if necessary */
if (unlikely(nb_tx < nb_rx) && fs->retry_enabled) {
retry = 0;
while (nb_tx < nb_rx && retry++ < burst_tx_retry_num) {
rte_delay_us(burst_tx_delay_time);
nb_tx += rte_eth_tx_burst(fs->tx_port, fs->tx_queue,
&pkts_burst[nb_tx], nb_rx - nb_tx);
}
}
fs->tx_packets += nb_tx;
#ifdef RTE_TEST_PMD_RECORD_BURST_STATS
fs->tx_burst_stats.pkt_burst_spread[nb_tx]++;
#endif
if (unlikely(nb_tx < nb_rx)) {
fs->fwd_dropped += (nb_rx - nb_tx);
do {
rte_pktmbuf_free(pkts_burst[nb_tx]);
} while (++nb_tx < nb_rx);
}
#ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES
end_tsc = rte_rdtsc();
core_cycles = (end_tsc - start_tsc);
fs->core_cycles = (uint64_t) (fs->core_cycles + core_cycles);
#endif
}
static void
softnic_fwd_run(struct fwd_stream *fs)
{
rte_pmd_softnic_run(softnic_port_id);
softnic_fwd(fs);
}
/**
* Softnic init
*/
static int
softnic_begin(void *arg __rte_unused)
{
for (;;) {
if (!softnic_fwd_lcore->stopped)
break;
}
do {
/* Run softnic */
rte_pmd_softnic_run(softnic_port_id);
} while (!softnic_fwd_lcore->stopped);
return 0;
}
static void
set_tm_hiearchy_nodes_shaper_rate(portid_t port_id,
struct tm_hierarchy *h)
{
struct rte_eth_link link_params;
uint64_t tm_port_rate;
memset(&link_params, 0, sizeof(link_params));
rte_eth_link_get(port_id, &link_params);
tm_port_rate = (uint64_t)ETH_SPEED_NUM_10G * BYTES_IN_MBPS;
/* Set tm hierarchy shapers rate */
h->root_node_shaper_rate = tm_port_rate;
h->subport_node_shaper_rate =
tm_port_rate / SUBPORT_NODES_PER_PORT;
h->pipe_node_shaper_rate
= h->subport_node_shaper_rate / PIPE_NODES_PER_SUBPORT;
h->tc_node_shaper_rate = h->pipe_node_shaper_rate;
h->tc_node_shared_shaper_rate = h->subport_node_shaper_rate;
}
static int
softport_tm_root_node_add(portid_t port_id, struct tm_hierarchy *h,
struct rte_tm_error *error)
{
struct rte_tm_node_params rnp;
struct rte_tm_shaper_params rsp;
uint32_t priority, weight, level_id, shaper_profile_id;
memset(&rsp, 0, sizeof(struct rte_tm_shaper_params));
memset(&rnp, 0, sizeof(struct rte_tm_node_params));
/* Shaper profile Parameters */
rsp.peak.rate = h->root_node_shaper_rate;
rsp.peak.size = TOKEN_BUCKET_SIZE;
rsp.pkt_length_adjust = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
shaper_profile_id = 0;
if (rte_tm_shaper_profile_add(port_id, shaper_profile_id,
&rsp, error)) {
printf("%s ERROR(%d)-%s!(shaper_id %u)\n ",
__func__, error->type, error->message,
shaper_profile_id);
return -1;
}
/* Root Node Parameters */
h->root_node_id = ROOT_NODE_ID;
weight = 1;
priority = 0;
level_id = TM_NODE_LEVEL_PORT;
rnp.shaper_profile_id = shaper_profile_id;
rnp.nonleaf.n_sp_priorities = 1;
rnp.stats_mask = STATS_MASK_DEFAULT;
/* Add Node to TM Hierarchy */
if (rte_tm_node_add(port_id, h->root_node_id, RTE_TM_NODE_ID_NULL,
priority, weight, level_id, &rnp, error)) {
printf("%s ERROR(%d)-%s!(node_id %u, parent_id %u, level %u)\n",
__func__, error->type, error->message,
h->root_node_id, RTE_TM_NODE_ID_NULL,
level_id);
return -1;
}
/* Update */
h->n_shapers++;
printf(" Root node added (Start id %u, Count %u, level %u)\n",
h->root_node_id, 1, level_id);
return 0;
}
static int
softport_tm_subport_node_add(portid_t port_id,
struct tm_hierarchy *h,
struct rte_tm_error *error)
{
uint32_t subport_parent_node_id, subport_node_id = 0;
struct rte_tm_node_params snp;
struct rte_tm_shaper_params ssp;
uint32_t priority, weight, level_id, shaper_profile_id;
uint32_t i;
memset(&ssp, 0, sizeof(struct rte_tm_shaper_params));
memset(&snp, 0, sizeof(struct rte_tm_node_params));
shaper_profile_id = h->n_shapers;
/* Add Shaper Profile to TM Hierarchy */
for (i = 0; i < SUBPORT_NODES_PER_PORT; i++) {
ssp.peak.rate = h->subport_node_shaper_rate;
ssp.peak.size = TOKEN_BUCKET_SIZE;
ssp.pkt_length_adjust = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
if (rte_tm_shaper_profile_add(port_id, shaper_profile_id,
&ssp, error)) {
printf("%s ERROR(%d)-%s!(shaper_id %u)\n ",
__func__, error->type, error->message,
shaper_profile_id);
return -1;
}
/* Node Parameters */
h->subport_node_id[i] = SUBPORT_NODES_START_ID + i;
subport_parent_node_id = h->root_node_id;
weight = 1;
priority = 0;
level_id = TM_NODE_LEVEL_SUBPORT;
snp.shaper_profile_id = shaper_profile_id;
snp.nonleaf.n_sp_priorities = 1;
snp.stats_mask = STATS_MASK_DEFAULT;
/* Add Node to TM Hiearchy */
if (rte_tm_node_add(port_id,
h->subport_node_id[i],
subport_parent_node_id,
priority, weight,
level_id,
&snp,
error)) {
printf("%s ERROR(%d)-%s!(node %u,parent %u,level %u)\n",
__func__,
error->type,
error->message,
h->subport_node_id[i],
subport_parent_node_id,
level_id);
return -1;
}
shaper_profile_id++;
subport_node_id++;
}
/* Update */
h->n_shapers = shaper_profile_id;
printf(" Subport nodes added (Start id %u, Count %u, level %u)\n",
h->subport_node_id[0], SUBPORT_NODES_PER_PORT, level_id);
return 0;
}
static int
softport_tm_pipe_node_add(portid_t port_id,
struct tm_hierarchy *h,
struct rte_tm_error *error)
{
uint32_t pipe_parent_node_id;
struct rte_tm_node_params pnp;
struct rte_tm_shaper_params psp;
uint32_t priority, weight, level_id, shaper_profile_id;
uint32_t i, j;
memset(&psp, 0, sizeof(struct rte_tm_shaper_params));
memset(&pnp, 0, sizeof(struct rte_tm_node_params));
shaper_profile_id = h->n_shapers;
/* Shaper Profile Parameters */
psp.peak.rate = h->pipe_node_shaper_rate;
psp.peak.size = TOKEN_BUCKET_SIZE;
psp.pkt_length_adjust = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
/* Pipe Node Parameters */
weight = 1;
priority = 0;
level_id = TM_NODE_LEVEL_PIPE;
pnp.nonleaf.n_sp_priorities = 4;
pnp.stats_mask = STATS_MASK_DEFAULT;
/* Add Shaper Profiles and Nodes to TM Hierarchy */
for (i = 0; i < SUBPORT_NODES_PER_PORT; i++) {
for (j = 0; j < PIPE_NODES_PER_SUBPORT; j++) {
if (rte_tm_shaper_profile_add(port_id,
shaper_profile_id, &psp, error)) {
printf("%s ERROR(%d)-%s!(shaper_id %u)\n ",
__func__, error->type, error->message,
shaper_profile_id);
return -1;
}
pnp.shaper_profile_id = shaper_profile_id;
pipe_parent_node_id = h->subport_node_id[i];
h->pipe_node_id[i][j] = PIPE_NODES_START_ID +
(i * PIPE_NODES_PER_SUBPORT) + j;
if (rte_tm_node_add(port_id,
h->pipe_node_id[i][j],
pipe_parent_node_id,
priority, weight, level_id,
&pnp,
error)) {
printf("%s ERROR(%d)-%s!(node %u,parent %u )\n",
__func__,
error->type,
error->message,
h->pipe_node_id[i][j],
pipe_parent_node_id);
return -1;
}
shaper_profile_id++;
}
}
/* Update */
h->n_shapers = shaper_profile_id;
printf(" Pipe nodes added (Start id %u, Count %u, level %u)\n",
h->pipe_node_id[0][0], NUM_PIPE_NODES, level_id);
return 0;
}
static int
softport_tm_tc_node_add(portid_t port_id,
struct tm_hierarchy *h,
struct rte_tm_error *error)
{
uint32_t tc_parent_node_id;
struct rte_tm_node_params tnp;
struct rte_tm_shaper_params tsp, tssp;
uint32_t shared_shaper_profile_id[TC_NODES_PER_PIPE];
uint32_t priority, weight, level_id, shaper_profile_id;
uint32_t pos, n_tc_nodes, i, j, k;
memset(&tsp, 0, sizeof(struct rte_tm_shaper_params));
memset(&tssp, 0, sizeof(struct rte_tm_shaper_params));
memset(&tnp, 0, sizeof(struct rte_tm_node_params));
shaper_profile_id = h->n_shapers;
/* Private Shaper Profile (TC) Parameters */
tsp.peak.rate = h->tc_node_shaper_rate;
tsp.peak.size = TOKEN_BUCKET_SIZE;
tsp.pkt_length_adjust = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
/* Shared Shaper Profile (TC) Parameters */
tssp.peak.rate = h->tc_node_shared_shaper_rate;
tssp.peak.size = TOKEN_BUCKET_SIZE;
tssp.pkt_length_adjust = RTE_TM_ETH_FRAMING_OVERHEAD_FCS;
/* TC Node Parameters */
weight = 1;
level_id = TM_NODE_LEVEL_TC;
tnp.n_shared_shapers = 1;
tnp.nonleaf.n_sp_priorities = 1;
tnp.stats_mask = STATS_MASK_DEFAULT;
/* Add Shared Shaper Profiles to TM Hierarchy */
for (i = 0; i < TC_NODES_PER_PIPE; i++) {
shared_shaper_profile_id[i] = shaper_profile_id;
if (rte_tm_shaper_profile_add(port_id,
shared_shaper_profile_id[i], &tssp, error)) {
printf("%s ERROR(%d)-%s!(Shared shaper profileid %u)\n",
__func__, error->type, error->message,
shared_shaper_profile_id[i]);
return -1;
}
if (rte_tm_shared_shaper_add_update(port_id, i,
shared_shaper_profile_id[i], error)) {
printf("%s ERROR(%d)-%s!(Shared shaper id %u)\n",
__func__, error->type, error->message, i);
return -1;
}
shaper_profile_id++;
}
/* Add Shaper Profiles and Nodes to TM Hierarchy */
n_tc_nodes = 0;
for (i = 0; i < SUBPORT_NODES_PER_PORT; i++) {
for (j = 0; j < PIPE_NODES_PER_SUBPORT; j++) {
for (k = 0; k < TC_NODES_PER_PIPE ; k++) {
priority = k;
tc_parent_node_id = h->pipe_node_id[i][j];
tnp.shared_shaper_id =
(uint32_t *)calloc(1, sizeof(uint32_t));
if (tnp.shared_shaper_id == NULL) {
printf("Shared shaper mem alloc err\n");
return -1;
}
tnp.shared_shaper_id[0] = k;
pos = j + (i * PIPE_NODES_PER_SUBPORT);
h->tc_node_id[pos][k] =
TC_NODES_START_ID + n_tc_nodes;
if (rte_tm_shaper_profile_add(port_id,
shaper_profile_id, &tsp, error)) {
printf("%s ERROR(%d)-%s!(shaper %u)\n",
__func__, error->type,
error->message,
shaper_profile_id);
return -1;
}
tnp.shaper_profile_id = shaper_profile_id;
if (rte_tm_node_add(port_id,
h->tc_node_id[pos][k],
tc_parent_node_id,
priority, weight,
level_id,
&tnp, error)) {
printf("%s ERROR(%d)-%s!(node id %u)\n",
__func__,
error->type,
error->message,
h->tc_node_id[pos][k]);
return -1;
}
shaper_profile_id++;
n_tc_nodes++;
}
}
}
/* Update */
h->n_shapers = shaper_profile_id;
printf(" TC nodes added (Start id %u, Count %u, level %u)\n",
h->tc_node_id[0][0], n_tc_nodes, level_id);
return 0;
}
static int
softport_tm_queue_node_add(portid_t port_id, struct tm_hierarchy *h,
struct rte_tm_error *error)
{
uint32_t queue_parent_node_id;
struct rte_tm_node_params qnp;
uint32_t priority, weight, level_id, pos;
uint32_t n_queue_nodes, i, j, k;
memset(&qnp, 0, sizeof(struct rte_tm_node_params));
/* Queue Node Parameters */
priority = 0;
weight = 1;
level_id = TM_NODE_LEVEL_QUEUE;
qnp.shaper_profile_id = RTE_TM_SHAPER_PROFILE_ID_NONE;
qnp.leaf.cman = RTE_TM_CMAN_TAIL_DROP;
qnp.stats_mask = STATS_MASK_QUEUE;
/* Add Queue Nodes to TM Hierarchy */
n_queue_nodes = 0;
for (i = 0; i < NUM_PIPE_NODES; i++) {
for (j = 0; j < TC_NODES_PER_PIPE; j++) {
queue_parent_node_id = h->tc_node_id[i][j];
for (k = 0; k < QUEUE_NODES_PER_TC; k++) {
pos = j + (i * TC_NODES_PER_PIPE);
h->queue_node_id[pos][k] = n_queue_nodes;
if (rte_tm_node_add(port_id,
h->queue_node_id[pos][k],
queue_parent_node_id,
priority,
weight,
level_id,
&qnp, error)) {
printf("%s ERROR(%d)-%s!(node %u)\n",
__func__,
error->type,
error->message,
h->queue_node_id[pos][k]);
return -1;
}
n_queue_nodes++;
}
}
}
printf(" Queue nodes added (Start id %u, Count %u, level %u)\n",
h->queue_node_id[0][0], n_queue_nodes, level_id);
return 0;
}
static int
softport_tm_hierarchy_specify(portid_t port_id,
struct rte_tm_error *error)
{
struct tm_hierarchy h;
int status;
memset(&h, 0, sizeof(struct tm_hierarchy));
/* TM hierarchy shapers rate */
set_tm_hiearchy_nodes_shaper_rate(port_id, &h);
/* Add root node (level 0) */
status = softport_tm_root_node_add(port_id, &h, error);
if (status)
return status;
/* Add subport node (level 1) */
status = softport_tm_subport_node_add(port_id, &h, error);
if (status)
return status;
/* Add pipe nodes (level 2) */
status = softport_tm_pipe_node_add(port_id, &h, error);
if (status)
return status;
/* Add traffic class nodes (level 3) */
status = softport_tm_tc_node_add(port_id, &h, error);
if (status)
return status;
/* Add queue nodes (level 4) */
status = softport_tm_queue_node_add(port_id, &h, error);
if (status)
return status;
return 0;
}
/*
* Softnic TM default configuration
*/
static void
softnic_tm_default_config(portid_t pi)
{
struct rte_port *port = &ports[pi];
struct rte_tm_error error;
int status;
/* Stop port */
rte_eth_dev_stop(pi);
/* TM hierarchy specification */
status = softport_tm_hierarchy_specify(pi, &error);
if (status) {
printf(" TM Hierarchy built error(%d) - %s\n",
error.type, error.message);
return;
}
printf("\n TM Hierarchy Specified!\n");
/* TM hierarchy commit */
status = rte_tm_hierarchy_commit(pi, 0, &error);
if (status) {
printf(" Hierarchy commit error(%d) - %s\n",
error.type, error.message);
return;
}
printf(" Hierarchy Committed (port %u)!\n", pi);
/* Start port */
status = rte_eth_dev_start(pi);
if (status) {
printf("\n Port %u start error!\n", pi);
return;
}
/* Reset the default hierarchy flag */
port->softport.default_tm_hierarchy_enable = 0;
}
/*
* Softnic forwarding init
*/
static void
softnic_fwd_begin(portid_t pi)
{
struct rte_port *port = &ports[pi];
uint32_t lcore, fwd_core_present = 0, softnic_run_launch = 0;
int status;
softnic_fwd_lcore = port->softport.fwd_lcore_arg[0];
softnic_port_id = pi;
/* Launch softnic_run function on lcores */
for (lcore = 0; lcore < RTE_MAX_LCORE; lcore++) {
if (!rte_lcore_is_enabled(lcore))
continue;
if (lcore == rte_get_master_lcore())
continue;
if (fwd_core_present == 0) {
fwd_core_present++;
continue;
}
status = rte_eal_remote_launch(softnic_begin, NULL, lcore);
if (status)
printf("softnic launch on lcore %u failed (%d)\n",
lcore, status);
softnic_run_launch = 1;
}
if (!softnic_run_launch)
softnic_fwd_engine.packet_fwd = softnic_fwd_run;
/* Softnic TM default configuration */
if (port->softport.default_tm_hierarchy_enable == 1)
softnic_tm_default_config(pi);
}
struct fwd_engine softnic_fwd_engine = {
.fwd_mode_name = "softnic",
.port_fwd_begin = softnic_fwd_begin,
.port_fwd_end = NULL,
.packet_fwd = softnic_fwd,
};
|