2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 22:35:15 +00:00

dpctl: Support dump-flows filters "dpdk" and "partially-offloaded".

Flows that are offloaded via DPDK can be partially offloaded (matches
only) or fully offloaded (matches and actions). Set partially offloaded
display to (offloaded=partial, dp:ovs), and fully offloaded to
(offloaded=yes, dp:dpdk). Also support filter types "dpdk" and
"partially-offloaded".

Signed-off-by: Eli Britstein <elibr@mellanox.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Eli Britstein
2020-01-09 07:46:46 +00:00
committed by Ilya Maximets
parent 2aca29df93
commit 80944cb41d
3 changed files with 30 additions and 3 deletions

3
NEWS
View File

@@ -34,6 +34,9 @@ Post-v2.12.0
interval is increased to 60 seconds for the connection to the
replication server. This value is configurable with the unixctl
command - ovsdb-server/set-active-ovsdb-server-probe-interval.
- 'ovs-appctl dpctl/dump-flows' can now show offloaded=partial for
partially offloaded flows, dp:dpdk for fully offloaded by dpdk, and
type filter supports new filters: "dpdk" and "partially-offloaded".
v2.12.0 - 03 Sep 2019
---------------------

View File

@@ -818,8 +818,12 @@ format_dpif_flow(struct ds *ds, const struct dpif_flow *f, struct hmap *ports,
dpif_flow_stats_format(&f->stats, ds);
if (dpctl_p->verbosity && f->attrs.offloaded) {
if (f->attrs.dp_layer && !strcmp(f->attrs.dp_layer, "ovs")) {
ds_put_cstr(ds, ", offloaded:partial");
} else {
ds_put_cstr(ds, ", offloaded:yes");
}
}
if (dpctl_p->verbosity && f->attrs.dp_layer) {
ds_put_format(ds, ", dp:%s", f->attrs.dp_layer);
}
@@ -830,8 +834,10 @@ format_dpif_flow(struct ds *ds, const struct dpif_flow *f, struct hmap *ports,
struct dump_types {
bool ovs;
bool tc;
bool dpdk;
bool offloaded;
bool non_offloaded;
bool partially_offloaded;
};
static void
@@ -839,8 +845,10 @@ enable_all_dump_types(struct dump_types *dump_types)
{
dump_types->ovs = true;
dump_types->tc = true;
dump_types->dpdk = true;
dump_types->offloaded = true;
dump_types->non_offloaded = true;
dump_types->partially_offloaded = true;
}
static int
@@ -865,10 +873,14 @@ populate_dump_types(char *types_list, struct dump_types *dump_types,
dump_types->ovs = true;
} else if (!strcmp(current_type, "tc")) {
dump_types->tc = true;
} else if (!strcmp(current_type, "dpdk")) {
dump_types->dpdk = true;
} else if (!strcmp(current_type, "offloaded")) {
dump_types->offloaded = true;
} else if (!strcmp(current_type, "non-offloaded")) {
dump_types->non_offloaded = true;
} else if (!strcmp(current_type, "partially-offloaded")) {
dump_types->partially_offloaded = true;
} else if (!strcmp(current_type, "all")) {
enable_all_dump_types(dump_types);
} else {
@@ -886,7 +898,9 @@ determine_dpif_flow_dump_types(struct dump_types *dump_types,
{
dpif_dump_types->ovs_flows = dump_types->ovs || dump_types->non_offloaded;
dpif_dump_types->netdev_flows = dump_types->tc || dump_types->offloaded
|| dump_types->non_offloaded;
|| dump_types->non_offloaded
|| dump_types->dpdk
|| dump_types->partially_offloaded;
}
static bool
@@ -899,7 +913,15 @@ flow_passes_type_filter(const struct dpif_flow *f,
if (dump_types->tc && !strcmp(f->attrs.dp_layer, "tc")) {
return true;
}
if (dump_types->offloaded && f->attrs.offloaded) {
if (dump_types->dpdk && !strcmp(f->attrs.dp_layer, "dpdk")) {
return true;
}
if (dump_types->offloaded && f->attrs.offloaded &&
strcmp(f->attrs.dp_layer, "ovs")) {
return true;
}
if (dump_types->partially_offloaded && f->attrs.offloaded &&
!strcmp(f->attrs.dp_layer, "ovs")) {
return true;
}
if (dump_types->non_offloaded && !(f->attrs.offloaded)) {

View File

@@ -124,8 +124,10 @@ This option supported only for \fBovs\-appctl dpctl/dump\-flows\fR.
.
\fBovs\fR - displays flows handled in the ovs dp
\fBtc\fR - displays flows handled in the tc dp
\fBdpdk\fR - displays flows fully offloaded by dpdk
\fBoffloaded\fR - displays flows offloaded to the HW
\fBnon-offloaded\fR - displays flows not offloaded to the HW
\fBpartially-offloaded\fR - displays flows where only part of their proccessing is done in HW
\fBall\fR - displays all the types of flows
.IP
By default all the types of flows are displayed.