]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/intel/igb/igb_main.c
igb: use netdev_rss_key_fill() helper
[karo-tx-linux.git] / drivers / net / ethernet / intel / igb / igb_main.c
index a21b14495ebd0d7b953a1d8e4b2319d23452b95e..b0e12e7c4a3d2e8df473caa218518af19c8c1fbc 100644 (file)
@@ -3372,14 +3372,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;
 
@@ -6537,6 +6534,9 @@ static bool igb_can_reuse_rx_page(struct igb_rx_buffer *rx_buffer,
        if (unlikely(page_to_nid(page) != numa_node_id()))
                return false;
 
+       if (unlikely(page->pfmemalloc))
+               return false;
+
 #if (PAGE_SIZE < 8192)
        /* if we are only owner of page we can reuse it */
        if (unlikely(page_count(page) != 1))
@@ -6603,7 +6603,8 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring,
                memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));
 
                /* we can reuse buffer as-is, just make sure it is local */
-               if (likely(page_to_nid(page) == numa_node_id()))
+               if (likely((page_to_nid(page) == numa_node_id()) &&
+                          !page->pfmemalloc))
                        return true;
 
                /* this page cannot be reused so discard it */
@@ -6984,7 +6985,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;