return;
}
- mask->vlan_tci_mask = res->vlan_mask;
+ mask->vlan_tci_mask = rte_cpu_to_be_16(res->vlan_mask);
} else if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) {
if (strcmp(res->mode_value, "Tunnel")) {
printf("Please set mode to Tunnel.\n");
return;
}
- mask->vlan_tci_mask = res->vlan_mask;
+ mask->vlan_tci_mask = rte_cpu_to_be_16(res->vlan_mask);
mask->mac_addr_byte_mask = res->mac_addr_byte_mask;
- mask->tunnel_id_mask = res->tunnel_id_mask;
+ mask->tunnel_id_mask = rte_cpu_to_be_32(res->tunnel_id_mask);
mask->tunnel_type_mask = res->tunnel_type_mask;
} else {
if (strcmp(res->mode_value, "IP")) {
static inline void
print_fdir_mask(struct rte_eth_fdir_masks *mask)
{
- printf("\n vlan_tci: 0x%04x", mask->vlan_tci_mask);
+ printf("\n vlan_tci: 0x%04x", rte_be_to_cpu_16(mask->vlan_tci_mask));
if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL)
printf(", mac_addr: 0x%02x, tunnel_type: 0x%01x,"
" tunnel_id: 0x%08x",
mask->mac_addr_byte_mask, mask->tunnel_type_mask,
- mask->tunnel_id_mask);
+ rte_be_to_cpu_32(mask->tunnel_id_mask));
else if (fdir_conf.mode != RTE_FDIR_MODE_PERFECT_MAC_VLAN) {
- printf(", src_ipv4: 0x%08x, dst_ipv4: 0x%08x,"
- " src_port: 0x%04x, dst_port: 0x%04x",
- mask->ipv4_mask.src_ip, mask->ipv4_mask.dst_ip,
- mask->src_port_mask, mask->dst_port_mask);
-
- printf("\n src_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x,"
- " dst_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x",
- mask->ipv6_mask.src_ip[0], mask->ipv6_mask.src_ip[1],
- mask->ipv6_mask.src_ip[2], mask->ipv6_mask.src_ip[3],
- mask->ipv6_mask.dst_ip[0], mask->ipv6_mask.dst_ip[1],
- mask->ipv6_mask.dst_ip[2], mask->ipv6_mask.dst_ip[3]);
+ printf(", src_ipv4: 0x%08x, dst_ipv4: 0x%08x",
+ rte_be_to_cpu_32(mask->ipv4_mask.src_ip),
+ rte_be_to_cpu_32(mask->ipv4_mask.dst_ip));
+
+ printf("\n src_port: 0x%04x, dst_port: 0x%04x",
+ rte_be_to_cpu_16(mask->src_port_mask),
+ rte_be_to_cpu_16(mask->dst_port_mask));
+
+ printf("\n src_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x",
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[0]),
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[1]),
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[2]),
+ rte_be_to_cpu_32(mask->ipv6_mask.src_ip[3]));
+
+ printf("\n dst_ipv6: 0x%08x,0x%08x,0x%08x,0x%08x",
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[0]),
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[1]),
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[2]),
+ rte_be_to_cpu_32(mask->ipv6_mask.dst_ip[3]));
}
printf("\n");