[ovs-dev] dpif: Setting vlan tci for qinq

Thomas F Herbert thomasfherbert at gmail.com
Mon Aug 18 10:44:32 UTC 2014


I have been working on 802.1ad qinq and I have been puzzled by this 
construct in odp-util.c
where vlan sets are put in the database with a pop, a set of the tci 
into the struct and then a push. I think this is because the push vlan 
is the
only way to pass a vlan_tci through the dpif to the linux kernel. This 
makes it difficult to implement stacked vlans and I think it is the last 
remaining issue.
What is the best way to address this while not breaking existing VLAN 
behavior? Should I introduce another action attribute, 
OVS_ACTION_ATTR_SET_VLAN or is there a way to utilize the

static void
commit_vlan_action(ovs_be16 vlan_tci, struct flow *base,
                    struct ofpbuf *odp_actions, struct flow_wildcards *wc)
     if (base->vlan_tci == vlan_tci) {

     pop_vlan(base, odp_actions, wc);
     if (vlan_tci & htons(VLAN_CFI)) {
         struct ovs_action_push_vlan vlan;

         vlan.vlan_tpid = htons(ETH_TYPE_VLAN);
         vlan.vlan_tci = vlan_tci;
         nl_msg_put_unspec(odp_actions, OVS_ACTION_ATTR_PUSH_VLAN,
                           &vlan, sizeof vlan);
     base->vlan_tci = vlan_tci;

More information about the dev mailing list