MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bswap_test_data

Function bswap_test_data

dpdk/app/test/test_acl.c:60–84  ·  view source on GitHub ↗

byteswap to cpu or network order */

Source from the content-addressed store, hash-verified

58
59/* byteswap to cpu or network order */
60static void
61bswap_test_data(struct ipv4_7tuple *data, int len, int to_be)
62{
63 int i;
64
65 for (i = 0; i < len; i++) {
66
67 if (to_be) {
68 /* swap all bytes so that they are in network order */
69 data[i].ip_dst = rte_cpu_to_be_32(data[i].ip_dst);
70 data[i].ip_src = rte_cpu_to_be_32(data[i].ip_src);
71 data[i].port_dst = rte_cpu_to_be_16(data[i].port_dst);
72 data[i].port_src = rte_cpu_to_be_16(data[i].port_src);
73 data[i].vlan = rte_cpu_to_be_16(data[i].vlan);
74 data[i].domain = rte_cpu_to_be_16(data[i].domain);
75 } else {
76 data[i].ip_dst = rte_be_to_cpu_32(data[i].ip_dst);
77 data[i].ip_src = rte_be_to_cpu_32(data[i].ip_src);
78 data[i].port_dst = rte_be_to_cpu_16(data[i].port_dst);
79 data[i].port_src = rte_be_to_cpu_16(data[i].port_src);
80 data[i].vlan = rte_be_to_cpu_16(data[i].vlan);
81 data[i].domain = rte_be_to_cpu_16(data[i].domain);
82 }
83 }
84}
85
86static int
87acl_ipv4vlan_check_rule(const struct rte_acl_ipv4vlan_rule *rule)

Callers 3

test_classify_runFunction · 0.85
test_build_ports_rangeFunction · 0.85
test_invalid_layoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected