]> git.proxmox.com Git - mirror_ovs.git/commitdiff
dpctl: Support dump-flows filters "dpdk" and "partially-offloaded".
authorEli Britstein <elibr@mellanox.com>
Thu, 9 Jan 2020 07:46:46 +0000 (07:46 +0000)
committerIlya Maximets <i.maximets@ovn.org>
Thu, 16 Jan 2020 12:34:10 +0000 (13:34 +0100)
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>
NEWS
lib/dpctl.c
lib/dpctl.man

diff --git a/NEWS b/NEWS
index 965facaf852d159158291fd55321dd5552d03906..8e89f77f6dc6669dd88809a88f6ce879fb13b545 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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
 ---------------------
index a1ea25b47e55fde1442da7154b54638467cca55d..23c2682d08d437856a2cf1153e68ccdd016df499 100644 (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)) {
index 090c3b960e3b7d4a9634a8b3b51d1191414f7c8d..727d1f7be8d4bc006945e012b5eabeb64bad3424 100644 (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.