} else {
ds_put_format(s, " Set-%s-tcp/udp-port = null\n", dirstr);
}
+ } else if (actions->type == RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN) {
+ const struct rte_flow_action_of_push_vlan *rte_push_vlan;
+
+ rte_push_vlan = actions->conf;
+ ds_put_cstr(s, "rte flow push-vlan action:\n");
+ if (rte_push_vlan) {
+ ds_put_format(s, " Push-vlan: 0x%"PRIx16"\n",
+ ntohs(rte_push_vlan->ethertype));
+ } else {
+ ds_put_format(s, " Push-vlan = null\n");
+ }
+ } else if (actions->type == RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP) {
+ const struct rte_flow_action_of_set_vlan_pcp *rte_vlan_pcp;
+
+ rte_vlan_pcp = actions->conf;
+ ds_put_cstr(s, "rte flow set-vlan-pcp action:\n");
+ if (rte_vlan_pcp) {
+ ds_put_format(s, " Set-vlan-pcp: %"PRIu8"\n",
+ rte_vlan_pcp->vlan_pcp);
+ } else {
+ ds_put_format(s, " Set-vlan-pcp = null\n");
+ }
+ } else if (actions->type == RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID) {
+ const struct rte_flow_action_of_set_vlan_vid *rte_vlan_vid;
+
+ rte_vlan_vid = actions->conf;
+ ds_put_cstr(s, "rte flow set-vlan-vid action:\n");
+ if (rte_vlan_vid) {
+ ds_put_format(s, " Set-vlan-vid: %"PRIu16"\n",
+ ntohs(rte_vlan_vid->vlan_vid));
+ } else {
+ ds_put_format(s, " Set-vlan-vid = null\n");
+ }
+ } else if (actions->type == RTE_FLOW_ACTION_TYPE_OF_POP_VLAN) {
+ ds_put_cstr(s, "rte flow pop-vlan action\n");
} else {
ds_put_format(s, "unknown rte flow action (%d)\n", actions->type);
}
return 0;
}
+static int
+parse_vlan_push_action(struct flow_actions *actions,
+ const struct ovs_action_push_vlan *vlan_push)
+{
+ struct rte_flow_action_of_push_vlan *rte_push_vlan;
+ struct rte_flow_action_of_set_vlan_pcp *rte_vlan_pcp;
+ struct rte_flow_action_of_set_vlan_vid *rte_vlan_vid;
+
+ rte_push_vlan = xzalloc(sizeof *rte_push_vlan);
+ rte_push_vlan->ethertype = vlan_push->vlan_tpid;
+ add_flow_action(actions, RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN, rte_push_vlan);
+
+ rte_vlan_pcp = xzalloc(sizeof *rte_vlan_pcp);
+ rte_vlan_pcp->vlan_pcp = vlan_tci_to_pcp(vlan_push->vlan_tci);
+ add_flow_action(actions, RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP,
+ rte_vlan_pcp);
+
+ rte_vlan_vid = xzalloc(sizeof *rte_vlan_vid);
+ rte_vlan_vid->vlan_vid = htons(vlan_tci_to_vid(vlan_push->vlan_tci));
+ add_flow_action(actions, RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID,
+ rte_vlan_vid);
+ return 0;
+}
+
static int
parse_flow_actions(struct netdev *netdev,
struct flow_actions *actions,
masked)) {
return -1;
}
+ } else if (nl_attr_type(nla) == OVS_ACTION_ATTR_PUSH_VLAN) {
+ const struct ovs_action_push_vlan *vlan = nl_attr_get(nla);
+
+ if (parse_vlan_push_action(actions, vlan)) {
+ return -1;
+ }
+ } 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;