Lines Matching refs:queue
106 static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx,
109 static void make_tx_response(struct xenvif_queue *queue,
114 static void xenvif_idx_unmap(struct xenvif_queue *queue, u16 pending_idx);
116 static inline int tx_work_todo(struct xenvif_queue *queue);
118 static inline unsigned long idx_to_pfn(struct xenvif_queue *queue, in idx_to_pfn() argument
121 return page_to_pfn(queue->mmap_pages[idx]); in idx_to_pfn()
124 static inline unsigned long idx_to_kaddr(struct xenvif_queue *queue, in idx_to_kaddr() argument
127 return (unsigned long)pfn_to_kaddr(idx_to_pfn(queue, idx)); in idx_to_kaddr()
160 void xenvif_kick_thread(struct xenvif_queue *queue) in xenvif_kick_thread() argument
162 wake_up(&queue->wq); in xenvif_kick_thread()
165 void xenvif_napi_schedule_or_enable_events(struct xenvif_queue *queue) in xenvif_napi_schedule_or_enable_events() argument
169 RING_FINAL_CHECK_FOR_REQUESTS(&queue->tx, more_to_do); in xenvif_napi_schedule_or_enable_events()
172 napi_schedule(&queue->napi); in xenvif_napi_schedule_or_enable_events()
174 &queue->eoi_pending) & in xenvif_napi_schedule_or_enable_events()
176 xen_irq_lateeoi(queue->tx_irq, 0); in xenvif_napi_schedule_or_enable_events()
179 static void tx_add_credit(struct xenvif_queue *queue) in tx_add_credit() argument
187 max_burst = max(131072UL, queue->credit_bytes); in tx_add_credit()
190 max_credit = queue->remaining_credit + queue->credit_bytes; in tx_add_credit()
191 if (max_credit < queue->remaining_credit) in tx_add_credit()
194 queue->remaining_credit = min(max_credit, max_burst); in tx_add_credit()
195 queue->rate_limited = false; in tx_add_credit()
200 struct xenvif_queue *queue = from_timer(queue, t, credit_timeout); in xenvif_tx_credit_callback() local
201 tx_add_credit(queue); in xenvif_tx_credit_callback()
202 xenvif_napi_schedule_or_enable_events(queue); in xenvif_tx_credit_callback()
205 static void xenvif_tx_err(struct xenvif_queue *queue, in xenvif_tx_err() argument
209 RING_IDX cons = queue->tx.req_cons; in xenvif_tx_err()
212 make_tx_response(queue, txp, extra_count, XEN_NETIF_RSP_ERROR); in xenvif_tx_err()
215 RING_COPY_REQUEST(&queue->tx, cons++, txp); in xenvif_tx_err()
218 queue->tx.req_cons = cons; in xenvif_tx_err()
230 static int xenvif_count_requests(struct xenvif_queue *queue, in xenvif_count_requests() argument
236 RING_IDX cons = queue->tx.req_cons; in xenvif_count_requests()
248 netdev_err(queue->vif->dev, in xenvif_count_requests()
251 xenvif_fatal_tx_err(queue->vif); in xenvif_count_requests()
259 netdev_err(queue->vif->dev, in xenvif_count_requests()
262 xenvif_fatal_tx_err(queue->vif); in xenvif_count_requests()
275 netdev_dbg(queue->vif->dev, in xenvif_count_requests()
284 RING_COPY_REQUEST(&queue->tx, cons + slots, txp); in xenvif_count_requests()
297 netdev_dbg(queue->vif->dev, in xenvif_count_requests()
307 netdev_err(queue->vif->dev, "Cross page boundary, txp->offset: %u, size: %u\n", in xenvif_count_requests()
309 xenvif_fatal_tx_err(queue->vif); in xenvif_count_requests()
321 xenvif_tx_err(queue, first, extra_count, cons + slots); in xenvif_count_requests()
339 static inline void xenvif_tx_create_map_op(struct xenvif_queue *queue, in xenvif_tx_create_map_op() argument
345 queue->pages_to_map[mop-queue->tx_map_ops] = queue->mmap_pages[pending_idx]; in xenvif_tx_create_map_op()
346 gnttab_set_map_op(mop, idx_to_kaddr(queue, pending_idx), in xenvif_tx_create_map_op()
348 txp->gref, queue->vif->domid); in xenvif_tx_create_map_op()
350 memcpy(&queue->pending_tx_info[pending_idx].req, txp, in xenvif_tx_create_map_op()
352 queue->pending_tx_info[pending_idx].extra_count = extra_count; in xenvif_tx_create_map_op()
374 static void xenvif_get_requests(struct xenvif_queue *queue, in xenvif_get_requests() argument
390 struct gnttab_copy *cop = queue->tx_copy_ops + *copy_ops; in xenvif_get_requests()
391 struct gnttab_map_grant_ref *gop = queue->tx_map_ops + *map_ops; in xenvif_get_requests()
406 cop->source.domid = queue->vif->domid; in xenvif_get_requests()
426 index = pending_index(queue->pending_cons); in xenvif_get_requests()
427 pending_idx = queue->pending_ring[index]; in xenvif_get_requests()
428 callback_param(queue, pending_idx).ctx = NULL; in xenvif_get_requests()
439 memcpy(&queue->pending_tx_info[pending_idx].req, in xenvif_get_requests()
441 queue->pending_tx_info[pending_idx].extra_count = in xenvif_get_requests()
448 queue->pending_cons++; in xenvif_get_requests()
463 make_tx_response(queue, txp, 0, XEN_NETIF_RSP_OKAY); in xenvif_get_requests()
468 index = pending_index(queue->pending_cons++); in xenvif_get_requests()
469 pending_idx = queue->pending_ring[index]; in xenvif_get_requests()
470 xenvif_tx_create_map_op(queue, pending_idx, txp, in xenvif_get_requests()
489 make_tx_response(queue, txp, 0, in xenvif_get_requests()
494 index = pending_index(queue->pending_cons++); in xenvif_get_requests()
495 pending_idx = queue->pending_ring[index]; in xenvif_get_requests()
496 xenvif_tx_create_map_op(queue, pending_idx, txp, 0, in xenvif_get_requests()
518 (*copy_ops) = cop - queue->tx_copy_ops; in xenvif_get_requests()
519 (*map_ops) = gop - queue->tx_map_ops; in xenvif_get_requests()
522 static inline void xenvif_grant_handle_set(struct xenvif_queue *queue, in xenvif_grant_handle_set() argument
526 if (unlikely(queue->grant_tx_handle[pending_idx] != in xenvif_grant_handle_set()
528 netdev_err(queue->vif->dev, in xenvif_grant_handle_set()
533 queue->grant_tx_handle[pending_idx] = handle; in xenvif_grant_handle_set()
536 static inline void xenvif_grant_handle_reset(struct xenvif_queue *queue, in xenvif_grant_handle_reset() argument
539 if (unlikely(queue->grant_tx_handle[pending_idx] == in xenvif_grant_handle_reset()
541 netdev_err(queue->vif->dev, in xenvif_grant_handle_reset()
546 queue->grant_tx_handle[pending_idx] = NETBACK_INVALID_HANDLE; in xenvif_grant_handle_reset()
549 static int xenvif_tx_check_gop(struct xenvif_queue *queue, in xenvif_tx_check_gop() argument
587 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
592 netdev_dbg(queue->vif->dev, in xenvif_tx_check_gop()
599 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
615 xenvif_grant_handle_set(queue, in xenvif_tx_check_gop()
620 xenvif_idx_unmap(queue, pending_idx); in xenvif_tx_check_gop()
626 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
629 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
637 netdev_dbg(queue->vif->dev, in xenvif_tx_check_gop()
644 xenvif_idx_release(queue, pending_idx, XEN_NETIF_RSP_ERROR); in xenvif_tx_check_gop()
653 xenvif_idx_unmap(queue, pending_idx); in xenvif_tx_check_gop()
654 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
664 xenvif_idx_unmap(queue, pending_idx); in xenvif_tx_check_gop()
665 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
686 static void xenvif_fill_frags(struct xenvif_queue *queue, struct sk_buff *skb) in xenvif_fill_frags() argument
704 &callback_param(queue, pending_idx); in xenvif_fill_frags()
706 callback_param(queue, prev_pending_idx).ctx = in xenvif_fill_frags()
707 &callback_param(queue, pending_idx); in xenvif_fill_frags()
709 callback_param(queue, pending_idx).ctx = NULL; in xenvif_fill_frags()
712 txp = &queue->pending_tx_info[pending_idx].req; in xenvif_fill_frags()
713 page = virt_to_page((void *)idx_to_kaddr(queue, pending_idx)); in xenvif_fill_frags()
720 get_page(queue->mmap_pages[pending_idx]); in xenvif_fill_frags()
724 static int xenvif_get_extras(struct xenvif_queue *queue, in xenvif_get_extras() argument
730 RING_IDX cons = queue->tx.req_cons; in xenvif_get_extras()
734 netdev_err(queue->vif->dev, "Missing extra info\n"); in xenvif_get_extras()
735 xenvif_fatal_tx_err(queue->vif); in xenvif_get_extras()
739 RING_COPY_REQUEST(&queue->tx, cons, &extra); in xenvif_get_extras()
741 queue->tx.req_cons = ++cons; in xenvif_get_extras()
746 netdev_err(queue->vif->dev, in xenvif_get_extras()
748 xenvif_fatal_tx_err(queue->vif); in xenvif_get_extras()
787 static int checksum_setup(struct xenvif_queue *queue, struct sk_buff *skb) in checksum_setup() argument
797 queue->stats.rx_gso_checksum_fixup++; in checksum_setup()
809 static bool tx_credit_exceeded(struct xenvif_queue *queue, unsigned size) in tx_credit_exceeded() argument
812 u64 next_credit = queue->credit_window_start + in tx_credit_exceeded()
813 msecs_to_jiffies(queue->credit_usec / 1000); in tx_credit_exceeded()
816 if (timer_pending(&queue->credit_timeout)) { in tx_credit_exceeded()
817 queue->rate_limited = true; in tx_credit_exceeded()
823 queue->credit_window_start = now; in tx_credit_exceeded()
824 tx_add_credit(queue); in tx_credit_exceeded()
828 if (size > queue->remaining_credit) { in tx_credit_exceeded()
829 mod_timer(&queue->credit_timeout, in tx_credit_exceeded()
831 queue->credit_window_start = next_credit; in tx_credit_exceeded()
832 queue->rate_limited = true; in tx_credit_exceeded()
914 static void xenvif_tx_build_gops(struct xenvif_queue *queue, in xenvif_tx_build_gops() argument
923 while (skb_queue_len(&queue->tx_queue) < budget) { in xenvif_tx_build_gops()
932 if (queue->tx.sring->req_prod - queue->tx.req_cons > in xenvif_tx_build_gops()
934 netdev_err(queue->vif->dev, in xenvif_tx_build_gops()
937 queue->tx.sring->req_prod, queue->tx.req_cons, in xenvif_tx_build_gops()
939 xenvif_fatal_tx_err(queue->vif); in xenvif_tx_build_gops()
943 work_to_do = XEN_RING_NR_UNCONSUMED_REQUESTS(&queue->tx); in xenvif_tx_build_gops()
947 idx = queue->tx.req_cons; in xenvif_tx_build_gops()
949 RING_COPY_REQUEST(&queue->tx, idx, &txreq); in xenvif_tx_build_gops()
952 if (txreq.size > queue->remaining_credit && in xenvif_tx_build_gops()
953 tx_credit_exceeded(queue, txreq.size)) in xenvif_tx_build_gops()
956 queue->remaining_credit -= txreq.size; in xenvif_tx_build_gops()
959 queue->tx.req_cons = ++idx; in xenvif_tx_build_gops()
964 work_to_do = xenvif_get_extras(queue, extras, in xenvif_tx_build_gops()
967 idx = queue->tx.req_cons; in xenvif_tx_build_gops()
976 ret = xenvif_mcast_add(queue->vif, extra->u.mcast.addr); in xenvif_tx_build_gops()
978 make_tx_response(queue, &txreq, extra_count, in xenvif_tx_build_gops()
989 xenvif_mcast_del(queue->vif, extra->u.mcast.addr); in xenvif_tx_build_gops()
991 make_tx_response(queue, &txreq, extra_count, in xenvif_tx_build_gops()
999 ret = xenvif_count_requests(queue, &txreq, extra_count, in xenvif_tx_build_gops()
1008 netdev_dbg(queue->vif->dev, in xenvif_tx_build_gops()
1010 xenvif_tx_err(queue, &txreq, extra_count, idx); in xenvif_tx_build_gops()
1016 netdev_err(queue->vif->dev, "Cross page boundary, txreq.offset: %u, size: %u\n", in xenvif_tx_build_gops()
1018 xenvif_fatal_tx_err(queue->vif); in xenvif_tx_build_gops()
1027 netdev_dbg(queue->vif->dev, in xenvif_tx_build_gops()
1029 xenvif_tx_err(queue, &txreq, extra_count, idx); in xenvif_tx_build_gops()
1047 xenvif_tx_err(queue, &txreq, extra_count, idx); in xenvif_tx_build_gops()
1049 netdev_err(queue->vif->dev, in xenvif_tx_build_gops()
1059 if (xenvif_set_skb_gso(queue->vif, skb, gso)) { in xenvif_tx_build_gops()
1095 xenvif_get_requests(queue, skb, &txreq, txfrags, copy_ops, in xenvif_tx_build_gops()
1099 __skb_queue_tail(&queue->tx_queue, skb); in xenvif_tx_build_gops()
1101 queue->tx.req_cons = idx; in xenvif_tx_build_gops()
1110 static int xenvif_handle_frag_list(struct xenvif_queue *queue, struct sk_buff *skb) in xenvif_handle_frag_list() argument
1118 queue->stats.tx_zerocopy_sent += 2; in xenvif_handle_frag_list()
1119 queue->stats.tx_frag_overflow++; in xenvif_handle_frag_list()
1121 xenvif_fill_frags(queue, nskb); in xenvif_handle_frag_list()
1158 atomic_inc(&queue->inflight_packets); in xenvif_handle_frag_list()
1170 static int xenvif_tx_submit(struct xenvif_queue *queue) in xenvif_tx_submit() argument
1172 struct gnttab_map_grant_ref *gop_map = queue->tx_map_ops; in xenvif_tx_submit()
1173 struct gnttab_copy *gop_copy = queue->tx_copy_ops; in xenvif_tx_submit()
1177 while ((skb = __skb_dequeue(&queue->tx_queue)) != NULL) { in xenvif_tx_submit()
1182 txp = &queue->pending_tx_info[pending_idx].req; in xenvif_tx_submit()
1185 if (unlikely(xenvif_tx_check_gop(queue, skb, &gop_map, &gop_copy))) { in xenvif_tx_submit()
1205 xenvif_fill_frags(queue, skb); in xenvif_tx_submit()
1209 xenvif_skb_zerocopy_prepare(queue, nskb); in xenvif_tx_submit()
1210 if (xenvif_handle_frag_list(queue, skb)) { in xenvif_tx_submit()
1212 netdev_err(queue->vif->dev, in xenvif_tx_submit()
1214 xenvif_skb_zerocopy_prepare(queue, skb); in xenvif_tx_submit()
1223 skb->dev = queue->vif->dev; in xenvif_tx_submit()
1227 if (checksum_setup(queue, skb)) { in xenvif_tx_submit()
1228 netdev_dbg(queue->vif->dev, in xenvif_tx_submit()
1232 xenvif_skb_zerocopy_prepare(queue, skb); in xenvif_tx_submit()
1260 queue->stats.rx_bytes += skb->len; in xenvif_tx_submit()
1261 queue->stats.rx_packets++; in xenvif_tx_submit()
1271 xenvif_skb_zerocopy_prepare(queue, skb); in xenvif_tx_submit()
1272 queue->stats.tx_zerocopy_sent++; in xenvif_tx_submit()
1287 struct xenvif_queue *queue = ubuf_to_queue(ubuf); in xenvif_zerocopy_callback() local
1292 spin_lock_irqsave(&queue->callback_lock, flags); in xenvif_zerocopy_callback()
1296 BUG_ON(queue->dealloc_prod - queue->dealloc_cons >= in xenvif_zerocopy_callback()
1298 index = pending_index(queue->dealloc_prod); in xenvif_zerocopy_callback()
1299 queue->dealloc_ring[index] = pending_idx; in xenvif_zerocopy_callback()
1304 queue->dealloc_prod++; in xenvif_zerocopy_callback()
1306 spin_unlock_irqrestore(&queue->callback_lock, flags); in xenvif_zerocopy_callback()
1309 queue->stats.tx_zerocopy_success++; in xenvif_zerocopy_callback()
1311 queue->stats.tx_zerocopy_fail++; in xenvif_zerocopy_callback()
1312 xenvif_skb_zerocopy_complete(queue); in xenvif_zerocopy_callback()
1315 static inline void xenvif_tx_dealloc_action(struct xenvif_queue *queue) in xenvif_tx_dealloc_action() argument
1322 dc = queue->dealloc_cons; in xenvif_tx_dealloc_action()
1323 gop = queue->tx_unmap_ops; in xenvif_tx_dealloc_action()
1327 dp = queue->dealloc_prod; in xenvif_tx_dealloc_action()
1335 BUG_ON(gop - queue->tx_unmap_ops >= MAX_PENDING_REQS); in xenvif_tx_dealloc_action()
1337 queue->dealloc_ring[pending_index(dc++)]; in xenvif_tx_dealloc_action()
1339 pending_idx_release[gop - queue->tx_unmap_ops] = in xenvif_tx_dealloc_action()
1341 queue->pages_to_unmap[gop - queue->tx_unmap_ops] = in xenvif_tx_dealloc_action()
1342 queue->mmap_pages[pending_idx]; in xenvif_tx_dealloc_action()
1344 idx_to_kaddr(queue, pending_idx), in xenvif_tx_dealloc_action()
1346 queue->grant_tx_handle[pending_idx]); in xenvif_tx_dealloc_action()
1347 xenvif_grant_handle_reset(queue, pending_idx); in xenvif_tx_dealloc_action()
1351 } while (dp != queue->dealloc_prod); in xenvif_tx_dealloc_action()
1353 queue->dealloc_cons = dc; in xenvif_tx_dealloc_action()
1355 if (gop - queue->tx_unmap_ops > 0) { in xenvif_tx_dealloc_action()
1357 ret = gnttab_unmap_refs(queue->tx_unmap_ops, in xenvif_tx_dealloc_action()
1359 queue->pages_to_unmap, in xenvif_tx_dealloc_action()
1360 gop - queue->tx_unmap_ops); in xenvif_tx_dealloc_action()
1362 netdev_err(queue->vif->dev, "Unmap fail: nr_ops %tu ret %d\n", in xenvif_tx_dealloc_action()
1363 gop - queue->tx_unmap_ops, ret); in xenvif_tx_dealloc_action()
1364 for (i = 0; i < gop - queue->tx_unmap_ops; ++i) { in xenvif_tx_dealloc_action()
1366 netdev_err(queue->vif->dev, in xenvif_tx_dealloc_action()
1376 for (i = 0; i < gop - queue->tx_unmap_ops; ++i) in xenvif_tx_dealloc_action()
1377 xenvif_idx_release(queue, pending_idx_release[i], in xenvif_tx_dealloc_action()
1383 int xenvif_tx_action(struct xenvif_queue *queue, int budget) in xenvif_tx_action() argument
1388 if (unlikely(!tx_work_todo(queue))) in xenvif_tx_action()
1391 xenvif_tx_build_gops(queue, budget, &nr_cops, &nr_mops); in xenvif_tx_action()
1396 gnttab_batch_copy(queue->tx_copy_ops, nr_cops); in xenvif_tx_action()
1398 ret = gnttab_map_refs(queue->tx_map_ops, in xenvif_tx_action()
1400 queue->pages_to_map, in xenvif_tx_action()
1405 netdev_err(queue->vif->dev, "Map fail: nr %u ret %d\n", in xenvif_tx_action()
1408 WARN_ON_ONCE(queue->tx_map_ops[i].status == in xenvif_tx_action()
1413 work_done = xenvif_tx_submit(queue); in xenvif_tx_action()
1418 static void _make_tx_response(struct xenvif_queue *queue, in _make_tx_response() argument
1423 RING_IDX i = queue->tx.rsp_prod_pvt; in _make_tx_response()
1426 resp = RING_GET_RESPONSE(&queue->tx, i); in _make_tx_response()
1431 RING_GET_RESPONSE(&queue->tx, ++i)->status = XEN_NETIF_RSP_NULL; in _make_tx_response()
1433 queue->tx.rsp_prod_pvt = ++i; in _make_tx_response()
1436 static void push_tx_responses(struct xenvif_queue *queue) in push_tx_responses() argument
1440 RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&queue->tx, notify); in push_tx_responses()
1442 notify_remote_via_irq(queue->tx_irq); in push_tx_responses()
1445 static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx, in xenvif_idx_release() argument
1452 pending_tx_info = &queue->pending_tx_info[pending_idx]; in xenvif_idx_release()
1454 spin_lock_irqsave(&queue->response_lock, flags); in xenvif_idx_release()
1456 _make_tx_response(queue, &pending_tx_info->req, in xenvif_idx_release()
1463 index = pending_index(queue->pending_prod++); in xenvif_idx_release()
1464 queue->pending_ring[index] = pending_idx; in xenvif_idx_release()
1466 push_tx_responses(queue); in xenvif_idx_release()
1468 spin_unlock_irqrestore(&queue->response_lock, flags); in xenvif_idx_release()
1471 static void make_tx_response(struct xenvif_queue *queue, in make_tx_response() argument
1478 spin_lock_irqsave(&queue->response_lock, flags); in make_tx_response()
1480 _make_tx_response(queue, txp, extra_count, status); in make_tx_response()
1481 push_tx_responses(queue); in make_tx_response()
1483 spin_unlock_irqrestore(&queue->response_lock, flags); in make_tx_response()
1486 static void xenvif_idx_unmap(struct xenvif_queue *queue, u16 pending_idx) in xenvif_idx_unmap() argument
1492 idx_to_kaddr(queue, pending_idx), in xenvif_idx_unmap()
1494 queue->grant_tx_handle[pending_idx]); in xenvif_idx_unmap()
1495 xenvif_grant_handle_reset(queue, pending_idx); in xenvif_idx_unmap()
1498 &queue->mmap_pages[pending_idx], 1); in xenvif_idx_unmap()
1500 netdev_err(queue->vif->dev, in xenvif_idx_unmap()
1511 static inline int tx_work_todo(struct xenvif_queue *queue) in tx_work_todo() argument
1513 if (likely(RING_HAS_UNCONSUMED_REQUESTS(&queue->tx))) in tx_work_todo()
1519 static inline bool tx_dealloc_work_todo(struct xenvif_queue *queue) in tx_dealloc_work_todo() argument
1521 return queue->dealloc_cons != queue->dealloc_prod; in tx_dealloc_work_todo()
1524 void xenvif_unmap_frontend_data_rings(struct xenvif_queue *queue) in xenvif_unmap_frontend_data_rings() argument
1526 if (queue->tx.sring) in xenvif_unmap_frontend_data_rings()
1527 xenbus_unmap_ring_vfree(xenvif_to_xenbus_device(queue->vif), in xenvif_unmap_frontend_data_rings()
1528 queue->tx.sring); in xenvif_unmap_frontend_data_rings()
1529 if (queue->rx.sring) in xenvif_unmap_frontend_data_rings()
1530 xenbus_unmap_ring_vfree(xenvif_to_xenbus_device(queue->vif), in xenvif_unmap_frontend_data_rings()
1531 queue->rx.sring); in xenvif_unmap_frontend_data_rings()
1534 int xenvif_map_frontend_data_rings(struct xenvif_queue *queue, in xenvif_map_frontend_data_rings() argument
1544 err = xenbus_map_ring_valloc(xenvif_to_xenbus_device(queue->vif), in xenvif_map_frontend_data_rings()
1553 BACK_RING_ATTACH(&queue->tx, txs, rsp_prod, XEN_PAGE_SIZE); in xenvif_map_frontend_data_rings()
1556 if (req_prod - rsp_prod > RING_SIZE(&queue->tx)) in xenvif_map_frontend_data_rings()
1559 err = xenbus_map_ring_valloc(xenvif_to_xenbus_device(queue->vif), in xenvif_map_frontend_data_rings()
1568 BACK_RING_ATTACH(&queue->rx, rxs, rsp_prod, XEN_PAGE_SIZE); in xenvif_map_frontend_data_rings()
1571 if (req_prod - rsp_prod > RING_SIZE(&queue->rx)) in xenvif_map_frontend_data_rings()
1577 xenvif_unmap_frontend_data_rings(queue); in xenvif_map_frontend_data_rings()
1581 static bool xenvif_dealloc_kthread_should_stop(struct xenvif_queue *queue) in xenvif_dealloc_kthread_should_stop() argument
1587 !atomic_read(&queue->inflight_packets); in xenvif_dealloc_kthread_should_stop()
1592 struct xenvif_queue *queue = data; in xenvif_dealloc_kthread() local
1595 wait_event_interruptible(queue->dealloc_wq, in xenvif_dealloc_kthread()
1596 tx_dealloc_work_todo(queue) || in xenvif_dealloc_kthread()
1597 xenvif_dealloc_kthread_should_stop(queue)); in xenvif_dealloc_kthread()
1598 if (xenvif_dealloc_kthread_should_stop(queue)) in xenvif_dealloc_kthread()
1601 xenvif_tx_dealloc_action(queue); in xenvif_dealloc_kthread()
1606 if (tx_dealloc_work_todo(queue)) in xenvif_dealloc_kthread()
1607 xenvif_tx_dealloc_action(queue); in xenvif_dealloc_kthread()