aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTushar Dave <tushar.n.dave@intel.com>2012-09-13 23:43:43 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-10-19 07:23:29 -0400
commitea5ceeabf5621ed36d24e6741b45cfd1e1fce11b (patch)
treecfdf89e57309ca380d96d180cdd58c63aff1d955
parent374c65d6664a498c3997616161894bd9f55fab54 (diff)
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: Tushar Dave <tushar.n.dave@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index e1ceb37ef12e..c611cffa788f 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -4467,10 +4467,11 @@ static netdev_tx_t igb_xmit_frame(struct sk_buff *skb,
4467 * The minimum packet size with TCTL.PSP set is 17 so pad the skb 4467 * The minimum packet size with TCTL.PSP set is 17 so pad the skb
4468 * in order to meet this minimum size requirement. 4468 * in order to meet this minimum size requirement.
4469 */ 4469 */
4470 if (skb->len < 17) { 4470 if (unlikely(skb->len < 17)) {
4471 if (skb_padto(skb, 17)) 4471 if (skb_pad(skb, 17 - skb->len))
4472 return NETDEV_TX_OK; 4472 return NETDEV_TX_OK;
4473 skb->len = 17; 4473 skb->len = 17;
4474 skb_set_tail_pointer(skb, 17);
4474 } 4475 }
4475 4476
4476 return igb_xmit_frame_ring(skb, igb_tx_queue_mapping(adapter, skb)); 4477 return igb_xmit_frame_ring(skb, igb_tx_queue_mapping(adapter, skb));