diff mbox series

[ovs-dev,v2,2/6] netdev-offload-dpdk: Introduce a dump_port_id helper function

Message ID 20210823160140.12788-3-salems@nvidia.com
State Deferred
Headers show
Series Adding support for multiple destinations | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Salem Sol Aug. 23, 2021, 4:01 p.m. UTC
From: Noa Levy <noae@nvidia.com>

Introduce a helper function as a pre-step towards supporting offload
multiple desinations.

Signed-off-by: Noa Levy <noae@nvidia.com>
---
 lib/netdev-offload-dpdk.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index ed59d6fcd..9b32816d1 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -454,6 +454,20 @@  dump_vxlan_encap(struct ds *s, const struct rte_flow_item *items)
     }
 }
 
+static void
+dump_port_id(struct ds *s, const void *conf)
+{
+    const struct rte_flow_action_port_id *port_id = conf;
+
+    ds_put_cstr(s, "port_id ");
+    if (port_id) {
+        ds_put_format(s, "original %d id %d ", port_id->original,
+                      port_id->id);
+        }
+        ds_put_cstr(s, "/ ");
+}
+
+
 static void
 dump_flow_action(struct ds *s, struct ds *s_extra,
                  struct flow_actions *flow_actions, int act_index)
@@ -481,14 +495,7 @@  dump_flow_action(struct ds *s, struct ds *s_extra,
     } else if (actions->type == RTE_FLOW_ACTION_TYPE_COUNT) {
         ds_put_cstr(s, "count / ");
     } else if (actions->type == RTE_FLOW_ACTION_TYPE_PORT_ID) {
-        const struct rte_flow_action_port_id *port_id = actions->conf;
-
-        ds_put_cstr(s, "port_id ");
-        if (port_id) {
-            ds_put_format(s, "original %d id %d ",
-                          port_id->original, port_id->id);
-        }
-        ds_put_cstr(s, "/ ");
+        dump_port_id(s, actions->conf);
     } else if (actions->type == RTE_FLOW_ACTION_TYPE_DROP) {
         ds_put_cstr(s, "drop / ");
     } else if (actions->type == RTE_FLOW_ACTION_TYPE_SET_MAC_SRC ||