aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@redhat.com>2014-12-09 22:40:56 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-10 13:31:57 -0500
commit67fd893ee07db94bcef6c7537f8569b49ff124d4 (patch)
tree4d0972f930eac9c337238b2cf1d875d911730917
parentfd11a83dd3630ec6a60f8a702446532c5c7e1991 (diff)
ethernet/intel: Use napi_alloc_skb
This change replaces calls to netdev_alloc_skb_ip_align with napi_alloc_skb. The advantage of napi_alloc_skb is currently the fact that the page allocation doesn't make use of any irq disable calls. There are few spots where I couldn't replace the calls as the buffer allocation routine is called as a part of init which is outside of the softirq context. Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/intel/e1000/e1000_main.c2
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c2
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k_main.c4
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c3
-rw-r--r--drivers/net/ethernet/intel/ixgb/ixgb_main.c6
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c4
6 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 862d1989ae1c..83140cbb5f01 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -4100,7 +4100,7 @@ static bool e1000_tbi_should_accept(struct e1000_adapter *adapter,
4100static struct sk_buff *e1000_alloc_rx_skb(struct e1000_adapter *adapter, 4100static struct sk_buff *e1000_alloc_rx_skb(struct e1000_adapter *adapter,
4101 unsigned int bufsz) 4101 unsigned int bufsz)
4102{ 4102{
4103 struct sk_buff *skb = netdev_alloc_skb_ip_align(adapter->netdev, bufsz); 4103 struct sk_buff *skb = napi_alloc_skb(&adapter->napi, bufsz);
4104 4104
4105 if (unlikely(!skb)) 4105 if (unlikely(!skb))
4106 adapter->alloc_rx_buff_failed++; 4106 adapter->alloc_rx_buff_failed++;
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 88936aa0029d..5c82c8065501 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -1016,7 +1016,7 @@ static bool e1000_clean_rx_irq(struct e1000_ring *rx_ring, int *work_done,
1016 */ 1016 */
1017 if (length < copybreak) { 1017 if (length < copybreak) {
1018 struct sk_buff *new_skb = 1018 struct sk_buff *new_skb =
1019 netdev_alloc_skb_ip_align(netdev, length); 1019 napi_alloc_skb(&adapter->napi, length);
1020 if (new_skb) { 1020 if (new_skb) {
1021 skb_copy_to_linear_data_offset(new_skb, 1021 skb_copy_to_linear_data_offset(new_skb,
1022 -NET_IP_ALIGN, 1022 -NET_IP_ALIGN,
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index 91516aed373e..ee1ecb146df7 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -308,8 +308,8 @@ static struct sk_buff *fm10k_fetch_rx_buffer(struct fm10k_ring *rx_ring,
308#endif 308#endif
309 309
310 /* allocate a skb to store the frags */ 310 /* allocate a skb to store the frags */
311 skb = netdev_alloc_skb_ip_align(rx_ring->netdev, 311 skb = napi_alloc_skb(&rx_ring->q_vector->napi,
312 FM10K_RX_HDR_LEN); 312 FM10K_RX_HDR_LEN);
313 if (unlikely(!skb)) { 313 if (unlikely(!skb)) {
314 rx_ring->rx_stats.alloc_failed++; 314 rx_ring->rx_stats.alloc_failed++;
315 return NULL; 315 return NULL;
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index f04ad13f7159..485d2c609d5d 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -6644,8 +6644,7 @@ static struct sk_buff *igb_fetch_rx_buffer(struct igb_ring *rx_ring,
6644#endif 6644#endif
6645 6645
6646 /* allocate a skb to store the frags */ 6646 /* allocate a skb to store the frags */
6647 skb = netdev_alloc_skb_ip_align(rx_ring->netdev, 6647 skb = napi_alloc_skb(&rx_ring->q_vector->napi, IGB_RX_HDR_LEN);
6648 IGB_RX_HDR_LEN);
6649 if (unlikely(!skb)) { 6648 if (unlikely(!skb)) {
6650 rx_ring->rx_stats.alloc_failed++; 6649 rx_ring->rx_stats.alloc_failed++;
6651 return NULL; 6650 return NULL;
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index 055961b0f24b..aa87605b144a 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -1963,7 +1963,7 @@ ixgb_rx_checksum(struct ixgb_adapter *adapter,
1963 * this should improve performance for small packets with large amounts 1963 * this should improve performance for small packets with large amounts
1964 * of reassembly being done in the stack 1964 * of reassembly being done in the stack
1965 */ 1965 */
1966static void ixgb_check_copybreak(struct net_device *netdev, 1966static void ixgb_check_copybreak(struct napi_struct *napi,
1967 struct ixgb_buffer *buffer_info, 1967 struct ixgb_buffer *buffer_info,
1968 u32 length, struct sk_buff **skb) 1968 u32 length, struct sk_buff **skb)
1969{ 1969{
@@ -1972,7 +1972,7 @@ static void ixgb_check_copybreak(struct net_device *netdev,
1972 if (length > copybreak) 1972 if (length > copybreak)
1973 return; 1973 return;
1974 1974
1975 new_skb = netdev_alloc_skb_ip_align(netdev, length); 1975 new_skb = napi_alloc_skb(napi, length);
1976 if (!new_skb) 1976 if (!new_skb)
1977 return; 1977 return;
1978 1978
@@ -2064,7 +2064,7 @@ ixgb_clean_rx_irq(struct ixgb_adapter *adapter, int *work_done, int work_to_do)
2064 goto rxdesc_done; 2064 goto rxdesc_done;
2065 } 2065 }
2066 2066
2067 ixgb_check_copybreak(netdev, buffer_info, length, &skb); 2067 ixgb_check_copybreak(&adapter->napi, buffer_info, length, &skb);
2068 2068
2069 /* Good Receive */ 2069 /* Good Receive */
2070 skb_put(skb, length); 2070 skb_put(skb, length);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index fbd52924ee34..798b05556e1b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1913,8 +1913,8 @@ static struct sk_buff *ixgbe_fetch_rx_buffer(struct ixgbe_ring *rx_ring,
1913#endif 1913#endif
1914 1914
1915 /* allocate a skb to store the frags */ 1915 /* allocate a skb to store the frags */
1916 skb = netdev_alloc_skb_ip_align(rx_ring->netdev, 1916 skb = napi_alloc_skb(&rx_ring->q_vector->napi,
1917 IXGBE_RX_HDR_SIZE); 1917 IXGBE_RX_HDR_SIZE);
1918 if (unlikely(!skb)) { 1918 if (unlikely(!skb)) {
1919 rx_ring->rx_stats.alloc_rx_buff_failed++; 1919 rx_ring->rx_stats.alloc_rx_buff_failed++;
1920 return NULL; 1920 return NULL;