#define MAX_PATTERN_NUM 4
struct rte_flow *
generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,
uint32_t src_ip, uint32_t src_mask,
uint32_t dest_ip, uint32_t dest_mask,
struct rte_flow *
generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,
uint32_t src_ip, uint32_t src_mask,
uint32_t dest_ip, uint32_t dest_mask,
{
struct rte_flow_action action[MAX_PATTERN_NUM];
struct rte_flow *flow = NULL;
int res;
memset(pattern, 0, sizeof(pattern));
memset(action, 0, sizeof(action));
attr.ingress = 1;
action[0].conf = &queue;
eth_spec.type = 0;
eth_mask.type = 0;
pattern[0].spec = ð_spec;
pattern[0].mask = ð_mask;
pattern[1].spec = &vlan_spec;
pattern[1].mask = &vlan_mask;
ip_spec.hdr.dst_addr = htonl(dest_ip);
ip_mask.hdr.dst_addr = dest_mask;
ip_spec.hdr.src_addr = htonl(src_ip);
ip_mask.hdr.src_addr = src_mask;
pattern[2].spec = &ip_spec;
pattern[2].mask = &ip_mask;
if (!res)
return flow;
}