Lines Matching refs:buf

12 	__u8 *buf;  in test_xdp_update_frags()  local
26 buf = malloc(128); in test_xdp_update_frags()
27 if (!ASSERT_OK_PTR(buf, "alloc buf 128b")) in test_xdp_update_frags()
30 memset(buf, 0, 128); in test_xdp_update_frags()
31 offset = (__u32 *)buf; in test_xdp_update_frags()
33 buf[*offset] = 0xaa; /* marker at offset 16 (head) */ in test_xdp_update_frags()
34 buf[*offset + 15] = 0xaa; /* marker at offset 31 (head) */ in test_xdp_update_frags()
36 topts.data_in = buf; in test_xdp_update_frags()
37 topts.data_out = buf; in test_xdp_update_frags()
46 ASSERT_EQ(buf[16], 0xbb, "xdp_update_frag buf[16]"); in test_xdp_update_frags()
47 ASSERT_EQ(buf[31], 0xbb, "xdp_update_frag buf[31]"); in test_xdp_update_frags()
49 free(buf); in test_xdp_update_frags()
51 buf = malloc(9000); in test_xdp_update_frags()
52 if (!ASSERT_OK_PTR(buf, "alloc buf 9Kb")) in test_xdp_update_frags()
55 memset(buf, 0, 9000); in test_xdp_update_frags()
56 offset = (__u32 *)buf; in test_xdp_update_frags()
58 buf[*offset] = 0xaa; /* marker at offset 5000 (frag0) */ in test_xdp_update_frags()
59 buf[*offset + 15] = 0xaa; /* marker at offset 5015 (frag0) */ in test_xdp_update_frags()
61 topts.data_in = buf; in test_xdp_update_frags()
62 topts.data_out = buf; in test_xdp_update_frags()
71 ASSERT_EQ(buf[5000], 0xbb, "xdp_update_frag buf[5000]"); in test_xdp_update_frags()
72 ASSERT_EQ(buf[5015], 0xbb, "xdp_update_frag buf[5015]"); in test_xdp_update_frags()
74 memset(buf, 0, 9000); in test_xdp_update_frags()
75 offset = (__u32 *)buf; in test_xdp_update_frags()
77 buf[*offset] = 0xaa; /* marker at offset 3510 (head) */ in test_xdp_update_frags()
78 buf[*offset + 15] = 0xaa; /* marker at offset 3525 (frag0) */ in test_xdp_update_frags()
85 ASSERT_EQ(buf[3510], 0xbb, "xdp_update_frag buf[3510]"); in test_xdp_update_frags()
86 ASSERT_EQ(buf[3525], 0xbb, "xdp_update_frag buf[3525]"); in test_xdp_update_frags()
88 memset(buf, 0, 9000); in test_xdp_update_frags()
89 offset = (__u32 *)buf; in test_xdp_update_frags()
91 buf[*offset] = 0xaa; /* marker at offset 7606 (frag0) */ in test_xdp_update_frags()
92 buf[*offset + 15] = 0xaa; /* marker at offset 7621 (frag1) */ in test_xdp_update_frags()
99 ASSERT_EQ(buf[7606], 0xbb, "xdp_update_frag buf[7606]"); in test_xdp_update_frags()
100 ASSERT_EQ(buf[7621], 0xbb, "xdp_update_frag buf[7621]"); in test_xdp_update_frags()
102 free(buf); in test_xdp_update_frags()
119 buf = malloc(buf_size); in test_xdp_update_frags()
120 if (!ASSERT_OK_PTR(buf, "alloc buf")) in test_xdp_update_frags()
123 memset(buf, 0, buf_size); in test_xdp_update_frags()
124 offset = (__u32 *)buf; in test_xdp_update_frags()
126 buf[*offset] = 0xaa; in test_xdp_update_frags()
127 buf[*offset + 15] = 0xaa; in test_xdp_update_frags()
129 topts.data_in = buf; in test_xdp_update_frags()
130 topts.data_out = buf; in test_xdp_update_frags()
137 free(buf); in test_xdp_update_frags()