diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2015-03-31 03:45:01 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2015-04-03 06:54:29 -0400 |
commit | 8b6ed9c202c0c7c179ab7a6cf8010ff0b63d2d4f (patch) | |
tree | 7fdccc680c9de6f6d1f68112e56702f6d1644840 | |
parent | 1a2f62489b5dc15bd2aadb1de2e38f732e2c4553 (diff) |
i40e/i40evf: fix bug when skb allocation fails
If the skb allocation fails we should not continue using the skb
pointer. Breaking out at the point of failure means that at the next
RX interrupt the driver will try the allocation again.
Change-ID: Iefaad69856ced7418bfd92afe55322676341f82e
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index 9b11f2e7e361..5a1a67733b88 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
@@ -1565,8 +1565,11 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, int budget) | |||
1565 | if (likely(!skb)) { | 1565 | if (likely(!skb)) { |
1566 | skb = netdev_alloc_skb_ip_align(rx_ring->netdev, | 1566 | skb = netdev_alloc_skb_ip_align(rx_ring->netdev, |
1567 | rx_ring->rx_hdr_len); | 1567 | rx_ring->rx_hdr_len); |
1568 | if (!skb) | 1568 | if (!skb) { |
1569 | rx_ring->rx_stats.alloc_buff_failed++; | 1569 | rx_ring->rx_stats.alloc_buff_failed++; |
1570 | break; | ||
1571 | } | ||
1572 | |||
1570 | /* initialize queue mapping */ | 1573 | /* initialize queue mapping */ |
1571 | skb_record_rx_queue(skb, rx_ring->queue_index); | 1574 | skb_record_rx_queue(skb, rx_ring->queue_index); |
1572 | /* we are reusing so sync this buffer for CPU use */ | 1575 | /* we are reusing so sync this buffer for CPU use */ |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c index 1b5ee4655b25..2be50a8d3671 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c | |||
@@ -1040,8 +1040,11 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, int budget) | |||
1040 | if (likely(!skb)) { | 1040 | if (likely(!skb)) { |
1041 | skb = netdev_alloc_skb_ip_align(rx_ring->netdev, | 1041 | skb = netdev_alloc_skb_ip_align(rx_ring->netdev, |
1042 | rx_ring->rx_hdr_len); | 1042 | rx_ring->rx_hdr_len); |
1043 | if (!skb) | 1043 | if (!skb) { |
1044 | rx_ring->rx_stats.alloc_buff_failed++; | 1044 | rx_ring->rx_stats.alloc_buff_failed++; |
1045 | break; | ||
1046 | } | ||
1047 | |||
1045 | /* initialize queue mapping */ | 1048 | /* initialize queue mapping */ |
1046 | skb_record_rx_queue(skb, rx_ring->queue_index); | 1049 | skb_record_rx_queue(skb, rx_ring->queue_index); |
1047 | /* we are reusing so sync this buffer for CPU use */ | 1050 | /* we are reusing so sync this buffer for CPU use */ |