diff mbox series

[ovs-dev,13/62] netdev-offload-dpdk: work around for vhost type port trans to rte_flow

Message ID 20201228092520.11807-14-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:

    work around for vhost type port trans to rte_flow
Jira:  #[Optional]
市场项目编号(名称):[Optional]
---
 lib/netdev-offload-dpdk.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index befc1d6..7e59d51 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -891,8 +891,10 @@  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)) {
+        add_port_id_action(actions, outdev)) { */
+    if (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;
@@ -1044,7 +1046,7 @@  add_vxlan_encap_action(struct flow_actions *actions,
     const void *l4;
     int field;
 
-    VLOG_DBG_RL(&rl, "TIMO DBG: in add_vxlan_encap_action");
+    VLOG_DBG("TIMO DBG: in add_vxlan_encap_action");
     vxlan_data = xzalloc(sizeof *vxlan_data +
                          sizeof(struct rte_flow_item) *
                          ACTION_VXLAN_ENCAP_ITEMS_NUM);
@@ -1120,11 +1122,12 @@  parse_clone_actions(struct netdev *netdev,
 {
     const struct nlattr *ca;
     unsigned int cleft;
+    u_int8_t i = 0;
 
     NL_ATTR_FOR_EACH_UNSAFE (ca, cleft, clone_actions, clone_actions_len) {
         int clone_type = nl_attr_type(ca);
 
-        VLOG_DBG_RL(&rl, "TIMO DBG: in parse_clone_action");
+        VLOG_DBG("TIMO DBG: in parse_clone_action %0d:%d",i++,clone_type);
 
         if (clone_type == OVS_ACTION_ATTR_TUNNEL_PUSH) {
             const struct ovs_action_push_tnl *tnl_push = nl_attr_get(ca);
@@ -1146,6 +1149,9 @@  parse_clone_actions(struct netdev *netdev,
             if (add_output_action(netdev, actions, ca,info)) {
                 return -1;
             }
+        /* work around: tmp bypass vlan push action*/
+        } else if (clone_type == OVS_ACTION_ATTR_PUSH_VLAN) {
+            continue;
         } else {
             VLOG_DBG_RL(&rl,
                         "Unsupported nested action inside clone(), "
@@ -1166,9 +1172,11 @@  parse_flow_actions(struct netdev *netdev,
 {
     struct nlattr *nla;
     size_t left;
+    uint8_t i = 0;
 
     add_count_action(actions);
     NL_ATTR_FOR_EACH_UNSAFE (nla, left, nl_actions, nl_actions_len) {
+        VLOG_DBG("TIMO:action type %0d:%d",i++,nl_attr_type(nla));
         if (nl_attr_type(nla) == OVS_ACTION_ATTR_OUTPUT) {
             if (add_output_action(netdev, actions, nla, info)) {
                 return -1;