Lines Matching +full:big +full:- +full:endian +full:- +full:desc
1 // SPDX-License-Identifier: GPL-2.0-or-later
17 /* skb_segment expects skb->data at start of payload */ in __init_skb()
23 skb->protocol = htons(ETH_P_ATALK); in __init_skb()
24 skb_shinfo(skb)->gso_size = GSO_TEST_SIZE; in __init_skb()
140 static void gso_test_case_to_desc(struct gso_test_case *t, char *desc) in gso_test_case_to_desc() argument
142 sprintf(desc, "%s", t->name); in gso_test_case_to_desc()
156 tcase = test->param_value; in gso_test_func()
160 skb = build_skb(page_address(page), sizeof(hdr) + tcase->linear_len + shinfo_size); in gso_test_func()
162 __skb_put(skb, sizeof(hdr) + tcase->linear_len); in gso_test_func()
166 if (tcase->nr_frags) { in gso_test_func()
171 page_ref_add(page, tcase->nr_frags - 1); in gso_test_func()
173 for (i = 0; i < tcase->nr_frags; i++) { in gso_test_func()
174 skb_fill_page_desc(skb, i, page, pg_off, tcase->frags[i]); in gso_test_func()
175 pg_off += tcase->frags[i]; in gso_test_func()
180 skb->data_len = pg_off; in gso_test_func()
181 skb->len += skb->data_len; in gso_test_func()
182 skb->truesize += skb->data_len; in gso_test_func()
185 if (tcase->frag_skbs) { in gso_test_func()
189 for (i = 0; i < tcase->nr_frag_skbs; i++) { in gso_test_func()
195 frag_size = tcase->frag_skbs[i]; in gso_test_func()
202 prev->next = frag_skb; in gso_test_func()
204 skb_shinfo(skb)->frag_list = frag_skb; in gso_test_func()
208 total_true_size += frag_skb->truesize; in gso_test_func()
211 skb->len += total_size; in gso_test_func()
212 skb->data_len += total_size; in gso_test_func()
213 skb->truesize += total_true_size; in gso_test_func()
215 if (tcase->id == GSO_TEST_GSO_BY_FRAGS) in gso_test_func()
216 skb_shinfo(skb)->gso_size = GSO_BY_FRAGS; in gso_test_func()
220 if (tcase->id == GSO_TEST_GSO_PARTIAL) in gso_test_func()
226 if (tcase->id == GSO_TEST_FRAG_LIST_NON_UNIFORM) in gso_test_func()
238 last = segs->prev; in gso_test_func()
240 next = cur->next; in gso_test_func()
242 KUNIT_ASSERT_EQ(test, cur->len, sizeof(hdr) + tcase->segs[i]); in gso_test_func()
244 /* segs have skb->data pointing to the mac header */ in gso_test_func()
245 KUNIT_ASSERT_PTR_EQ(test, skb_mac_header(cur), cur->data); in gso_test_func()
246 KUNIT_ASSERT_PTR_EQ(test, skb_network_header(cur), cur->data + sizeof(hdr)); in gso_test_func()
251 /* last seg can be found through segs->prev pointer */ in gso_test_func()
258 KUNIT_ASSERT_EQ(test, i, tcase->nr_segs); in gso_test_func()
290 /* These are __be16-compatible and can be compared as is */
298 * ``IP_TUNNEL_CSUM_BIT`` (on Big Endian) or ``IP_TUNNEL_DONT_FRAGMENT_BIT``
301 * backward-compatible.
345 char *desc) in ip_tunnel_flags_test_case_to_desc() argument
347 strscpy(desc, t->name, KUNIT_PARAM_DESC_SIZE); in ip_tunnel_flags_test_case_to_desc()
354 const struct ip_tunnel_flags_test *t = test->param_value; in ip_tunnel_flags_test_run()
359 for (u32 j = 0; j < t->src_num; j++) in ip_tunnel_flags_test_run()
360 __set_bit(t->src_bits[j], src); in ip_tunnel_flags_test_run()
361 for (u32 j = 0; j < t->exp_num; j++) in ip_tunnel_flags_test_run()
362 __set_bit(t->exp_bits[j], exp); in ip_tunnel_flags_test_run()
364 KUNIT_ASSERT_EQ(test, t->exp_comp, in ip_tunnel_flags_test_run()
366 KUNIT_ASSERT_EQ(test, (__force u16)t->exp_val, in ip_tunnel_flags_test_run()
369 ip_tunnel_flags_from_be16(out, t->exp_val); in ip_tunnel_flags_test_run()