rte_swx_ctl_pipeline_port_out_stats_read(p->p, i, &stats);
- snprintf(out, out_size, "\tPort %u:"
- " packets %" PRIu64
- " bytes %" PRIu64 "\n",
- i, stats.n_pkts, stats.n_bytes);
+ if (i != info.n_ports_out - 1)
+ snprintf(out, out_size, "\tPort %u:"
+ " packets %" PRIu64
+ " bytes %" PRIu64 "\n",
+ i, stats.n_pkts, stats.n_bytes);
+ else
+ snprintf(out, out_size, "\tDROP:"
+ " packets %" PRIu64
+ " bytes %" PRIu64 "\n",
+ stats.n_pkts, stats.n_bytes);
+
out_size -= strlen(out);
out += strlen(out);
}
pipeline PIPELINE0 port out 1 link LINK1 txq 0 bsz 32
pipeline PIPELINE0 port out 2 link LINK2 txq 0 bsz 32
pipeline PIPELINE0 port out 3 link LINK3 txq 0 bsz 32
-pipeline PIPELINE0 port out 4 sink none
pipeline PIPELINE0 build ./examples/pipeline/examples/fib.spec
pipeline PIPELINE0 port out 1 link LINK1 txq 0 bsz 32
pipeline PIPELINE0 port out 2 link LINK2 txq 0 bsz 32
pipeline PIPELINE0 port out 3 link LINK3 txq 0 bsz 32
-pipeline PIPELINE0 port out 4 sink none
pipeline PIPELINE0 build ./examples/pipeline/examples/learner.spec
pipeline PIPELINE0 port out 1 link LINK1 txq 0 bsz 32
pipeline PIPELINE0 port out 2 link LINK2 txq 0 bsz 32
pipeline PIPELINE0 port out 3 link LINK3 txq 0 bsz 32
-pipeline PIPELINE0 port out 4 sink none
pipeline PIPELINE0 build ./examples/pipeline/examples/selector.spec
pipeline PIPELINE0 port out 1 link LINK1 txq 0 bsz 32
pipeline PIPELINE0 port out 2 link LINK2 txq 0 bsz 32
pipeline PIPELINE0 port out 3 link LINK3 txq 0 bsz 32
-pipeline PIPELINE0 port out 4 sink none
pipeline PIPELINE0 build ./examples/pipeline/examples/varbit.spec
pipeline PIPELINE0 port out 1 link LINK1 txq 0 bsz 32
pipeline PIPELINE0 port out 2 link LINK2 txq 0 bsz 32
pipeline PIPELINE0 port out 3 link LINK3 txq 0 bsz 32
-pipeline PIPELINE0 port out 4 sink none
pipeline PIPELINE0 build ./examples/pipeline/examples/vxlan.spec
pipeline PIPELINE0 table vxlan_table add ./examples/pipeline/examples/vxlan_table.txt
pipeline PIPELINE0 port out 1 sink none
pipeline PIPELINE0 port out 2 sink none
pipeline PIPELINE0 port out 3 sink none
-pipeline PIPELINE0 port out 4 sink none
pipeline PIPELINE0 build ./examples/pipeline/examples/vxlan.spec
pipeline PIPELINE0 table vxlan_table add ./examples/pipeline/examples/vxlan_table.txt
int
rte_swx_pipeline_build(struct rte_swx_pipeline *p)
{
+ struct rte_swx_port_sink_params drop_port_params = {
+ .file_name = NULL,
+ };
int status;
CHECK(p, EINVAL);
if (status)
goto error;
+ /* Drop port. */
+ status = rte_swx_pipeline_port_out_config(p,
+ p->n_ports_out,
+ "sink",
+ &drop_port_params);
+ if (status)
+ goto error;
+
status = port_out_build(p);
if (status)
goto error;