Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[cascardo/linux.git] / drivers / net / ethernet / intel / igb / igb_main.c
index 487cd9c..485d2c6 100644 (file)
@@ -3375,14 +3375,11 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
        struct e1000_hw *hw = &adapter->hw;
        u32 mrqc, rxcsum;
        u32 j, num_rx_queues;
-       static const u32 rsskey[10] = { 0xDA565A6D, 0xC20E5B25, 0x3D256741,
-                                       0xB08FA343, 0xCB2BCAD0, 0xB4307BAE,
-                                       0xA32DCB77, 0x0CF23080, 0x3BB7426A,
-                                       0xFA01ACBE };
+       u32 rss_key[10];
 
-       /* Fill out hash function seeds */
+       netdev_rss_key_fill(rss_key, sizeof(rss_key));
        for (j = 0; j < 10; j++)
-               wr32(E1000_RSSRK(j), rsskey[j]);
+               wr32(E1000_RSSRK(j), rss_key[j]);
 
        num_rx_queues = adapter->rss_queues;
 
@@ -5094,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));
 }
@@ -6651,8 +6644,7 @@ static struct sk_buff *igb_fetch_rx_buffer(struct igb_ring *rx_ring,
 #endif
 
                /* allocate a skb to store the frags */
-               skb = netdev_alloc_skb_ip_align(rx_ring->netdev,
-                                               IGB_RX_HDR_LEN);
+               skb = napi_alloc_skb(&rx_ring->q_vector->napi, IGB_RX_HDR_LEN);
                if (unlikely(!skb)) {
                        rx_ring->rx_stats.alloc_failed++;
                        return NULL;
@@ -6853,14 +6845,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;
 }
@@ -6995,7 +6982,7 @@ static bool igb_alloc_mapped_page(struct igb_ring *rx_ring,
                return true;
 
        /* alloc new page for storage */
-       page = __skb_alloc_page(GFP_ATOMIC | __GFP_COLD, NULL);
+       page = dev_alloc_page();
        if (unlikely(!page)) {
                rx_ring->rx_stats.alloc_failed++;
                return false;