diff options
author | Alexander Duyck <alexander.h.duyck@redhat.com> | 2014-12-03 11:17:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-08 20:47:42 -0500 |
commit | a94d9e224e3c48f57559183582c6410e7acf1d8b (patch) | |
tree | dce3ceb3bf34837c6cab7a13b3c0043fbe8eb720 /drivers/net/ethernet/intel/e1000 | |
parent | 9c0c112422a2a6b06fcddcaf21957676490cebba (diff) |
ethernet/intel: Use eth_skb_pad and skb_put_padto helpers
Update the Intel Ethernet drivers to use eth_skb_pad() and skb_put_padto
instead of doing their own implementations of the function.
Also this cleans up two other spots where skb_pad was called but the length
and tail pointers were being manipulated directly instead of just having
the padding length added via __skb_put.
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000')
-rw-r--r-- | drivers/net/ethernet/intel/e1000/e1000_main.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index 24f3986cfae2..862d1989ae1c 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
@@ -3136,12 +3136,8 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, | |||
3136 | * packets may get corrupted during padding by HW. | 3136 | * packets may get corrupted during padding by HW. |
3137 | * To WA this issue, pad all small packets manually. | 3137 | * To WA this issue, pad all small packets manually. |
3138 | */ | 3138 | */ |
3139 | if (skb->len < ETH_ZLEN) { | 3139 | if (eth_skb_pad(skb)) |
3140 | if (skb_pad(skb, ETH_ZLEN - skb->len)) | 3140 | return NETDEV_TX_OK; |
3141 | return NETDEV_TX_OK; | ||
3142 | skb->len = ETH_ZLEN; | ||
3143 | skb_set_tail_pointer(skb, ETH_ZLEN); | ||
3144 | } | ||
3145 | 3141 | ||
3146 | mss = skb_shinfo(skb)->gso_size; | 3142 | mss = skb_shinfo(skb)->gso_size; |
3147 | /* The controller does a simple calculation to | 3143 | /* The controller does a simple calculation to |