19/05/2017 17:21, Gaetan Rivet: > --- a/lib/librte_ether/rte_flow.c > +++ b/lib/librte_ether/rte_flow.c > @@ -33,12 +33,70 @@ > > #include <stdint.h> > > +#include <rte_common.h> > #include <rte_errno.h> > #include <rte_branch_prediction.h> > #include "rte_ethdev.h" > #include "rte_flow_driver.h" > #include "rte_flow.h" > > +/** Generate flow_item[] entry. */ > +#define MK_FLOW_ITEM(t, s) \ > + [RTE_FLOW_ITEM_TYPE_ ## t] = { \ > + .name t, \ > + .size = s, \ > + } > + > +/** Information about known flow pattern items. */ > +const struct rte_flow_desc_data rte_flow_desc_item[] = { > + MK_FLOW_ITEM(END, 0), > + MK_FLOW_ITEM(VOID, 0), > + MK_FLOW_ITEM(INVERT, 0), > + MK_FLOW_ITEM(ANY, sizeof(struct rte_flow_item_any)), > + MK_FLOW_ITEM(PF, 0), > + MK_FLOW_ITEM(VF, sizeof(struct rte_flow_item_vf)), > + MK_FLOW_ITEM(PORT, sizeof(struct rte_flow_item_port)), > + MK_FLOW_ITEM(RAW, sizeof(struct rte_flow_item_raw)), /* +pattern[] */ > + MK_FLOW_ITEM(ETH, sizeof(struct rte_flow_item_eth)), > + MK_FLOW_ITEM(VLAN, sizeof(struct rte_flow_item_vlan)), > + MK_FLOW_ITEM(IPV4, sizeof(struct rte_flow_item_ipv4)), > + MK_FLOW_ITEM(IPV6, sizeof(struct rte_flow_item_ipv6)), > + MK_FLOW_ITEM(ICMP, sizeof(struct rte_flow_item_icmp)), > + MK_FLOW_ITEM(UDP, sizeof(struct rte_flow_item_udp)), > + MK_FLOW_ITEM(TCP, sizeof(struct rte_flow_item_tcp)), > + MK_FLOW_ITEM(SCTP, sizeof(struct rte_flow_item_sctp)), > + MK_FLOW_ITEM(VXLAN, sizeof(struct rte_flow_item_vxlan)), > + MK_FLOW_ITEM(MPLS, sizeof(struct rte_flow_item_mpls)), > + MK_FLOW_ITEM(GRE, sizeof(struct rte_flow_item_gre)), > +};
When rebasing, do not forget these new lines: + MK_FLOW_ITEM(E_TAG, sizeof(struct rte_flow_item_e_tag)), + MK_FLOW_ITEM(NVGRE, sizeof(struct rte_flow_item_nvgre)), from 0f01a7e38394 ("app/testpmd: fix creating E-Tag and NVGRE flow rules")