Monday, April 16, 2018 9:11 AM, Qi Zhang: > Subject: [dpdk-dev] [PATCH v3 4/4] ethdev: add VLAN and MPLS pop push > action in flow API > > Add couple Openflow frienldy VLAN/MPLS push/pop actions. > > RTE_FLOW_ACTION_VLAN_POP - pop a VLAN header. > RTE_FLOW_ACTION_VLAN_PUSH - push a VLAN header. > RTE_FLOW_ACTION_MPLS_POP - pop a MPLS header. > RTE_FLOW_ACTION_MPLS_PUSH - push a MPLS header. > > Signed-off-by: Qi Zhang <qi.z.zh...@intel.com> > ---
> /** > @@ -1501,6 +1536,42 @@ struct rte_flow_action_ip_ttl_dec { }; > > /** > + * RTE_FLOW_ACTION_TYPE_VLAN_PUSH, > + * > + * Push a new VLAN header onto the packet, Ethertype 0x8100 or 0x88a8 > + * should be used. The value of VLAN ID and VLAN priority for the new > + * header is copied from an exist outermost VLAN header in the packet, > + * they will be set to 0 if no such VLAN header exist. > + */ > +struct rte_flow_action_vlan_push { > + rte_be16_t ether_type; /**< Ethertype for vlan tag. */ }; > + I may have missed this also in the previous discussions. But why limit the VLAN ID and prio to 0 if not exists? Why not to enable the application to define the full VLAN header it wants to push? The default, if application hasn't specified any, can be what you suggest. > +/** > + * RTE_FLOW_ACTION_TYPE_MPLS_POP, > + * > + * Pop the outer-most MPLS header from the packet, Ethertype is > + * required for the resulting packet if it is not the last MPLS > + * header be popped, Ethertype must be 0x8847 or 0x8848. > + */ > +struct rte_flow_action_mpls_pop { > + rte_be16_t ether_type; /**< Ethertype for MPLS header */ }; > + > +/** > + * RTE_FLOW_ACTION_TYPE_MPLS_PUSH, > + * > + * Push a new MPLS header onto the packet, Ethertype 0x8847 or 0x8848 > + * should be used. The value of MPLS label and traffic class are copied > + * from exist outermost MPLS header, and TTL is copied from exist > +outermost I guess those are derived from OF spec. > + * MPLS or IP header, they will be set to 0, if exist packet does not > + * contain required header. > + */ > +struct rte_flow_action_mpls_push { > + rte_be16_t ether_type; /**< Ethertype for MPLS header */ }; > + Same question as above - why not let the user to specify its MPLS header and have what you suggest as default behavior? > +/** > * Definition of a single action. > * > * A list of actions is terminated by a END action. > -- > 2.13.6