1. 12 Nov, 2014 6 commits
    • David S. Miller's avatar
      Merge branch 'skb_alloc_pages' · ee47ad42
      David S. Miller authored
      Alexander Duyck says:
      
      ====================
      Replace __skb_alloc_pages with simpler function
      
      This patch series replaces __skb_alloc_pages with a much simpler function,
      __dev_alloc_pages.  The main difference between the two is that
      __skb_alloc_pages had an sk_buff pointer that was being passed as NULL in
      call places where it was called.  In a couple of cases the NULL was passed
      by variable and this led to unnecessary code being run.
      
      As such in order to simplify things the __dev_alloc_pages call only takes a
      mask and the page order being requested.  In addition it takes advantage of
      several behaviors already built into the page allocator so that it can just
      set GFP flags unconditionally.
      
      v2: Renamed functions to dev_alloc_page(s) instead of netdev_alloc_page(s)
          Removed __GFP_COLD flag from usb code as it was redundant
      v3: Update patch descriptions and subjects to match changes in v2
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ee47ad42
    • Alexander Duyck's avatar
      net: Remove __skb_alloc_page and __skb_alloc_pages · 160d2aba
      Alexander Duyck authored
      Remove the two functions which are now dead code.
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      160d2aba
    • Alexander Duyck's avatar
      fm10k/igb/ixgbe: Replace __skb_alloc_page with dev_alloc_page · 42b17f09
      Alexander Duyck authored
      The Intel drivers were pretty much just using the plain vanilla GFP flags
      in their calls to __skb_alloc_page so this change makes it so that they use
      dev_alloc_page which just uses GFP_ATOMIC for the gfp_flags value.
      
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: Matthew Vick <matthew.vick@intel.com>
      Cc: Don Skidmore <donald.c.skidmore@intel.com>
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
      Acked-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      42b17f09
    • Alexander Duyck's avatar
      phonet: Replace calls to __skb_alloc_page with __dev_alloc_page · 5693d284
      Alexander Duyck authored
      Replace the calls to __skb_alloc_page that are passed NULL with calls to
      __dev_alloc_page.
      
      In addition remove __GFP_COLD flag from allocations as we only want it for
      the Rx buffer which is taken care of by __dev_alloc_skb, not for any
      secondary allocations such as the queue element transmit descriptors.
      
      Cc: Oliver Neukum <oliver@neukum.org>
      Cc: Felipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5693d284
    • Alexander Duyck's avatar
      cxgb4/cxgb4vf: Replace __skb_alloc_page with __dev_alloc_page · aa9cd31c
      Alexander Duyck authored
      Drop the bloated use of __skb_alloc_page and replace it with
      __dev_alloc_page.  In addition update the one other spot that is
      allocating a page so that it allocates with the correct flags.
      
      Cc: Hariprasad S <hariprasad@chelsio.com>
      Cc: Casey Leedom <leedom@chelsio.com>
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa9cd31c
    • Alexander Duyck's avatar
      net: Add device Rx page allocation function · 71dfda58
      Alexander Duyck authored
      This patch implements __dev_alloc_pages and __dev_alloc_page.  These are
      meant to replace the __skb_alloc_pages and __skb_alloc_page functions.  The
      reason for doing this is that it occurred to me that __skb_alloc_page is
      supposed to be passed an sk_buff pointer, but it is NULL in all cases where
      it is used.  Worse is that in the case of ixgbe it is passed NULL via the
      sk_buff pointer in the rx_buffer info structure which means the compiler is
      not correctly stripping it out.
      
      The naming for these functions is based on dev_alloc_skb and __dev_alloc_skb.
      There was originally a netdev_alloc_page, however that was passed a
      net_device pointer and this function is not so I thought it best to follow
      that naming scheme since that is the same difference between dev_alloc_skb
      and netdev_alloc_skb.
      
      In the case of anything greater than order 0 it is assumed that we want a
      compound page so __GFP_COMP is set for all allocations as we expect a
      compound page when assigning a page frag.
      
      The other change in this patch is to exploit the behaviors of the page
      allocator in how it handles flags.  So for example we can always set
      __GFP_COMP and __GFP_MEMALLOC since they are ignored if they are not
      applicable or are overridden by another flag.
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      71dfda58
  2. 11 Nov, 2014 32 commits
  3. 10 Nov, 2014 2 commits