Lines Matching refs:attr
20 struct net_packet_attrs *attr)
30 size = attr->size + NET_TEST_PKT_SIZE;
32 if (attr->tcp)
37 if (attr->max_size && attr->max_size > size)
38 size = attr->max_size;
53 if (attr->tcp)
60 if (attr->src)
61 ether_addr_copy(ehdr->h_source, attr->src);
62 if (attr->dst)
63 ether_addr_copy(ehdr->h_dest, attr->dst);
67 if (attr->tcp) {
69 thdr->source = htons(attr->sport);
70 thdr->dest = htons(attr->dport);
73 uhdr->source = htons(attr->sport);
74 uhdr->dest = htons(attr->dport);
75 uhdr->len = htons(sizeof(*shdr) + sizeof(*uhdr) + attr->size);
76 if (attr->max_size)
77 uhdr->len = htons(attr->max_size -
85 if (attr->tcp)
89 iplen = sizeof(*ihdr) + sizeof(*shdr) + attr->size;
90 if (attr->tcp)
95 if (attr->max_size)
96 iplen = attr->max_size - sizeof(*ehdr);
100 ihdr->saddr = htonl(attr->ip_src);
101 ihdr->daddr = htonl(attr->ip_dst);
109 attr->id = id;
112 if (attr->size) {
113 void *payload = skb_put(skb, attr->size);
115 memset(payload, 0, attr->size);
118 if (attr->max_size && attr->max_size > skb->len) {
119 size_t pad_len = attr->max_size - skb->len;
127 if (attr->tcp) {
134 if (attr->bad_csum) {
234 struct net_packet_attrs *attr)
251 tpriv->packet = attr;
254 skb = net_test_get_skb(ndev, net_test_next_id, attr);
261 ret = dev_direct_xmit(skb, attr->queue_mapping);
269 if (!attr->timeout)
270 attr->timeout = NET_LB_TIMEOUT;
272 wait_for_completion_timeout(&tpriv->comp, attr->timeout);
314 struct net_packet_attrs attr = { };
316 attr.dst = ndev->dev_addr;
317 return __net_test_loopback(ndev, &attr);
322 struct net_packet_attrs attr = { };
324 attr.dst = ndev->dev_addr;
325 attr.max_size = ndev->mtu;
326 return __net_test_loopback(ndev, &attr);
331 struct net_packet_attrs attr = { };
333 attr.dst = ndev->dev_addr;
334 attr.tcp = true;
335 return __net_test_loopback(ndev, &attr);
366 struct net_packet_attrs attr = { };
368 attr.dst = ndev->dev_addr;
369 attr.tcp = true;
370 attr.bad_csum = true;
371 return __net_test_loopback(ndev, &attr);