diff mbox series

[ovs-dev,20/62] netdev-dpdk: Add flow_api support for netdev vports

Message ID 20201228092520.11807-21-taoyunxiang@cmss.chinamobile.com
State Not Applicable
Headers show
Series DPDK Offload API to test | expand

Commit Message

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

Code Source From: Self Code
Description:

    Currently vport devices with dpif type "system" are rejected as part of
netdev_offload_dpdk_init_flow_api() call. It is correct but we also need
to specify what should be accepted.  We should accept vport devices with
dpif type "netdev". This commit add the acceptance of such devices to
netdev_dpdk_flow_api_supported() API. This will allow any vport of type
"netdev" to be considered for offloading by flow_put().

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

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 7ab8186..22f7044 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -5333,6 +5333,12 @@  netdev_dpdk_flow_api_supported(struct netdev *netdev)
     struct netdev_dpdk *dev;
     bool ret = false;
 
+    if (netdev_vport_is_vport_class(netdev->netdev_class) &&
+        !strcmp(netdev_get_dpif_type(netdev), "netdev")) {
+            ret = true;
+            goto out;
+    }
+
     if (!is_dpdk_class(netdev->netdev_class)) {
         goto out;
     }
diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index 96a295f..338a272 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -1559,13 +1559,6 @@  netdev_offload_dpdk_flow_del(struct netdev *netdev, const ovs_u128 *ufid,
 static int
 netdev_offload_dpdk_init_flow_api(struct netdev *netdev)
 {
-    if (netdev_vport_is_vport_class(netdev->netdev_class)
-        && !strcmp(netdev_get_dpif_type(netdev), "system")) {
-        VLOG_DBG("%s: vport belongs to the system datapath. Skipping.",
-                 netdev_get_name(netdev));
-        return EOPNOTSUPP;
-    }
-
     return netdev_dpdk_flow_api_supported(netdev) ? 0 : EOPNOTSUPP;
 }