2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +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

View File

@@ -818,7 +818,11 @@ 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) {
ds_put_cstr(ds, ", offloaded:yes");
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)) {