Skip to content

Commit 879c722

Browse files
Bogdan Hamciucdavem330
authored andcommitted
net: pktgen: Observe needed_headroom of the device
Allocate enough space so as not to force the outgoing net device to do skb_realloc_headroom(). Signed-off-by: Bogdan Hamciuc <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 92a99bf commit 879c722

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/core/pktgen.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,7 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)
22792279

22802280
static inline void set_pkt_overhead(struct pktgen_dev *pkt_dev)
22812281
{
2282-
pkt_dev->pkt_overhead = 0;
2282+
pkt_dev->pkt_overhead = LL_RESERVED_SPACE(pkt_dev->odev);
22832283
pkt_dev->pkt_overhead += pkt_dev->nr_labels*sizeof(u32);
22842284
pkt_dev->pkt_overhead += VLAN_TAG_SIZE(pkt_dev);
22852285
pkt_dev->pkt_overhead += SVLAN_TAG_SIZE(pkt_dev);
@@ -2788,6 +2788,7 @@ static struct sk_buff *pktgen_alloc_skb(struct net_device *dev,
27882788
} else {
27892789
skb = __netdev_alloc_skb(dev, size, GFP_NOWAIT);
27902790
}
2791+
skb_reserve(skb, LL_RESERVED_SPACE(dev));
27912792

27922793
return skb;
27932794
}

0 commit comments

Comments
 (0)