loc = &pkt[ICE_FDIR_TUN_PKT_OFF];
}
+ /* Reverse the src and dst, since the HW expects them to be from Tx
+ * perspective. The input from user is from Rx filter perspective.
+ */
switch (flow) {
case ICE_FLTR_PTYPE_NONF_IPV4_TCP:
ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET,
- input->ip.v4.dst_ip);
+ input->ip.v4.src_ip);
ice_pkt_insert_u16(loc, ICE_IPV4_TCP_DST_PORT_OFFSET,
- input->ip.v4.dst_port);
+ input->ip.v4.src_port);
ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET,
- input->ip.v4.src_ip);
+ input->ip.v4.dst_ip);
ice_pkt_insert_u16(loc, ICE_IPV4_TCP_SRC_PORT_OFFSET,
- input->ip.v4.src_port);
+ input->ip.v4.dst_port);
ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos);
ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl);
ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac);
break;
case ICE_FLTR_PTYPE_NONF_IPV4_UDP:
ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET,
- input->ip.v4.dst_ip);
+ input->ip.v4.src_ip);
ice_pkt_insert_u16(loc, ICE_IPV4_UDP_DST_PORT_OFFSET,
- input->ip.v4.dst_port);
+ input->ip.v4.src_port);
ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET,
- input->ip.v4.src_ip);
+ input->ip.v4.dst_ip);
ice_pkt_insert_u16(loc, ICE_IPV4_UDP_SRC_PORT_OFFSET,
- input->ip.v4.src_port);
+ input->ip.v4.dst_port);
ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos);
ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl);
ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac);
break;
case ICE_FLTR_PTYPE_NONF_IPV4_SCTP:
ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET,
- input->ip.v4.dst_ip);
+ input->ip.v4.src_ip);
ice_pkt_insert_u16(loc, ICE_IPV4_SCTP_DST_PORT_OFFSET,
- input->ip.v4.dst_port);
+ input->ip.v4.src_port);
ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET,
- input->ip.v4.src_ip);
+ input->ip.v4.dst_ip);
ice_pkt_insert_u16(loc, ICE_IPV4_SCTP_SRC_PORT_OFFSET,
- input->ip.v4.src_port);
+ input->ip.v4.dst_port);
ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos);
ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl);
ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac);
break;
case ICE_FLTR_PTYPE_NONF_IPV4_OTHER:
ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET,
- input->ip.v4.dst_ip);
- ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET,
input->ip.v4.src_ip);
+ ice_pkt_insert_u32(loc, ICE_IPV4_SRC_ADDR_OFFSET,
+ input->ip.v4.dst_ip);
ice_pkt_insert_u8(loc, ICE_IPV4_TOS_OFFSET, input->ip.v4.tos);
ice_pkt_insert_u8(loc, ICE_IPV4_TTL_OFFSET, input->ip.v4.ttl);
ice_pkt_insert_u8(loc, ICE_IPV4_PROTO_OFFSET,
break;
case ICE_FLTR_PTYPE_NONF_IPV6_TCP:
ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET,
- input->ip.v6.dst_ip);
- ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET,
input->ip.v6.src_ip);
+ ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET,
+ input->ip.v6.dst_ip);
ice_pkt_insert_u16(loc, ICE_IPV6_TCP_DST_PORT_OFFSET,
- input->ip.v6.dst_port);
- ice_pkt_insert_u16(loc, ICE_IPV6_TCP_SRC_PORT_OFFSET,
input->ip.v6.src_port);
+ ice_pkt_insert_u16(loc, ICE_IPV6_TCP_SRC_PORT_OFFSET,
+ input->ip.v6.dst_port);
ice_pkt_insert_u8_tc(loc, ICE_IPV6_TC_OFFSET, input->ip.v6.tc);
ice_pkt_insert_u8(loc, ICE_IPV6_HLIM_OFFSET, input->ip.v6.hlim);
ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac);
break;
case ICE_FLTR_PTYPE_NONF_IPV6_UDP:
ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET,
- input->ip.v6.dst_ip);
- ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET,
input->ip.v6.src_ip);
+ ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET,
+ input->ip.v6.dst_ip);
ice_pkt_insert_u16(loc, ICE_IPV6_UDP_DST_PORT_OFFSET,
- input->ip.v6.dst_port);
- ice_pkt_insert_u16(loc, ICE_IPV6_UDP_SRC_PORT_OFFSET,
input->ip.v6.src_port);
+ ice_pkt_insert_u16(loc, ICE_IPV6_UDP_SRC_PORT_OFFSET,
+ input->ip.v6.dst_port);
ice_pkt_insert_u8_tc(loc, ICE_IPV6_TC_OFFSET, input->ip.v6.tc);
ice_pkt_insert_u8(loc, ICE_IPV6_HLIM_OFFSET, input->ip.v6.hlim);
ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac);
break;
case ICE_FLTR_PTYPE_NONF_IPV6_SCTP:
ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET,
- input->ip.v6.dst_ip);
- ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET,
input->ip.v6.src_ip);
+ ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET,
+ input->ip.v6.dst_ip);
ice_pkt_insert_u16(loc, ICE_IPV6_SCTP_DST_PORT_OFFSET,
- input->ip.v6.dst_port);
- ice_pkt_insert_u16(loc, ICE_IPV6_SCTP_SRC_PORT_OFFSET,
input->ip.v6.src_port);
+ ice_pkt_insert_u16(loc, ICE_IPV6_SCTP_SRC_PORT_OFFSET,
+ input->ip.v6.dst_port);
ice_pkt_insert_u8_tc(loc, ICE_IPV6_TC_OFFSET, input->ip.v6.tc);
ice_pkt_insert_u8(loc, ICE_IPV6_HLIM_OFFSET, input->ip.v6.hlim);
ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac);
break;
case ICE_FLTR_PTYPE_NONF_IPV6_OTHER:
ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET,
- input->ip.v6.dst_ip);
- ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET,
input->ip.v6.src_ip);
+ ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET,
+ input->ip.v6.dst_ip);
ice_pkt_insert_u8_tc(loc, ICE_IPV6_TC_OFFSET, input->ip.v6.tc);
ice_pkt_insert_u8(loc, ICE_IPV6_HLIM_OFFSET, input->ip.v6.hlim);
ice_pkt_insert_u8(loc, ICE_IPV6_PROTO_OFFSET,
input_set |= ICE_INSET_IPV4_PROTO;
filter->input.ip.v4.dst_ip =
- ipv4_spec->hdr.src_addr;
- filter->input.ip.v4.src_ip =
ipv4_spec->hdr.dst_addr;
+ filter->input.ip.v4.src_ip =
+ ipv4_spec->hdr.src_addr;
filter->input.ip.v4.tos =
ipv4_spec->hdr.type_of_service;
filter->input.ip.v4.ttl =
input_set |= ICE_INSET_IPV6_HOP_LIMIT;
rte_memcpy(filter->input.ip.v6.dst_ip,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(filter->input.ip.v6.src_ip,
ipv6_spec->hdr.dst_addr, 16);
+ rte_memcpy(filter->input.ip.v6.src_ip,
+ ipv6_spec->hdr.src_addr, 16);
vtc_flow_cpu =
rte_be_to_cpu_32(ipv6_spec->hdr.vtc_flow);
/* Get filter info */
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4) {
filter->input.ip.v4.dst_port =
- tcp_spec->hdr.src_port;
- filter->input.ip.v4.src_port =
tcp_spec->hdr.dst_port;
+ filter->input.ip.v4.src_port =
+ tcp_spec->hdr.src_port;
} else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
filter->input.ip.v6.dst_port =
- tcp_spec->hdr.src_port;
- filter->input.ip.v6.src_port =
tcp_spec->hdr.dst_port;
+ filter->input.ip.v6.src_port =
+ tcp_spec->hdr.src_port;
}
}
break;
/* Get filter info */
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4) {
filter->input.ip.v4.dst_port =
- udp_spec->hdr.src_port;
- filter->input.ip.v4.src_port =
udp_spec->hdr.dst_port;
+ filter->input.ip.v4.src_port =
+ udp_spec->hdr.src_port;
} else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
filter->input.ip.v6.src_port =
- udp_spec->hdr.dst_port;
- filter->input.ip.v6.dst_port =
udp_spec->hdr.src_port;
+ filter->input.ip.v6.dst_port =
+ udp_spec->hdr.dst_port;
}
}
break;
/* Get filter info */
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4) {
filter->input.ip.v4.dst_port =
- sctp_spec->hdr.src_port;
- filter->input.ip.v4.src_port =
sctp_spec->hdr.dst_port;
+ filter->input.ip.v4.src_port =
+ sctp_spec->hdr.src_port;
} else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6) {
filter->input.ip.v6.dst_port =
- sctp_spec->hdr.src_port;
- filter->input.ip.v6.src_port =
sctp_spec->hdr.dst_port;
+ filter->input.ip.v6.src_port =
+ sctp_spec->hdr.src_port;
}
}
break;