|
@@ -5091,12 +5091,8 @@ static netdev_tx_t igb_xmit_frame(struct sk_buff *skb,
|
|
|
/* The minimum packet size with TCTL.PSP set is 17 so pad the skb
|
|
|
* in order to meet this minimum size requirement.
|
|
|
*/
|
|
|
- if (unlikely(skb->len < 17)) {
|
|
|
- if (skb_pad(skb, 17 - skb->len))
|
|
|
- return NETDEV_TX_OK;
|
|
|
- skb->len = 17;
|
|
|
- skb_set_tail_pointer(skb, 17);
|
|
|
- }
|
|
|
+ if (skb_put_padto(skb, 17))
|
|
|
+ return NETDEV_TX_OK;
|
|
|
|
|
|
return igb_xmit_frame_ring(skb, igb_tx_queue_mapping(adapter, skb));
|
|
|
}
|
|
@@ -6850,14 +6846,9 @@ static bool igb_cleanup_headers(struct igb_ring *rx_ring,
|
|
|
if (skb_is_nonlinear(skb))
|
|
|
igb_pull_tail(rx_ring, rx_desc, skb);
|
|
|
|
|
|
- /* if skb_pad returns an error the skb was freed */
|
|
|
- if (unlikely(skb->len < 60)) {
|
|
|
- int pad_len = 60 - skb->len;
|
|
|
-
|
|
|
- if (skb_pad(skb, pad_len))
|
|
|
- return true;
|
|
|
- __skb_put(skb, pad_len);
|
|
|
- }
|
|
|
+ /* if eth_skb_pad returns an error the skb was freed */
|
|
|
+ if (eth_skb_pad(skb))
|
|
|
+ return true;
|
|
|
|
|
|
return false;
|
|
|
}
|