Lines Matching refs:skb
241 struct sk_buff *skb; in fill_packet() local
247 skb = alloc_skb(pkt_size+64+16, GFP_ATOMIC); in fill_packet()
248 if (!skb) { in fill_packet()
253 skb_reserve(skb, 16); in fill_packet()
256 eth = (__u8 *) skb_push(skb, 14); in fill_packet()
257 iph = (struct iphdr*)skb_put(skb, sizeof( struct iphdr)); in fill_packet()
258 udph = (struct udphdr*)skb_put(skb, sizeof( struct udphdr)); in fill_packet()
284 skb->protocol = __constant_htons(ETH_P_IP); in fill_packet()
285 skb->mac.raw = ((u8*)iph) - 14; in fill_packet()
286 skb->dev = odev; in fill_packet()
287 skb->pkt_type = PACKET_HOST; in fill_packet()
290 skb_put(skb, datalen); in fill_packet()
298 skb_put(skb, datalen-frags*PAGE_SIZE); in fill_packet()
305 skb_shinfo(skb)->frags[i].page = page; in fill_packet()
306 skb_shinfo(skb)->frags[i].page_offset = 0; in fill_packet()
307 skb_shinfo(skb)->frags[i].size = (datalen < PAGE_SIZE ? datalen : PAGE_SIZE); in fill_packet()
308 datalen -= skb_shinfo(skb)->frags[i].size; in fill_packet()
309 skb->len += skb_shinfo(skb)->frags[i].size; in fill_packet()
310 skb->data_len += skb_shinfo(skb)->frags[i].size; in fill_packet()
312 skb_shinfo(skb)->nr_frags = i; in fill_packet()
321 rem = skb_shinfo(skb)->frags[i-1].size/2; in fill_packet()
325 skb_shinfo(skb)->frags[i-1].size -= rem; in fill_packet()
327 skb_shinfo(skb)->frags[i] = skb_shinfo(skb)->frags[i-1]; in fill_packet()
328 get_page(skb_shinfo(skb)->frags[i].page); in fill_packet()
329 skb_shinfo(skb)->frags[i].page = skb_shinfo(skb)->frags[i-1].page; in fill_packet()
330 skb_shinfo(skb)->frags[i].page_offset += skb_shinfo(skb)->frags[i-1].size; in fill_packet()
331 skb_shinfo(skb)->frags[i].size = rem; in fill_packet()
333 skb_shinfo(skb)->nr_frags = i; in fill_packet()
337 return skb; in fill_packet()
345 struct sk_buff *skb; in pg_inject() local
354 skb = fill_packet(odev, saddr); in pg_inject()
355 if (skb == NULL) in pg_inject()
367 atomic_inc(&skb->users); in pg_inject()
369 if (odev->hard_start_xmit(skb, odev)) { in pg_inject()
370 kfree_skb(skb); in pg_inject()
376 kfree_skb(skb); in pg_inject()
388 if (atomic_read(&skb->users) != 1) { in pg_inject()
392 while (atomic_read(&skb->users) != 1) { in pg_inject()
438 pc, skb->len, skb_shinfo(skb)->nr_frags, in pg_inject()
445 kfree_skb(skb); in pg_inject()