Skip to content

Commit

Permalink
net: pktgen: Observe needed_headroom of the device
Browse files Browse the repository at this point in the history
Allocate enough space so as not to force the outgoing net device to do
skb_realloc_headroom().

Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Bogdan Hamciuc authored and David S. Miller committed Jul 30, 2015
1 parent 92a99bf commit 879c722
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2279,7 +2279,7 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)

static inline void set_pkt_overhead(struct pktgen_dev *pkt_dev)
{
pkt_dev->pkt_overhead = 0;
pkt_dev->pkt_overhead = LL_RESERVED_SPACE(pkt_dev->odev);
pkt_dev->pkt_overhead += pkt_dev->nr_labels*sizeof(u32);
pkt_dev->pkt_overhead += VLAN_TAG_SIZE(pkt_dev);
pkt_dev->pkt_overhead += SVLAN_TAG_SIZE(pkt_dev);
Expand Down Expand Up @@ -2788,6 +2788,7 @@ static struct sk_buff *pktgen_alloc_skb(struct net_device *dev,
} else {
skb = __netdev_alloc_skb(dev, size, GFP_NOWAIT);
}
skb_reserve(skb, LL_RESERVED_SPACE(dev));

return skb;
}
Expand Down

0 comments on commit 879c722

Please sign in to comment.