diff mbox series

[ovs-dev,v6,8/8] dpctl: update flow-dump output to reflect partial action offload

Message ID 20200712192625.7359-9-sriharsha.basavapatna@broadcom.com
State New
Headers show
Series netdev datapath: Partial action offload | expand

Commit Message

Sriharsha Basavapatna July 12, 2020, 7:26 p.m. UTC
To identify flows that have actions partially offloaded, the dp and
offloaded fields in the output of dpctl/flow-dump, are updated with
the values: "dp:ovs,dpdk" and "offloaded:partial-action".

Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
---
 lib/dpctl.c               |  5 ++++-
 lib/netdev-offload-dpdk.c | 14 +++++++++++---
 2 files changed, 15 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/lib/dpctl.c b/lib/dpctl.c
index db2b1f896..93e73e99a 100644
--- a/lib/dpctl.c
+++ b/lib/dpctl.c
@@ -819,7 +819,10 @@  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");
+                ds_put_cstr(ds, ", offloaded:partial");
+        } else if (f->attrs.dp_layer &&
+                   !strcmp(f->attrs.dp_layer, "ovs,dpdk")) {
+                ds_put_cstr(ds, ", offloaded:partial-action");
         } else {
             ds_put_cstr(ds, ", offloaded:yes");
         }
diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index a4da03e62..7190d417b 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -61,6 +61,7 @@  struct ufid_to_rte_flow_data {
     uint32_t refcnt;
     struct rte_flow *rte_flow;
     bool actions_offloaded;
+    bool partial_actions_offloaded;
     struct dpif_flow_stats stats;
 };
 
@@ -82,7 +83,8 @@  ufid_to_rte_flow_data_find(const ovs_u128 *ufid)
 
 static inline void
 ufid_to_rte_flow_associate(const ovs_u128 *ufid,
-                           struct rte_flow *rte_flow, bool actions_offloaded)
+                           struct rte_flow *rte_flow, bool actions_offloaded,
+                           bool partial_actions_offloaded)
 {
     size_t hash = hash_bytes(ufid, sizeof *ufid, 0);
     struct ufid_to_rte_flow_data *data = xzalloc(sizeof *data);
@@ -103,6 +105,7 @@  ufid_to_rte_flow_associate(const ovs_u128 *ufid,
     data->ufid = *ufid;
     data->rte_flow = rte_flow;
     data->actions_offloaded = actions_offloaded;
+    data->partial_actions_offloaded = partial_actions_offloaded;
 
     cmap_insert(&ufid_to_rte_flow,
                 CONST_CAST(struct cmap_node *, &data->node), hash);
@@ -1479,7 +1482,8 @@  netdev_offload_dpdk_add_flow(struct netdev *netdev,
         ret = -1;
         goto out;
     }
-    ufid_to_rte_flow_associate(ufid, flow, actions_offloaded);
+    ufid_to_rte_flow_associate(ufid, flow, actions_offloaded,
+                               info->partial_actions_offloaded);
     VLOG_DBG("%s: installed flow %p by ufid "UUID_FMT,
              netdev_get_name(netdev), flow, UUID_ARGS((struct uuid *)ufid));
 
@@ -1605,7 +1609,11 @@  netdev_offload_dpdk_flow_get(struct netdev *netdev,
 
     attrs->offloaded = true;
     if (!rte_flow_data->actions_offloaded) {
-        attrs->dp_layer = "ovs";
+        if (!rte_flow_data->partial_actions_offloaded) {
+            attrs->dp_layer = "ovs";
+        } else {
+            attrs->dp_layer = "ovs,dpdk";
+        }
         memset(stats, 0, sizeof *stats);
         goto out;
     }