Lines Matching full:queue
59 /* The time that packets can stay on the guest Rx internal queue
107 static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx,
110 static void make_tx_response(struct xenvif_queue *queue,
115 static void xenvif_idx_unmap(struct xenvif_queue *queue, u16 pending_idx);
117 static inline int tx_work_todo(struct xenvif_queue *queue);
119 static inline unsigned long idx_to_pfn(struct xenvif_queue *queue, in idx_to_pfn() argument
122 return page_to_pfn(queue->mmap_pages[idx]); in idx_to_pfn()
125 static inline unsigned long idx_to_kaddr(struct xenvif_queue *queue, in idx_to_kaddr() argument
128 return (unsigned long)pfn_to_kaddr(idx_to_pfn(queue, idx)); in idx_to_kaddr()
161 void xenvif_kick_thread(struct xenvif_queue *queue) in xenvif_kick_thread() argument
163 wake_up(&queue->wq); in xenvif_kick_thread()
166 void xenvif_napi_schedule_or_enable_events(struct xenvif_queue *queue) in xenvif_napi_schedule_or_enable_events() argument
170 RING_FINAL_CHECK_FOR_REQUESTS(&queue->tx, more_to_do); in xenvif_napi_schedule_or_enable_events()
173 napi_schedule(&queue->napi); in xenvif_napi_schedule_or_enable_events()
175 &queue->eoi_pending) & in xenvif_napi_schedule_or_enable_events()
177 xen_irq_lateeoi(queue->tx_irq, 0); in xenvif_napi_schedule_or_enable_events()
180 static void tx_add_credit(struct xenvif_queue *queue) in tx_add_credit() argument
188 max_burst = max(131072UL, queue->credit_bytes); in tx_add_credit()
191 max_credit = queue->remaining_credit + queue->credit_bytes; in tx_add_credit()
192 if (max_credit < queue->remaining_credit) in tx_add_credit()
195 queue->remaining_credit = min(max_credit, max_burst); in tx_add_credit()
196 queue->rate_limited = false; in tx_add_credit()
201 struct xenvif_queue *queue = from_timer(queue, t, credit_timeout); in xenvif_tx_credit_callback() local
202 tx_add_credit(queue); in xenvif_tx_credit_callback()
203 xenvif_napi_schedule_or_enable_events(queue); in xenvif_tx_credit_callback()
206 static void xenvif_tx_err(struct xenvif_queue *queue, in xenvif_tx_err() argument
210 RING_IDX cons = queue->tx.req_cons; in xenvif_tx_err()
213 make_tx_response(queue, txp, extra_count, XEN_NETIF_RSP_ERROR); in xenvif_tx_err()
216 RING_COPY_REQUEST(&queue->tx, cons++, txp); in xenvif_tx_err()
219 queue->tx.req_cons = cons; in xenvif_tx_err()
226 /* Disable the vif from queue 0's kthread */ in xenvif_fatal_tx_err()
231 static int xenvif_count_requests(struct xenvif_queue *queue, in xenvif_count_requests() argument
237 RING_IDX cons = queue->tx.req_cons; in xenvif_count_requests()
249 netdev_err(queue->vif->dev, in xenvif_count_requests()
252 xenvif_fatal_tx_err(queue->vif); in xenvif_count_requests()
260 netdev_err(queue->vif->dev, in xenvif_count_requests()
263 xenvif_fatal_tx_err(queue->vif); in xenvif_count_requests()
276 netdev_dbg(queue->vif->dev, in xenvif_count_requests()
285 RING_COPY_REQUEST(&queue->tx, cons + slots, txp); in xenvif_count_requests()
298 netdev_dbg(queue->vif->dev, in xenvif_count_requests()
308 netdev_err(queue->vif->dev, "Cross page boundary, txp->offset: %u, size: %u\n", in xenvif_count_requests()
310 xenvif_fatal_tx_err(queue->vif); in xenvif_count_requests()
322 xenvif_tx_err(queue, first, extra_count, cons + slots); in xenvif_count_requests()
340 static inline void xenvif_tx_create_map_op(struct xenvif_queue *queue, in xenvif_tx_create_map_op() argument
346 queue->pages_to_map[mop-queue->tx_map_ops] = queue->mmap_pages[pending_idx]; in xenvif_tx_create_map_op()
347 gnttab_set_map_op(mop, idx_to_kaddr(queue, pending_idx), in xenvif_tx_create_map_op()
349 txp->gref, queue->vif->domid); in xenvif_tx_create_map_op()
351 memcpy(&queue->pending_tx_info[pending_idx].req, txp, in xenvif_tx_create_map_op()
353 queue->pending_tx_info[pending_idx].extra_count = extra_count; in xenvif_tx_create_map_op()
375 static void xenvif_get_requests(struct xenvif_queue *queue, in xenvif_get_requests() argument
391 struct gnttab_copy *cop = queue->tx_copy_ops + *copy_ops; in xenvif_get_requests()
392 struct gnttab_map_grant_ref *gop = queue->tx_map_ops + *map_ops; in xenvif_get_requests()
407 cop->source.domid = queue->vif->domid; in xenvif_get_requests()
427 index = pending_index(queue->pending_cons); in xenvif_get_requests()
428 pending_idx = queue->pending_ring[index]; in xenvif_get_requests()
429 callback_param(queue, pending_idx).ctx = NULL; in xenvif_get_requests()
440 memcpy(&queue->pending_tx_info[pending_idx].req, in xenvif_get_requests()
442 queue->pending_tx_info[pending_idx].extra_count = in xenvif_get_requests()
449 queue->pending_cons++; in xenvif_get_requests()
464 make_tx_response(queue, txp, 0, XEN_NETIF_RSP_OKAY); in xenvif_get_requests()
469 index = pending_index(queue->pending_cons++); in xenvif_get_requests()
470 pending_idx = queue->pending_ring[index]; in xenvif_get_requests()
471 xenvif_tx_create_map_op(queue, pending_idx, txp, in xenvif_get_requests()
490 make_tx_response(queue, txp, 0, in xenvif_get_requests()
495 index = pending_index(queue->pending_cons++); in xenvif_get_requests()
496 pending_idx = queue->pending_ring[index]; in xenvif_get_requests()
497 xenvif_tx_create_map_op(queue, pending_idx, txp, 0, in xenvif_get_requests()
519 (*copy_ops) = cop - queue->tx_copy_ops; in xenvif_get_requests()
520 (*map_ops) = gop - queue->tx_map_ops; in xenvif_get_requests()
523 static inline void xenvif_grant_handle_set(struct xenvif_queue *queue, in xenvif_grant_handle_set() argument
527 if (unlikely(queue->grant_tx_handle[pending_idx] != in xenvif_grant_handle_set()
529 netdev_err(queue->vif->dev, in xenvif_grant_handle_set()
534 queue->grant_tx_handle[pending_idx] = handle; in xenvif_grant_handle_set()
537 static inline void xenvif_grant_handle_reset(struct xenvif_queue *queue, in xenvif_grant_handle_reset() argument
540 if (unlikely(queue->grant_tx_handle[pending_idx] == in xenvif_grant_handle_reset()
542 netdev_err(queue->vif->dev, in xenvif_grant_handle_reset()
547 queue->grant_tx_handle[pending_idx] = NETBACK_INVALID_HANDLE; in xenvif_grant_handle_reset()
550 static int xenvif_tx_check_gop(struct xenvif_queue *queue, in xenvif_tx_check_gop() argument
588 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
593 netdev_dbg(queue->vif->dev, in xenvif_tx_check_gop()
600 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
616 xenvif_grant_handle_set(queue, in xenvif_tx_check_gop()
621 xenvif_idx_unmap(queue, pending_idx); in xenvif_tx_check_gop()
627 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
630 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
638 netdev_dbg(queue->vif->dev, in xenvif_tx_check_gop()
645 xenvif_idx_release(queue, pending_idx, XEN_NETIF_RSP_ERROR); in xenvif_tx_check_gop()
654 xenvif_idx_unmap(queue, pending_idx); in xenvif_tx_check_gop()
655 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
665 xenvif_idx_unmap(queue, pending_idx); in xenvif_tx_check_gop()
666 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
687 static void xenvif_fill_frags(struct xenvif_queue *queue, struct sk_buff *skb) in xenvif_fill_frags() argument
705 &callback_param(queue, pending_idx); in xenvif_fill_frags()
707 callback_param(queue, prev_pending_idx).ctx = in xenvif_fill_frags()
708 &callback_param(queue, pending_idx); in xenvif_fill_frags()
710 callback_param(queue, pending_idx).ctx = NULL; in xenvif_fill_frags()
713 txp = &queue->pending_tx_info[pending_idx].req; in xenvif_fill_frags()
714 page = virt_to_page((void *)idx_to_kaddr(queue, pending_idx)); in xenvif_fill_frags()
721 get_page(queue->mmap_pages[pending_idx]); in xenvif_fill_frags()
725 static int xenvif_get_extras(struct xenvif_queue *queue, in xenvif_get_extras() argument
731 RING_IDX cons = queue->tx.req_cons; in xenvif_get_extras()
735 netdev_err(queue->vif->dev, "Missing extra info\n"); in xenvif_get_extras()
736 xenvif_fatal_tx_err(queue->vif); in xenvif_get_extras()
740 RING_COPY_REQUEST(&queue->tx, cons, &extra); in xenvif_get_extras()
742 queue->tx.req_cons = ++cons; in xenvif_get_extras()
747 netdev_err(queue->vif->dev, in xenvif_get_extras()
749 xenvif_fatal_tx_err(queue->vif); in xenvif_get_extras()
788 static int checksum_setup(struct xenvif_queue *queue, struct sk_buff *skb) in checksum_setup() argument
798 queue->stats.rx_gso_checksum_fixup++; in checksum_setup()
810 static bool tx_credit_exceeded(struct xenvif_queue *queue, unsigned size) in tx_credit_exceeded() argument
813 u64 next_credit = queue->credit_window_start + in tx_credit_exceeded()
814 msecs_to_jiffies(queue->credit_usec / 1000); in tx_credit_exceeded()
817 if (timer_pending(&queue->credit_timeout)) { in tx_credit_exceeded()
818 queue->rate_limited = true; in tx_credit_exceeded()
824 queue->credit_window_start = now; in tx_credit_exceeded()
825 tx_add_credit(queue); in tx_credit_exceeded()
829 if (size > queue->remaining_credit) { in tx_credit_exceeded()
830 mod_timer(&queue->credit_timeout, in tx_credit_exceeded()
832 queue->credit_window_start = next_credit; in tx_credit_exceeded()
833 queue->rate_limited = true; in tx_credit_exceeded()
900 /* No need for locking or RCU here. NAPI poll and TX queue in xenvif_mcast_addr_list_free()
915 static void xenvif_tx_build_gops(struct xenvif_queue *queue, in xenvif_tx_build_gops() argument
924 while (skb_queue_len(&queue->tx_queue) < budget) { in xenvif_tx_build_gops()
933 if (queue->tx.sring->req_prod - queue->tx.req_cons > in xenvif_tx_build_gops()
935 netdev_err(queue->vif->dev, in xenvif_tx_build_gops()
938 queue->tx.sring->req_prod, queue->tx.req_cons, in xenvif_tx_build_gops()
940 xenvif_fatal_tx_err(queue->vif); in xenvif_tx_build_gops()
944 work_to_do = XEN_RING_NR_UNCONSUMED_REQUESTS(&queue->tx); in xenvif_tx_build_gops()
948 idx = queue->tx.req_cons; in xenvif_tx_build_gops()
950 RING_COPY_REQUEST(&queue->tx, idx, &txreq); in xenvif_tx_build_gops()
953 if (txreq.size > queue->remaining_credit && in xenvif_tx_build_gops()
954 tx_credit_exceeded(queue, txreq.size)) in xenvif_tx_build_gops()
957 queue->remaining_credit -= txreq.size; in xenvif_tx_build_gops()
960 queue->tx.req_cons = ++idx; in xenvif_tx_build_gops()
965 work_to_do = xenvif_get_extras(queue, extras, in xenvif_tx_build_gops()
968 idx = queue->tx.req_cons; in xenvif_tx_build_gops()
977 ret = xenvif_mcast_add(queue->vif, extra->u.mcast.addr); in xenvif_tx_build_gops()
979 make_tx_response(queue, &txreq, extra_count, in xenvif_tx_build_gops()
990 xenvif_mcast_del(queue->vif, extra->u.mcast.addr); in xenvif_tx_build_gops()
992 make_tx_response(queue, &txreq, extra_count, in xenvif_tx_build_gops()
1000 ret = xenvif_count_requests(queue, &txreq, extra_count, in xenvif_tx_build_gops()
1009 netdev_dbg(queue->vif->dev, in xenvif_tx_build_gops()
1011 xenvif_tx_err(queue, &txreq, extra_count, idx); in xenvif_tx_build_gops()
1017 netdev_err(queue->vif->dev, "Cross page boundary, txreq.offset: %u, size: %u\n", in xenvif_tx_build_gops()
1019 xenvif_fatal_tx_err(queue->vif); in xenvif_tx_build_gops()
1028 netdev_dbg(queue->vif->dev, in xenvif_tx_build_gops()
1030 xenvif_tx_err(queue, &txreq, extra_count, idx); in xenvif_tx_build_gops()
1048 xenvif_tx_err(queue, &txreq, extra_count, idx); in xenvif_tx_build_gops()
1050 netdev_err(queue->vif->dev, in xenvif_tx_build_gops()
1060 if (xenvif_set_skb_gso(queue->vif, skb, gso)) { in xenvif_tx_build_gops()
1096 xenvif_get_requests(queue, skb, &txreq, txfrags, copy_ops, in xenvif_tx_build_gops()
1100 __skb_queue_tail(&queue->tx_queue, skb); in xenvif_tx_build_gops()
1102 queue->tx.req_cons = idx; in xenvif_tx_build_gops()
1111 static int xenvif_handle_frag_list(struct xenvif_queue *queue, struct sk_buff *skb) in xenvif_handle_frag_list() argument
1119 queue->stats.tx_zerocopy_sent += 2; in xenvif_handle_frag_list()
1120 queue->stats.tx_frag_overflow++; in xenvif_handle_frag_list()
1122 xenvif_fill_frags(queue, nskb); in xenvif_handle_frag_list()
1159 atomic_inc(&queue->inflight_packets); in xenvif_handle_frag_list()
1171 static int xenvif_tx_submit(struct xenvif_queue *queue) in xenvif_tx_submit() argument
1173 struct gnttab_map_grant_ref *gop_map = queue->tx_map_ops; in xenvif_tx_submit()
1174 struct gnttab_copy *gop_copy = queue->tx_copy_ops; in xenvif_tx_submit()
1178 while ((skb = __skb_dequeue(&queue->tx_queue)) != NULL) { in xenvif_tx_submit()
1183 txp = &queue->pending_tx_info[pending_idx].req; in xenvif_tx_submit()
1186 if (unlikely(xenvif_tx_check_gop(queue, skb, &gop_map, &gop_copy))) { in xenvif_tx_submit()
1206 xenvif_fill_frags(queue, skb); in xenvif_tx_submit()
1210 xenvif_skb_zerocopy_prepare(queue, nskb); in xenvif_tx_submit()
1211 if (xenvif_handle_frag_list(queue, skb)) { in xenvif_tx_submit()
1213 netdev_err(queue->vif->dev, in xenvif_tx_submit()
1215 xenvif_skb_zerocopy_prepare(queue, skb); in xenvif_tx_submit()
1224 skb->dev = queue->vif->dev; in xenvif_tx_submit()
1228 if (checksum_setup(queue, skb)) { in xenvif_tx_submit()
1229 netdev_dbg(queue->vif->dev, in xenvif_tx_submit()
1233 xenvif_skb_zerocopy_prepare(queue, skb); in xenvif_tx_submit()
1261 queue->stats.rx_bytes += skb->len; in xenvif_tx_submit()
1262 queue->stats.rx_packets++; in xenvif_tx_submit()
1272 xenvif_skb_zerocopy_prepare(queue, skb); in xenvif_tx_submit()
1273 queue->stats.tx_zerocopy_sent++; in xenvif_tx_submit()
1289 struct xenvif_queue *queue = ubuf_to_queue(ubuf); in xenvif_zerocopy_callback() local
1294 spin_lock_irqsave(&queue->callback_lock, flags); in xenvif_zerocopy_callback()
1298 BUG_ON(queue->dealloc_prod - queue->dealloc_cons >= in xenvif_zerocopy_callback()
1300 index = pending_index(queue->dealloc_prod); in xenvif_zerocopy_callback()
1301 queue->dealloc_ring[index] = pending_idx; in xenvif_zerocopy_callback()
1306 queue->dealloc_prod++; in xenvif_zerocopy_callback()
1308 spin_unlock_irqrestore(&queue->callback_lock, flags); in xenvif_zerocopy_callback()
1311 queue->stats.tx_zerocopy_success++; in xenvif_zerocopy_callback()
1313 queue->stats.tx_zerocopy_fail++; in xenvif_zerocopy_callback()
1314 xenvif_skb_zerocopy_complete(queue); in xenvif_zerocopy_callback()
1321 static inline void xenvif_tx_dealloc_action(struct xenvif_queue *queue) in xenvif_tx_dealloc_action() argument
1328 dc = queue->dealloc_cons; in xenvif_tx_dealloc_action()
1329 gop = queue->tx_unmap_ops; in xenvif_tx_dealloc_action()
1333 dp = queue->dealloc_prod; in xenvif_tx_dealloc_action()
1341 BUG_ON(gop - queue->tx_unmap_ops >= MAX_PENDING_REQS); in xenvif_tx_dealloc_action()
1343 queue->dealloc_ring[pending_index(dc++)]; in xenvif_tx_dealloc_action()
1345 pending_idx_release[gop - queue->tx_unmap_ops] = in xenvif_tx_dealloc_action()
1347 queue->pages_to_unmap[gop - queue->tx_unmap_ops] = in xenvif_tx_dealloc_action()
1348 queue->mmap_pages[pending_idx]; in xenvif_tx_dealloc_action()
1350 idx_to_kaddr(queue, pending_idx), in xenvif_tx_dealloc_action()
1352 queue->grant_tx_handle[pending_idx]); in xenvif_tx_dealloc_action()
1353 xenvif_grant_handle_reset(queue, pending_idx); in xenvif_tx_dealloc_action()
1357 } while (dp != queue->dealloc_prod); in xenvif_tx_dealloc_action()
1359 queue->dealloc_cons = dc; in xenvif_tx_dealloc_action()
1361 if (gop - queue->tx_unmap_ops > 0) { in xenvif_tx_dealloc_action()
1363 ret = gnttab_unmap_refs(queue->tx_unmap_ops, in xenvif_tx_dealloc_action()
1365 queue->pages_to_unmap, in xenvif_tx_dealloc_action()
1366 gop - queue->tx_unmap_ops); in xenvif_tx_dealloc_action()
1368 netdev_err(queue->vif->dev, "Unmap fail: nr_ops %tu ret %d\n", in xenvif_tx_dealloc_action()
1369 gop - queue->tx_unmap_ops, ret); in xenvif_tx_dealloc_action()
1370 for (i = 0; i < gop - queue->tx_unmap_ops; ++i) { in xenvif_tx_dealloc_action()
1372 netdev_err(queue->vif->dev, in xenvif_tx_dealloc_action()
1382 for (i = 0; i < gop - queue->tx_unmap_ops; ++i) in xenvif_tx_dealloc_action()
1383 xenvif_idx_release(queue, pending_idx_release[i], in xenvif_tx_dealloc_action()
1389 int xenvif_tx_action(struct xenvif_queue *queue, int budget) in xenvif_tx_action() argument
1394 if (unlikely(!tx_work_todo(queue))) in xenvif_tx_action()
1397 xenvif_tx_build_gops(queue, budget, &nr_cops, &nr_mops); in xenvif_tx_action()
1402 gnttab_batch_copy(queue->tx_copy_ops, nr_cops); in xenvif_tx_action()
1404 ret = gnttab_map_refs(queue->tx_map_ops, in xenvif_tx_action()
1406 queue->pages_to_map, in xenvif_tx_action()
1411 netdev_err(queue->vif->dev, "Map fail: nr %u ret %d\n", in xenvif_tx_action()
1414 WARN_ON_ONCE(queue->tx_map_ops[i].status == in xenvif_tx_action()
1419 work_done = xenvif_tx_submit(queue); in xenvif_tx_action()
1424 static void _make_tx_response(struct xenvif_queue *queue, in _make_tx_response() argument
1429 RING_IDX i = queue->tx.rsp_prod_pvt; in _make_tx_response()
1432 resp = RING_GET_RESPONSE(&queue->tx, i); in _make_tx_response()
1437 RING_GET_RESPONSE(&queue->tx, ++i)->status = XEN_NETIF_RSP_NULL; in _make_tx_response()
1439 queue->tx.rsp_prod_pvt = ++i; in _make_tx_response()
1442 static void push_tx_responses(struct xenvif_queue *queue) in push_tx_responses() argument
1446 RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&queue->tx, notify); in push_tx_responses()
1448 notify_remote_via_irq(queue->tx_irq); in push_tx_responses()
1451 static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx, in xenvif_idx_release() argument
1458 pending_tx_info = &queue->pending_tx_info[pending_idx]; in xenvif_idx_release()
1460 spin_lock_irqsave(&queue->response_lock, flags); in xenvif_idx_release()
1462 _make_tx_response(queue, &pending_tx_info->req, in xenvif_idx_release()
1469 index = pending_index(queue->pending_prod++); in xenvif_idx_release()
1470 queue->pending_ring[index] = pending_idx; in xenvif_idx_release()
1472 push_tx_responses(queue); in xenvif_idx_release()
1474 spin_unlock_irqrestore(&queue->response_lock, flags); in xenvif_idx_release()
1477 static void make_tx_response(struct xenvif_queue *queue, in make_tx_response() argument
1484 spin_lock_irqsave(&queue->response_lock, flags); in make_tx_response()
1486 _make_tx_response(queue, txp, extra_count, status); in make_tx_response()
1487 push_tx_responses(queue); in make_tx_response()
1489 spin_unlock_irqrestore(&queue->response_lock, flags); in make_tx_response()
1492 static void xenvif_idx_unmap(struct xenvif_queue *queue, u16 pending_idx) in xenvif_idx_unmap() argument
1498 idx_to_kaddr(queue, pending_idx), in xenvif_idx_unmap()
1500 queue->grant_tx_handle[pending_idx]); in xenvif_idx_unmap()
1501 xenvif_grant_handle_reset(queue, pending_idx); in xenvif_idx_unmap()
1504 &queue->mmap_pages[pending_idx], 1); in xenvif_idx_unmap()
1506 netdev_err(queue->vif->dev, in xenvif_idx_unmap()
1517 static inline int tx_work_todo(struct xenvif_queue *queue) in tx_work_todo() argument
1519 if (likely(RING_HAS_UNCONSUMED_REQUESTS(&queue->tx))) in tx_work_todo()
1525 static inline bool tx_dealloc_work_todo(struct xenvif_queue *queue) in tx_dealloc_work_todo() argument
1527 return queue->dealloc_cons != queue->dealloc_prod; in tx_dealloc_work_todo()
1530 void xenvif_unmap_frontend_data_rings(struct xenvif_queue *queue) in xenvif_unmap_frontend_data_rings() argument
1532 if (queue->tx.sring) in xenvif_unmap_frontend_data_rings()
1533 xenbus_unmap_ring_vfree(xenvif_to_xenbus_device(queue->vif), in xenvif_unmap_frontend_data_rings()
1534 queue->tx.sring); in xenvif_unmap_frontend_data_rings()
1535 if (queue->rx.sring) in xenvif_unmap_frontend_data_rings()
1536 xenbus_unmap_ring_vfree(xenvif_to_xenbus_device(queue->vif), in xenvif_unmap_frontend_data_rings()
1537 queue->rx.sring); in xenvif_unmap_frontend_data_rings()
1540 int xenvif_map_frontend_data_rings(struct xenvif_queue *queue, in xenvif_map_frontend_data_rings() argument
1550 err = xenbus_map_ring_valloc(xenvif_to_xenbus_device(queue->vif), in xenvif_map_frontend_data_rings()
1559 BACK_RING_ATTACH(&queue->tx, txs, rsp_prod, XEN_PAGE_SIZE); in xenvif_map_frontend_data_rings()
1562 if (req_prod - rsp_prod > RING_SIZE(&queue->tx)) in xenvif_map_frontend_data_rings()
1565 err = xenbus_map_ring_valloc(xenvif_to_xenbus_device(queue->vif), in xenvif_map_frontend_data_rings()
1574 BACK_RING_ATTACH(&queue->rx, rxs, rsp_prod, XEN_PAGE_SIZE); in xenvif_map_frontend_data_rings()
1577 if (req_prod - rsp_prod > RING_SIZE(&queue->rx)) in xenvif_map_frontend_data_rings()
1583 xenvif_unmap_frontend_data_rings(queue); in xenvif_map_frontend_data_rings()
1587 static bool xenvif_dealloc_kthread_should_stop(struct xenvif_queue *queue) in xenvif_dealloc_kthread_should_stop() argument
1593 !atomic_read(&queue->inflight_packets); in xenvif_dealloc_kthread_should_stop()
1598 struct xenvif_queue *queue = data; in xenvif_dealloc_kthread() local
1601 wait_event_interruptible(queue->dealloc_wq, in xenvif_dealloc_kthread()
1602 tx_dealloc_work_todo(queue) || in xenvif_dealloc_kthread()
1603 xenvif_dealloc_kthread_should_stop(queue)); in xenvif_dealloc_kthread()
1604 if (xenvif_dealloc_kthread_should_stop(queue)) in xenvif_dealloc_kthread()
1607 xenvif_tx_dealloc_action(queue); in xenvif_dealloc_kthread()
1612 if (tx_dealloc_work_todo(queue)) in xenvif_dealloc_kthread()
1613 xenvif_tx_dealloc_action(queue); in xenvif_dealloc_kthread()