struct dpif_flow_dump *flow_dump;
struct dpif_flow f;
int pmd_id = PMD_ID_NULL;
+ bool pmd_id_filter = false;
int lastargc = 0;
int error;
goto out_free;
}
types_list = xstrdup(argv[--argc] + 5);
+ } else if (!strncmp(argv[argc - 1], "pmd=", 4)) {
+ if (!ovs_scan(argv[--argc], "pmd=%d", &pmd_id)) {
+ error = EINVAL;
+ goto out_free;
+ }
+
+ if (pmd_id == -1) {
+ pmd_id = NON_PMD_CORE_ID;
+ }
+ pmd_id_filter = true;
}
}
/* If 'pmd_id' is specified, overlapping flows could be dumped from
* different pmd threads. So, separates dumps from different pmds
* by printing a title line. */
- if (pmd_id != f.pmd_id) {
+ if (!pmd_id_filter && pmd_id != f.pmd_id) {
if (f.pmd_id == NON_PMD_CORE_ID) {
ds_put_format(&ds, "flow-dump from the main thread:\n");
} else {
}
pmd_id = f.pmd_id;
}
- if (flow_passes_type_filter(&f, &dump_types)) {
+ if (pmd_id == f.pmd_id &&
+ flow_passes_type_filter(&f, &dump_types)) {
format_dpif_flow(&ds, &f, portno_names, dpctl_p);
dpctl_print(dpctl_p, "%s\n", ds_cstr(&ds));
}
{ "set-if", "dp iface...", 2, INT_MAX, dpctl_set_if, DP_RW },
{ "dump-dps", "", 0, 0, dpctl_dump_dps, DP_RO },
{ "show", "[dp...]", 0, INT_MAX, dpctl_show, DP_RO },
- { "dump-flows", "[dp] [filter=..] [type=..]",
- 0, 3, dpctl_dump_flows, DP_RO },
+ { "dump-flows", "[dp] [filter=..] [type=..] [pmd=..]",
+ 0, 4, dpctl_dump_flows, DP_RO },
{ "add-flow", "[dp] flow actions", 2, 3, dpctl_add_flow, DP_RW },
{ "mod-flow", "[dp] flow actions", 2, 3, dpctl_mod_flow, DP_RW },
{ "get-flow", "[dp] ufid", 1, 2, dpctl_get_flow, DP_RO },
required.
.
.TP
-.DO "[\fB\-m \fR| \fB\-\-more\fR] [\fB\-\-names \fR| \fB\-\-no\-names\fR]" \*(DX\fBdump\-flows\fR "[\fIdp\fR] [\fBfilter=\fIfilter\fR] [\fBtype=\fItype\fR]"
+.DO "[\fB\-m \fR| \fB\-\-more\fR] [\fB\-\-names \fR| \fB\-\-no\-names\fR]" \*(DX\fBdump\-flows\fR "[\fIdp\fR] [\fBfilter=\fIfilter\fR] [\fBtype=\fItype\fR] [\fBpmd=\fIpmd\fR]"
Prints to the console all flow entries in datapath \fIdp\fR's flow
table. Without \fB\-m\fR or \fB\-\-more\fR, output omits match fields
that a flow wildcards entirely; with \fB\-m\fR or \fB\-\-more\fR,
flow. As an example, \fBfilter='tcp,tp_src=100'\fR will match the
datapath flow containing '\fBtcp(src=80/0xff00,dst=8080/0xff)\fR'.
.IP
+If \fBpmd=\fIpmd\fR is specified, only displays flows of the specified pmd.
+Using \fBpmd=\fI-1\fR will restrict the dump to flows from the main thread.
+This option is only supported by the \fBuserspace datapath\fR.
+.IP
If \fBtype=\fItype\fR is specified, only displays flows of the specified types.
This option supported only for \fBovs\-appctl dpctl/dump\-flows\fR.
\fItype\fR is a comma separated list, which can contain any of the following:
recirc_id(0),in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234), packets:0, bytes:0, used:never, actions:2
])
+dnl Check pmd filtering option.
+AT_CHECK([ovs-appctl dpctl/dump-flows dummy@dp0 pmd=0], [0], [dnl
+recirc_id(0),in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234), packets:0, bytes:0, used:never, actions:2
+])
+
+AT_CHECK([ovs-appctl dpctl/dump-flows dummy@dp0 pmd=-1], [0], [dnl
+recirc_id(0),in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234), packets:0, bytes:0, used:never, actions:2
+])
+
AT_CHECK([ovs-appctl dpctl/del-flow dummy@dp0 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x1234)'], [0], [dnl
])