diff options
-rw-r--r-- | drivers/net/ethernet/sfc/ef10.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/efx.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/efx.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/farch.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/rx.c | 9 |
5 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index 2f77359607d2..e9c546bdbdfe 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c | |||
@@ -1907,7 +1907,7 @@ static void efx_ef10_handle_driver_generated_event(struct efx_channel *channel, | |||
1907 | * events, so efx_process_channel() won't refill the | 1907 | * events, so efx_process_channel() won't refill the |
1908 | * queue. Refill it here | 1908 | * queue. Refill it here |
1909 | */ | 1909 | */ |
1910 | efx_fast_push_rx_descriptors(&channel->rx_queue); | 1910 | efx_fast_push_rx_descriptors(&channel->rx_queue, true); |
1911 | break; | 1911 | break; |
1912 | default: | 1912 | default: |
1913 | netif_err(efx, hw, efx->net_dev, | 1913 | netif_err(efx, hw, efx->net_dev, |
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 869418164364..5e2454d07137 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c | |||
@@ -253,7 +253,7 @@ static int efx_process_channel(struct efx_channel *channel, int budget) | |||
253 | efx_channel_get_rx_queue(channel); | 253 | efx_channel_get_rx_queue(channel); |
254 | 254 | ||
255 | efx_rx_flush_packet(channel); | 255 | efx_rx_flush_packet(channel); |
256 | efx_fast_push_rx_descriptors(rx_queue); | 256 | efx_fast_push_rx_descriptors(rx_queue, true); |
257 | } | 257 | } |
258 | 258 | ||
259 | return spent; | 259 | return spent; |
@@ -646,7 +646,9 @@ static void efx_start_datapath(struct efx_nic *efx) | |||
646 | efx_for_each_channel_rx_queue(rx_queue, channel) { | 646 | efx_for_each_channel_rx_queue(rx_queue, channel) { |
647 | efx_init_rx_queue(rx_queue); | 647 | efx_init_rx_queue(rx_queue); |
648 | atomic_inc(&efx->active_queues); | 648 | atomic_inc(&efx->active_queues); |
649 | efx_nic_generate_fill_event(rx_queue); | 649 | efx_stop_eventq(channel); |
650 | efx_fast_push_rx_descriptors(rx_queue, false); | ||
651 | efx_start_eventq(channel); | ||
650 | } | 652 | } |
651 | 653 | ||
652 | WARN_ON(channel->rx_pkt_n_frags); | 654 | WARN_ON(channel->rx_pkt_n_frags); |
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h index b8235ee5d7d7..a653786fbbe7 100644 --- a/drivers/net/ethernet/sfc/efx.h +++ b/drivers/net/ethernet/sfc/efx.h | |||
@@ -37,7 +37,7 @@ int efx_probe_rx_queue(struct efx_rx_queue *rx_queue); | |||
37 | void efx_remove_rx_queue(struct efx_rx_queue *rx_queue); | 37 | void efx_remove_rx_queue(struct efx_rx_queue *rx_queue); |
38 | void efx_init_rx_queue(struct efx_rx_queue *rx_queue); | 38 | void efx_init_rx_queue(struct efx_rx_queue *rx_queue); |
39 | void efx_fini_rx_queue(struct efx_rx_queue *rx_queue); | 39 | void efx_fini_rx_queue(struct efx_rx_queue *rx_queue); |
40 | void efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue); | 40 | void efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue, bool atomic); |
41 | void efx_rx_slow_fill(unsigned long context); | 41 | void efx_rx_slow_fill(unsigned long context); |
42 | void __efx_rx_packet(struct efx_channel *channel); | 42 | void __efx_rx_packet(struct efx_channel *channel); |
43 | void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index, | 43 | void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index, |
diff --git a/drivers/net/ethernet/sfc/farch.c b/drivers/net/ethernet/sfc/farch.c index c0907d884d75..984e85ee76f6 100644 --- a/drivers/net/ethernet/sfc/farch.c +++ b/drivers/net/ethernet/sfc/farch.c | |||
@@ -1147,7 +1147,7 @@ static void efx_farch_handle_generated_event(struct efx_channel *channel, | |||
1147 | /* The queue must be empty, so we won't receive any rx | 1147 | /* The queue must be empty, so we won't receive any rx |
1148 | * events, so efx_process_channel() won't refill the | 1148 | * events, so efx_process_channel() won't refill the |
1149 | * queue. Refill it here */ | 1149 | * queue. Refill it here */ |
1150 | efx_fast_push_rx_descriptors(rx_queue); | 1150 | efx_fast_push_rx_descriptors(rx_queue, true); |
1151 | } else if (rx_queue && magic == EFX_CHANNEL_MAGIC_RX_DRAIN(rx_queue)) { | 1151 | } else if (rx_queue && magic == EFX_CHANNEL_MAGIC_RX_DRAIN(rx_queue)) { |
1152 | efx_farch_handle_drain_event(channel); | 1152 | efx_farch_handle_drain_event(channel); |
1153 | } else if (code == _EFX_CHANNEL_MAGIC_TX_DRAIN) { | 1153 | } else if (code == _EFX_CHANNEL_MAGIC_TX_DRAIN) { |
diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index 42488df1f4ec..8671bc199a9d 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c | |||
@@ -149,7 +149,7 @@ static struct page *efx_reuse_page(struct efx_rx_queue *rx_queue) | |||
149 | * 0 on success. If a single page can be used for multiple buffers, | 149 | * 0 on success. If a single page can be used for multiple buffers, |
150 | * then the page will either be inserted fully, or not at all. | 150 | * then the page will either be inserted fully, or not at all. |
151 | */ | 151 | */ |
152 | static int efx_init_rx_buffers(struct efx_rx_queue *rx_queue) | 152 | static int efx_init_rx_buffers(struct efx_rx_queue *rx_queue, bool atomic) |
153 | { | 153 | { |
154 | struct efx_nic *efx = rx_queue->efx; | 154 | struct efx_nic *efx = rx_queue->efx; |
155 | struct efx_rx_buffer *rx_buf; | 155 | struct efx_rx_buffer *rx_buf; |
@@ -163,7 +163,8 @@ static int efx_init_rx_buffers(struct efx_rx_queue *rx_queue) | |||
163 | do { | 163 | do { |
164 | page = efx_reuse_page(rx_queue); | 164 | page = efx_reuse_page(rx_queue); |
165 | if (page == NULL) { | 165 | if (page == NULL) { |
166 | page = alloc_pages(__GFP_COLD | __GFP_COMP | GFP_ATOMIC, | 166 | page = alloc_pages(__GFP_COLD | __GFP_COMP | |
167 | (atomic ? GFP_ATOMIC : GFP_KERNEL), | ||
167 | efx->rx_buffer_order); | 168 | efx->rx_buffer_order); |
168 | if (unlikely(page == NULL)) | 169 | if (unlikely(page == NULL)) |
169 | return -ENOMEM; | 170 | return -ENOMEM; |
@@ -321,7 +322,7 @@ static void efx_discard_rx_packet(struct efx_channel *channel, | |||
321 | * this means this function must run from the NAPI handler, or be called | 322 | * this means this function must run from the NAPI handler, or be called |
322 | * when NAPI is disabled. | 323 | * when NAPI is disabled. |
323 | */ | 324 | */ |
324 | void efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue) | 325 | void efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue, bool atomic) |
325 | { | 326 | { |
326 | struct efx_nic *efx = rx_queue->efx; | 327 | struct efx_nic *efx = rx_queue->efx; |
327 | unsigned int fill_level, batch_size; | 328 | unsigned int fill_level, batch_size; |
@@ -354,7 +355,7 @@ void efx_fast_push_rx_descriptors(struct efx_rx_queue *rx_queue) | |||
354 | 355 | ||
355 | 356 | ||
356 | do { | 357 | do { |
357 | rc = efx_init_rx_buffers(rx_queue); | 358 | rc = efx_init_rx_buffers(rx_queue, atomic); |
358 | if (unlikely(rc)) { | 359 | if (unlikely(rc)) { |
359 | /* Ensure that we don't leave the rx queue empty */ | 360 | /* Ensure that we don't leave the rx queue empty */ |
360 | if (rx_queue->added_count == rx_queue->removed_count) | 361 | if (rx_queue->added_count == rx_queue->removed_count) |