2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

dpif-netdev: Modified ovs-appctl dpctl/dump-flows command

Modified ovs-appctl dpctl/dump-flows command to output
the miniflow bits for a given flow when -m option is passed.

$ ovs-appctl dpctl/dump-flows -m

Signed-off-by: Emma Finn <emma.finn@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
This commit is contained in:
Emma Finn
2019-11-06 11:35:29 +00:00
committed by Ian Stokes
parent 8ae6a5f98c
commit 0e8f5c6a38
4 changed files with 22 additions and 0 deletions

2
NEWS
View File

@@ -8,6 +8,8 @@ Post-v2.12.0
* Add option to enable, disable and query TCP sequence checking in
conntrack.
* Add support for conntrack zone limits.
* Command "ovs-appctl dpctl/dump-flows" refactored to show subtable
miniflow bits for userspace datapath.
- AF_XDP:
* New option 'use-need-wakeup' for netdev-afxdp to control enabling
of corresponding 'need_wakeup' flag in AF_XDP rings. Enabled by default

View File

@@ -829,6 +829,10 @@ format_dpif_flow(struct ds *ds, const struct dpif_flow *f, struct hmap *ports,
}
ds_put_cstr(ds, ", actions:");
format_odp_actions(ds, f->actions, f->actions_len, ports);
if (dpctl_p->verbosity && f->attrs.dp_extra_info) {
ds_put_format(ds, ", dp-extra-info:%s", f->attrs.dp_extra_info);
}
free(f->attrs.dp_extra_info);
}
struct dump_types {

View File

@@ -3158,6 +3158,21 @@ dp_netdev_flow_to_dpif_flow(const struct dp_netdev *dp,
flow->pmd_id = netdev_flow->pmd_id;
get_dpif_flow_status(dp, netdev_flow, &flow->stats, &flow->attrs);
struct ds extra_info = DS_EMPTY_INITIALIZER;
size_t unit;
ds_put_cstr(&extra_info, "miniflow_bits(");
FLOWMAP_FOR_EACH_UNIT (unit) {
if (unit) {
ds_put_char(&extra_info, ',');
}
ds_put_format(&extra_info, "%d",
count_1bits(netdev_flow->cr.mask->mf.map.bits[unit]));
}
ds_put_char(&extra_info, ')');
flow->attrs.dp_extra_info = ds_steal_cstr(&extra_info);
ds_destroy(&extra_info);
}
static int

View File

@@ -513,6 +513,7 @@ struct dpif_flow_detailed_stats {
struct dpif_flow_attrs {
bool offloaded; /* True if flow is offloaded to HW. */
const char *dp_layer; /* DP layer the flow is handled in. */
char *dp_extra_info; /* Extra information provided by DP. */
};
struct dpif_flow_dump_types {