diff mbox series

[ovs-dev,38/62] netdev-offload: delete work around code

Message ID 20201228092520.11807-39-taoyunxiang@cmss.chinamobile.com
State Not Applicable
Headers show
Series [ovs-dev] db-ctl-base: add uuid specified method for create cmd | expand

Commit Message

Tao YunXiang Dec. 28, 2020, 9:24 a.m. UTC
From: Rongyin <rongyin@cmss.chinamobile.com>

Code Source From: Self Code

Description:

     Flow delete work around code

Jira:  #[Optional]
市场项目编号(名称):[Optional]
---
 lib/netdev-offload-dpdk.c     | 14 ++------------
 lib/netdev-offload-provider.h |  5 -----
 lib/netdev-offload.c          | 14 ++++----------
 3 files changed, 6 insertions(+), 27 deletions(-)
diff mbox series

Patch

diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index 21a4058..4867053 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -608,14 +608,6 @@  netdev_offload_dpdk_flow_create(struct netdev *netdev,
 
     VLOG_DBG("TIMO DBG: in netdev_offload_dpdk_flow_create %s",netdev->name);
     flow = netdev_dpdk_rte_flow_create(netdev, attr, items, actions, error);
-    /* work around: for dump_flow even if rte_flow create fail */
-    if (!VLOG_DROP_DBG(&rl)) {
-        ds_init(&s);
-        dump_flow(&s, attr, items, actions);
-        VLOG_DBG_RL(&rl, "TIMO:%s: rte_flow 0x%"PRIxPTR" printed:\n%s",
-                    netdev_get_name(netdev), (intptr_t) flow, ds_cstr(&s));
-        ds_destroy(&s);
-    }
     if (flow) {
         if (!VLOG_DROP_DBG(&rl)) {
             ds_init(&s);
@@ -1207,10 +1199,8 @@  add_output_action(struct netdev *netdev,
         VLOG_DBG_RL(&rl, "Cannot find netdev for odp port %"PRIu32, port);
         return -1;
     }
-    /* work around: to enable vhost type port tans rte_flow 
     if (!netdev_flow_api_equals(netdev, outdev) ||
-        add_port_id_action(actions, outdev)) { */
-    if (add_port_id_action(actions, outdev)) {
+        add_port_id_action(actions, outdev)) { 
         VLOG_DBG_RL(&rl, "%s: Output to port \'%s\' cannot be offloaded.",
                     netdev_get_name(netdev), netdev_get_name(outdev));
         ret = -1;
@@ -1890,7 +1880,7 @@  netdev_offload_dpdk_destroy_flow(struct netdev *netdev,
     return ret;
 }
 
-int
+static int
 netdev_offload_dpdk_flow_put(struct netdev *netdev, struct match *match,
                              struct nlattr *actions, size_t actions_len,
                              const ovs_u128 *ufid, struct offload_info *info,
diff --git a/lib/netdev-offload-provider.h b/lib/netdev-offload-provider.h
index 0c1a370..5a809c0 100644
--- a/lib/netdev-offload-provider.h
+++ b/lib/netdev-offload-provider.h
@@ -28,11 +28,6 @@ 
 extern "C" {
 #endif
 
-extern int
-netdev_offload_dpdk_flow_put(struct netdev *netdev, struct match *match,
-                             struct nlattr *actions, size_t actions_len,
-                             const ovs_u128 *ufid, struct offload_info *info,
-                             struct dpif_flow_stats *stats);
 struct netdev_flow_api {
     char *type;
     /* Flush all offloaded flows from a netdev.
diff --git a/lib/netdev-offload.c b/lib/netdev-offload.c
index a32b3fc..e054bb0 100644
--- a/lib/netdev-offload.c
+++ b/lib/netdev-offload.c
@@ -246,17 +246,11 @@  netdev_flow_put(struct netdev *netdev, struct match *match,
 {
     const struct netdev_flow_api *flow_api =
         ovsrcu_get(const struct netdev_flow_api *, &netdev->flow_api);
-    const char *netdev_type = netdev->netdev_class->type;
 
-    if (!strcmp(netdev_type, "dpdkvhostuserclient")) {
-        return netdev_offload_dpdk_flow_put(netdev, match, actions, act_len, ufid,
-                                     info, stats);
-    } else {
-        return (flow_api && flow_api->flow_put)
-               ? flow_api->flow_put(netdev, match, actions, act_len, ufid,
-                                    info, stats)
-               : EOPNOTSUPP;
-    }
+    return (flow_api && flow_api->flow_put)
+           ? flow_api->flow_put(netdev, match, actions, act_len, ufid,
+                                info, stats)
+           : EOPNOTSUPP;
 }
 
 int