Commit ea5ceeab authored by Tushar Dave's avatar Tushar Dave Committed by Jeff Kirsher

igb: Correcting and improving small packet check and padding

Current implementation mess up the tail pointer. This patch sets skb->tail
correctly.
Also, the small packet check and padding is optimized by using unlikely and
calling skb_pad directly.
Signed-off-by: default avatarTushar Dave <tushar.n.dave@intel.com>
Tested-by: default avatarJeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 374c65d6
...@@ -4467,10 +4467,11 @@ static netdev_tx_t igb_xmit_frame(struct sk_buff *skb, ...@@ -4467,10 +4467,11 @@ 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 * The minimum packet size with TCTL.PSP set is 17 so pad the skb
* in order to meet this minimum size requirement. * in order to meet this minimum size requirement.
*/ */
if (skb->len < 17) { if (unlikely(skb->len < 17)) {
if (skb_padto(skb, 17)) if (skb_pad(skb, 17 - skb->len))
return NETDEV_TX_OK; return NETDEV_TX_OK;
skb->len = 17; skb->len = 17;
skb_set_tail_pointer(skb, 17);
} }
return igb_xmit_frame_ring(skb, igb_tx_queue_mapping(adapter, skb)); return igb_xmit_frame_ring(skb, igb_tx_queue_mapping(adapter, skb));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment