Lines Matching refs:rx_queue

471 ef4_farch_build_rx_desc(struct ef4_rx_queue *rx_queue, unsigned index)
476 rxd = ef4_rx_desc(rx_queue, index);
477 rx_buf = ef4_rx_buffer(rx_queue, index);
481 rx_queue->efx->type->rx_buffer_padding,
489 void ef4_farch_rx_write(struct ef4_rx_queue *rx_queue)
491 struct ef4_nic *efx = rx_queue->efx;
495 while (rx_queue->notified_count != rx_queue->added_count) {
497 rx_queue,
498 rx_queue->notified_count & rx_queue->ptr_mask);
499 ++rx_queue->notified_count;
503 write_ptr = rx_queue->added_count & rx_queue->ptr_mask;
506 ef4_rx_queue_index(rx_queue));
509 int ef4_farch_rx_probe(struct ef4_rx_queue *rx_queue)
511 struct ef4_nic *efx = rx_queue->efx;
514 entries = rx_queue->ptr_mask + 1;
515 return ef4_alloc_special_buffer(efx, &rx_queue->rxd,
519 void ef4_farch_rx_init(struct ef4_rx_queue *rx_queue)
522 struct ef4_nic *efx = rx_queue->efx;
536 ef4_rx_queue_index(rx_queue), rx_queue->rxd.index,
537 rx_queue->rxd.index + rx_queue->rxd.entries - 1);
539 rx_queue->scatter_n = 0;
542 ef4_init_special_buffer(efx, &rx_queue->rxd);
548 FRF_AZ_RX_DESCQ_BUF_BASE_ID, rx_queue->rxd.index,
550 ef4_rx_queue_channel(rx_queue)->channel,
553 ef4_rx_queue_index(rx_queue),
555 __ffs(rx_queue->rxd.entries),
560 ef4_rx_queue_index(rx_queue));
563 static void ef4_farch_flush_rx_queue(struct ef4_rx_queue *rx_queue)
565 struct ef4_nic *efx = rx_queue->efx;
571 ef4_rx_queue_index(rx_queue));
575 void ef4_farch_rx_fini(struct ef4_rx_queue *rx_queue)
578 struct ef4_nic *efx = rx_queue->efx;
583 ef4_rx_queue_index(rx_queue));
586 ef4_fini_special_buffer(efx, &rx_queue->rxd);
590 void ef4_farch_rx_remove(struct ef4_rx_queue *rx_queue)
592 ef4_free_special_buffer(rx_queue->efx, &rx_queue->rxd);
662 struct ef4_rx_queue *rx_queue;
670 ef4_for_each_channel_rx_queue(rx_queue, channel) {
671 rx_queue->flush_pending = true;
682 ef4_for_each_channel_rx_queue(rx_queue, channel) {
687 if (rx_queue->flush_pending) {
688 rx_queue->flush_pending = false;
691 ef4_farch_flush_rx_queue(rx_queue);
721 struct ef4_rx_queue *rx_queue;
734 ef4_for_each_channel_rx_queue(rx_queue, channel)
735 ef4_farch_rx_fini(rx_queue);
868 static u16 ef4_farch_handle_rx_not_ok(struct ef4_rx_queue *rx_queue,
871 struct ef4_channel *channel = ef4_rx_queue_channel(rx_queue);
872 struct ef4_nic *efx = rx_queue->efx;
921 ef4_rx_queue_index(rx_queue), EF4_QWORD_VAL(*event),
947 ef4_farch_handle_rx_bad_index(struct ef4_rx_queue *rx_queue, unsigned index)
949 struct ef4_channel *channel = ef4_rx_queue_channel(rx_queue);
950 struct ef4_nic *efx = rx_queue->efx;
953 if (rx_queue->scatter_n &&
954 index == ((rx_queue->removed_count + rx_queue->scatter_n - 1) &
955 rx_queue->ptr_mask)) {
960 expected = rx_queue->removed_count & rx_queue->ptr_mask;
961 dropped = (index - expected) & rx_queue->ptr_mask;
986 struct ef4_rx_queue *rx_queue;
997 rx_queue = ef4_channel_get_rx_queue(channel);
1000 expected_ptr = ((rx_queue->removed_count + rx_queue->scatter_n) &
1001 rx_queue->ptr_mask);
1005 unlikely(rx_ev_sop != (rx_queue->scatter_n == 0))) {
1007 !ef4_farch_handle_rx_bad_index(rx_queue, rx_ev_desc_ptr))
1011 if (rx_queue->scatter_n) {
1013 rx_queue,
1014 rx_queue->removed_count & rx_queue->ptr_mask,
1015 rx_queue->scatter_n, 0, EF4_RX_PKT_DISCARD);
1016 rx_queue->removed_count += rx_queue->scatter_n;
1017 rx_queue->scatter_n = 0;
1027 rx_queue,
1028 rx_queue->removed_count & rx_queue->ptr_mask,
1030 ++rx_queue->removed_count;
1035 ++rx_queue->scatter_n;
1060 flags = ef4_farch_handle_rx_not_ok(rx_queue, event);
1078 ef4_rx_packet(rx_queue,
1079 rx_queue->removed_count & rx_queue->ptr_mask,
1080 rx_queue->scatter_n, rx_ev_byte_cnt, flags);
1081 rx_queue->removed_count += rx_queue->scatter_n;
1082 rx_queue->scatter_n = 0;
1114 struct ef4_rx_queue *rx_queue;
1125 rx_queue = ef4_channel_get_rx_queue(channel);
1130 rx_queue->flush_pending = true;
1133 ef4_farch_magic_event(ef4_rx_queue_channel(rx_queue),
1134 EF4_CHANNEL_MAGIC_RX_DRAIN(rx_queue));
1156 struct ef4_rx_queue *rx_queue =
1166 } else if (rx_queue && magic == EF4_CHANNEL_MAGIC_FILL(rx_queue)) {
1170 ef4_fast_push_rx_descriptors(rx_queue, true);
1171 } else if (rx_queue && magic == EF4_CHANNEL_MAGIC_RX_DRAIN(rx_queue)) {
1390 void ef4_farch_rx_defer_refill(struct ef4_rx_queue *rx_queue)
1392 ef4_farch_magic_event(ef4_rx_queue_channel(rx_queue),
1393 EF4_CHANNEL_MAGIC_FILL(rx_queue));