diff options
author | Bogdan Hamciuc <bogdan.hamciuc@freescale.com> | 2013-01-28 15:13:41 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-04-08 23:12:12 (GMT) |
commit | 035d120b81dca9e393d9bf6a9014460bea450837 (patch) | |
tree | 8a43a4d47bfb68f9948b3e38257b518b2d09814e /drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c | |
parent | e0c0bad623344ed8db69131fbf5a5c43039cf2f2 (diff) | |
download | linux-fsl-qoriq-035d120b81dca9e393d9bf6a9014460bea450837.tar.xz |
dpaa_eth: Make header reallocation unlikely
The headroom of an egress skb should be at least equal to
the netdevice's needed_headroom, even in forwarding cases. In fact,
the stack itself reallocs the headroom (ip_finish_output2()) if the
current one is less than LL_RESERVED_SPACE(dev).
Make the guarding condition unlikely. Probably the only scenario we're
talking about is ASF, and even that only in some cases.
Change-Id: Id87cdbd4859db2c0b1d782cd762c5245d91e31ea
Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
(cherry picked from commit 9c587291b0e5b5b7350fc5d2fa4830b485ac18e6)
Reviewed-on: http://git.am.freescale.net:8181/1041
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c index 97b31fb..0ca0c86 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c @@ -802,9 +802,10 @@ int __hot dpa_tx(struct sk_buff *skb, struct net_device *net_dev) } else { /* * Make sure we have enough headroom to accomodate private - * data, parse results, etc + * data, parse results, etc. Normally this shouldn't happen if + * we're here via the standard kernel stack. */ - if (skb_headroom(skb) < DPA_BP_HEAD) { + if (unlikely(skb_headroom(skb) < DPA_BP_HEAD)) { struct sk_buff *skb_new; skb_new = skb_realloc_headroom(skb, DPA_BP_HEAD); |