diff mbox series

[ovs-dev,17/62] netdev-offload-dpdk: add vlan-pop action offloading mechanism

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

    add vlan-pop action offloading mechanism

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

Patch

diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index b20e59b..7d34870 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -428,6 +428,8 @@  dump_flow_action(struct ds *s, const struct rte_flow_action *actions)
         } else {
             ds_put_format(s, "vlan-encap: null\n");
         }
+    } else if (actions->type == RTE_FLOW_ACTION_TYPE_OF_POP_VLAN) {
+        ds_put_format(s, "vlan-decap: nop\n");
     } else if (actions->type == RTE_FLOW_ACTION_TYPE_SET_MAC_SRC ||
                actions->type == RTE_FLOW_ACTION_TYPE_SET_MAC_DST) {
         const struct rte_flow_action_set_mac *set_mac = actions->conf;
@@ -1210,6 +1212,8 @@  parse_clone_actions(struct netdev *netdev,
             vlan_tci->ethertype = vlan->vlan_tci & ~htons(VLAN_CFI);
             add_flow_action(actions, RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN,
                             vlan_tci);
+        } else if (clone_type == OVS_ACTION_ATTR_POP_VLAN) {
+            add_flow_action(actions, RTE_FLOW_ACTION_TYPE_OF_POP_VLAN, NULL);
         } else {
             VLOG_DBG_RL(&rl,
                         "Unsupported nested action inside clone(), "
@@ -1259,7 +1263,6 @@  parse_flow_actions(struct netdev *netdev,
                                     clone_actions_len,info)) {
                 return -1;
             }
-
         } else if (nl_attr_type(nla) == OVS_ACTION_ATTR_PUSH_VLAN) {
             const struct ovs_action_push_vlan *vlan = nl_attr_get(nla);
             struct rte_flow_action_of_push_vlan *vlan_tci;
@@ -1268,6 +1271,8 @@  parse_flow_actions(struct netdev *netdev,
             vlan_tci->ethertype = vlan->vlan_tci & ~htons(VLAN_CFI);
             add_flow_action(actions, RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN,
                             vlan_tci);
+        } else if (nl_attr_type(nla) == OVS_ACTION_ATTR_POP_VLAN) {
+            add_flow_action(actions, RTE_FLOW_ACTION_TYPE_OF_POP_VLAN, NULL);
         } else {
             VLOG_DBG_RL(&rl, "Unsupported action type %d", nl_attr_type(nla));
             return -1;