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,
113 static void push_tx_responses(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()
214 spin_lock_irqsave(&queue->response_lock, flags); in xenvif_tx_err()
215 make_tx_response(queue, txp, extra_count, XEN_NETIF_RSP_ERROR); in xenvif_tx_err()
216 push_tx_responses(queue); in xenvif_tx_err()
217 spin_unlock_irqrestore(&queue->response_lock, flags); in xenvif_tx_err()
220 RING_COPY_REQUEST(&queue->tx, cons++, txp); in xenvif_tx_err()
223 queue->tx.req_cons = cons; in xenvif_tx_err()
235 static int xenvif_count_requests(struct xenvif_queue *queue, in xenvif_count_requests() argument
241 RING_IDX cons = queue->tx.req_cons; in xenvif_count_requests()
253 netdev_err(queue->vif->dev, in xenvif_count_requests()
256 xenvif_fatal_tx_err(queue->vif); in xenvif_count_requests()
264 netdev_err(queue->vif->dev, in xenvif_count_requests()
267 xenvif_fatal_tx_err(queue->vif); in xenvif_count_requests()
280 netdev_dbg(queue->vif->dev, in xenvif_count_requests()
289 RING_COPY_REQUEST(&queue->tx, cons + slots, txp); in xenvif_count_requests()
302 netdev_dbg(queue->vif->dev, in xenvif_count_requests()
312 netdev_err(queue->vif->dev, "Cross page boundary, txp->offset: %u, size: %u\n", in xenvif_count_requests()
314 xenvif_fatal_tx_err(queue->vif); in xenvif_count_requests()
326 xenvif_tx_err(queue, first, extra_count, cons + slots); in xenvif_count_requests()
343 static inline void xenvif_tx_create_map_op(struct xenvif_queue *queue, in xenvif_tx_create_map_op() argument
349 queue->pages_to_map[mop-queue->tx_map_ops] = queue->mmap_pages[pending_idx]; in xenvif_tx_create_map_op()
350 gnttab_set_map_op(mop, idx_to_kaddr(queue, pending_idx), in xenvif_tx_create_map_op()
352 txp->gref, queue->vif->domid); in xenvif_tx_create_map_op()
354 memcpy(&queue->pending_tx_info[pending_idx].req, txp, in xenvif_tx_create_map_op()
356 queue->pending_tx_info[pending_idx].extra_count = extra_count; in xenvif_tx_create_map_op()
376 static void xenvif_get_requests(struct xenvif_queue *queue, in xenvif_get_requests() argument
392 struct gnttab_copy *cop = queue->tx_copy_ops + *copy_ops; in xenvif_get_requests()
393 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()
419 index = pending_index(queue->pending_cons); in xenvif_get_requests()
420 pending_idx = queue->pending_ring[index]; in xenvif_get_requests()
421 callback_param(queue, pending_idx).ctx = NULL; in xenvif_get_requests()
431 memcpy(&queue->pending_tx_info[pending_idx].req, in xenvif_get_requests()
433 queue->pending_tx_info[pending_idx].extra_count = in xenvif_get_requests()
440 queue->pending_cons++; in xenvif_get_requests()
453 index = pending_index(queue->pending_cons++); in xenvif_get_requests()
454 pending_idx = queue->pending_ring[index]; in xenvif_get_requests()
455 xenvif_tx_create_map_op(queue, pending_idx, txp, in xenvif_get_requests()
472 index = pending_index(queue->pending_cons++); in xenvif_get_requests()
473 pending_idx = queue->pending_ring[index]; in xenvif_get_requests()
474 xenvif_tx_create_map_op(queue, pending_idx, txp, 0, in xenvif_get_requests()
483 (*copy_ops) = cop - queue->tx_copy_ops; in xenvif_get_requests()
484 (*map_ops) = gop - queue->tx_map_ops; in xenvif_get_requests()
487 static inline void xenvif_grant_handle_set(struct xenvif_queue *queue, in xenvif_grant_handle_set() argument
491 if (unlikely(queue->grant_tx_handle[pending_idx] != in xenvif_grant_handle_set()
493 netdev_err(queue->vif->dev, in xenvif_grant_handle_set()
498 queue->grant_tx_handle[pending_idx] = handle; in xenvif_grant_handle_set()
501 static inline void xenvif_grant_handle_reset(struct xenvif_queue *queue, in xenvif_grant_handle_reset() argument
504 if (unlikely(queue->grant_tx_handle[pending_idx] == in xenvif_grant_handle_reset()
506 netdev_err(queue->vif->dev, in xenvif_grant_handle_reset()
511 queue->grant_tx_handle[pending_idx] = NETBACK_INVALID_HANDLE; in xenvif_grant_handle_reset()
514 static int xenvif_tx_check_gop(struct xenvif_queue *queue, in xenvif_tx_check_gop() argument
545 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
550 netdev_dbg(queue->vif->dev, in xenvif_tx_check_gop()
557 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
573 xenvif_grant_handle_set(queue, in xenvif_tx_check_gop()
578 xenvif_idx_unmap(queue, pending_idx); in xenvif_tx_check_gop()
584 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
587 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
595 netdev_dbg(queue->vif->dev, in xenvif_tx_check_gop()
602 xenvif_idx_release(queue, pending_idx, XEN_NETIF_RSP_ERROR); in xenvif_tx_check_gop()
611 xenvif_idx_unmap(queue, pending_idx); in xenvif_tx_check_gop()
612 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
622 xenvif_idx_unmap(queue, pending_idx); in xenvif_tx_check_gop()
623 xenvif_idx_release(queue, pending_idx, in xenvif_tx_check_gop()
644 static void xenvif_fill_frags(struct xenvif_queue *queue, struct sk_buff *skb) in xenvif_fill_frags() argument
662 &callback_param(queue, pending_idx); in xenvif_fill_frags()
664 callback_param(queue, prev_pending_idx).ctx = in xenvif_fill_frags()
665 &callback_param(queue, pending_idx); in xenvif_fill_frags()
667 callback_param(queue, pending_idx).ctx = NULL; in xenvif_fill_frags()
670 txp = &queue->pending_tx_info[pending_idx].req; in xenvif_fill_frags()
671 page = virt_to_page(idx_to_kaddr(queue, pending_idx)); in xenvif_fill_frags()
678 get_page(queue->mmap_pages[pending_idx]); in xenvif_fill_frags()
682 static int xenvif_get_extras(struct xenvif_queue *queue, in xenvif_get_extras() argument
688 RING_IDX cons = queue->tx.req_cons; in xenvif_get_extras()
692 netdev_err(queue->vif->dev, "Missing extra info\n"); in xenvif_get_extras()
693 xenvif_fatal_tx_err(queue->vif); in xenvif_get_extras()
697 RING_COPY_REQUEST(&queue->tx, cons, &extra); in xenvif_get_extras()
699 queue->tx.req_cons = ++cons; in xenvif_get_extras()
704 netdev_err(queue->vif->dev, in xenvif_get_extras()
706 xenvif_fatal_tx_err(queue->vif); in xenvif_get_extras()
745 static int checksum_setup(struct xenvif_queue *queue, struct sk_buff *skb) in checksum_setup() argument
755 queue->stats.rx_gso_checksum_fixup++; in checksum_setup()
767 static bool tx_credit_exceeded(struct xenvif_queue *queue, unsigned size) in tx_credit_exceeded() argument
770 u64 next_credit = queue->credit_window_start + in tx_credit_exceeded()
771 msecs_to_jiffies(queue->credit_usec / 1000); in tx_credit_exceeded()
774 if (timer_pending(&queue->credit_timeout)) { in tx_credit_exceeded()
775 queue->rate_limited = true; in tx_credit_exceeded()
781 queue->credit_window_start = now; in tx_credit_exceeded()
782 tx_add_credit(queue); in tx_credit_exceeded()
786 if (size > queue->remaining_credit) { in tx_credit_exceeded()
787 mod_timer(&queue->credit_timeout, in tx_credit_exceeded()
789 queue->credit_window_start = next_credit; in tx_credit_exceeded()
790 queue->rate_limited = true; in tx_credit_exceeded()
872 static void xenvif_tx_build_gops(struct xenvif_queue *queue, in xenvif_tx_build_gops() argument
881 while (skb_queue_len(&queue->tx_queue) < budget) { in xenvif_tx_build_gops()
892 if (queue->tx.sring->req_prod - queue->tx.req_cons > in xenvif_tx_build_gops()
894 netdev_err(queue->vif->dev, in xenvif_tx_build_gops()
897 queue->tx.sring->req_prod, queue->tx.req_cons, in xenvif_tx_build_gops()
899 xenvif_fatal_tx_err(queue->vif); in xenvif_tx_build_gops()
903 work_to_do = XEN_RING_NR_UNCONSUMED_REQUESTS(&queue->tx); in xenvif_tx_build_gops()
907 idx = queue->tx.req_cons; in xenvif_tx_build_gops()
909 RING_COPY_REQUEST(&queue->tx, idx, &txreq); in xenvif_tx_build_gops()
912 if (txreq.size > queue->remaining_credit && in xenvif_tx_build_gops()
913 tx_credit_exceeded(queue, txreq.size)) in xenvif_tx_build_gops()
916 queue->remaining_credit -= txreq.size; in xenvif_tx_build_gops()
919 queue->tx.req_cons = ++idx; in xenvif_tx_build_gops()
924 work_to_do = xenvif_get_extras(queue, extras, in xenvif_tx_build_gops()
927 idx = queue->tx.req_cons; in xenvif_tx_build_gops()
936 ret = xenvif_mcast_add(queue->vif, extra->u.mcast.addr); in xenvif_tx_build_gops()
938 make_tx_response(queue, &txreq, extra_count, in xenvif_tx_build_gops()
942 push_tx_responses(queue); in xenvif_tx_build_gops()
950 xenvif_mcast_del(queue->vif, extra->u.mcast.addr); in xenvif_tx_build_gops()
952 make_tx_response(queue, &txreq, extra_count, in xenvif_tx_build_gops()
954 push_tx_responses(queue); in xenvif_tx_build_gops()
961 ret = xenvif_count_requests(queue, &txreq, extra_count, in xenvif_tx_build_gops()
970 netdev_dbg(queue->vif->dev, in xenvif_tx_build_gops()
972 xenvif_tx_err(queue, &txreq, extra_count, idx); in xenvif_tx_build_gops()
978 netdev_err(queue->vif->dev, in xenvif_tx_build_gops()
982 xenvif_fatal_tx_err(queue->vif); in xenvif_tx_build_gops()
986 index = pending_index(queue->pending_cons); in xenvif_tx_build_gops()
987 pending_idx = queue->pending_ring[index]; in xenvif_tx_build_gops()
994 netdev_dbg(queue->vif->dev, in xenvif_tx_build_gops()
996 xenvif_tx_err(queue, &txreq, extra_count, idx); in xenvif_tx_build_gops()
1014 xenvif_tx_err(queue, &txreq, extra_count, idx); in xenvif_tx_build_gops()
1016 netdev_err(queue->vif->dev, in xenvif_tx_build_gops()
1026 if (xenvif_set_skb_gso(queue->vif, skb, gso)) { in xenvif_tx_build_gops()
1062 xenvif_get_requests(queue, skb, &txreq, txfrags, copy_ops, in xenvif_tx_build_gops()
1066 __skb_queue_tail(&queue->tx_queue, skb); in xenvif_tx_build_gops()
1068 queue->tx.req_cons = idx; in xenvif_tx_build_gops()
1070 if ((*map_ops >= ARRAY_SIZE(queue->tx_map_ops)) || in xenvif_tx_build_gops()
1071 (*copy_ops >= ARRAY_SIZE(queue->tx_copy_ops))) in xenvif_tx_build_gops()
1081 static int xenvif_handle_frag_list(struct xenvif_queue *queue, struct sk_buff *skb) in xenvif_handle_frag_list() argument
1089 queue->stats.tx_zerocopy_sent += 2; in xenvif_handle_frag_list()
1090 queue->stats.tx_frag_overflow++; in xenvif_handle_frag_list()
1092 xenvif_fill_frags(queue, nskb); in xenvif_handle_frag_list()
1131 atomic_inc(&queue->inflight_packets); in xenvif_handle_frag_list()
1143 static int xenvif_tx_submit(struct xenvif_queue *queue) in xenvif_tx_submit() argument
1145 struct gnttab_map_grant_ref *gop_map = queue->tx_map_ops; in xenvif_tx_submit()
1146 struct gnttab_copy *gop_copy = queue->tx_copy_ops; in xenvif_tx_submit()
1150 while ((skb = __skb_dequeue(&queue->tx_queue)) != NULL) { in xenvif_tx_submit()
1155 txp = &queue->pending_tx_info[pending_idx].req; in xenvif_tx_submit()
1158 if (unlikely(xenvif_tx_check_gop(queue, skb, &gop_map, &gop_copy))) { in xenvif_tx_submit()
1178 xenvif_fill_frags(queue, skb); in xenvif_tx_submit()
1182 xenvif_skb_zerocopy_prepare(queue, nskb); in xenvif_tx_submit()
1183 if (xenvif_handle_frag_list(queue, skb)) { in xenvif_tx_submit()
1185 netdev_err(queue->vif->dev, in xenvif_tx_submit()
1187 xenvif_skb_zerocopy_prepare(queue, skb); in xenvif_tx_submit()
1196 skb->dev = queue->vif->dev; in xenvif_tx_submit()
1200 if (checksum_setup(queue, skb)) { in xenvif_tx_submit()
1201 netdev_dbg(queue->vif->dev, in xenvif_tx_submit()
1205 xenvif_skb_zerocopy_prepare(queue, skb); in xenvif_tx_submit()
1233 queue->stats.rx_bytes += skb->len; in xenvif_tx_submit()
1234 queue->stats.rx_packets++; in xenvif_tx_submit()
1244 xenvif_skb_zerocopy_prepare(queue, skb); in xenvif_tx_submit()
1245 queue->stats.tx_zerocopy_sent++; in xenvif_tx_submit()
1260 struct xenvif_queue *queue = ubuf_to_queue(ubuf); in xenvif_zerocopy_callback() local
1265 spin_lock_irqsave(&queue->callback_lock, flags); in xenvif_zerocopy_callback()
1269 BUG_ON(queue->dealloc_prod - queue->dealloc_cons >= in xenvif_zerocopy_callback()
1271 index = pending_index(queue->dealloc_prod); in xenvif_zerocopy_callback()
1272 queue->dealloc_ring[index] = pending_idx; in xenvif_zerocopy_callback()
1277 queue->dealloc_prod++; in xenvif_zerocopy_callback()
1279 spin_unlock_irqrestore(&queue->callback_lock, flags); in xenvif_zerocopy_callback()
1282 queue->stats.tx_zerocopy_success++; in xenvif_zerocopy_callback()
1284 queue->stats.tx_zerocopy_fail++; in xenvif_zerocopy_callback()
1285 xenvif_skb_zerocopy_complete(queue); in xenvif_zerocopy_callback()
1288 static inline void xenvif_tx_dealloc_action(struct xenvif_queue *queue) in xenvif_tx_dealloc_action() argument
1295 dc = queue->dealloc_cons; in xenvif_tx_dealloc_action()
1296 gop = queue->tx_unmap_ops; in xenvif_tx_dealloc_action()
1300 dp = queue->dealloc_prod; in xenvif_tx_dealloc_action()
1308 BUG_ON(gop - queue->tx_unmap_ops >= MAX_PENDING_REQS); in xenvif_tx_dealloc_action()
1310 queue->dealloc_ring[pending_index(dc++)]; in xenvif_tx_dealloc_action()
1312 pending_idx_release[gop - queue->tx_unmap_ops] = in xenvif_tx_dealloc_action()
1314 queue->pages_to_unmap[gop - queue->tx_unmap_ops] = in xenvif_tx_dealloc_action()
1315 queue->mmap_pages[pending_idx]; in xenvif_tx_dealloc_action()
1317 idx_to_kaddr(queue, pending_idx), in xenvif_tx_dealloc_action()
1319 queue->grant_tx_handle[pending_idx]); in xenvif_tx_dealloc_action()
1320 xenvif_grant_handle_reset(queue, pending_idx); in xenvif_tx_dealloc_action()
1324 } while (dp != queue->dealloc_prod); in xenvif_tx_dealloc_action()
1326 queue->dealloc_cons = dc; in xenvif_tx_dealloc_action()
1328 if (gop - queue->tx_unmap_ops > 0) { in xenvif_tx_dealloc_action()
1330 ret = gnttab_unmap_refs(queue->tx_unmap_ops, in xenvif_tx_dealloc_action()
1332 queue->pages_to_unmap, in xenvif_tx_dealloc_action()
1333 gop - queue->tx_unmap_ops); in xenvif_tx_dealloc_action()
1335 netdev_err(queue->vif->dev, "Unmap fail: nr_ops %tu ret %d\n", in xenvif_tx_dealloc_action()
1336 gop - queue->tx_unmap_ops, ret); in xenvif_tx_dealloc_action()
1337 for (i = 0; i < gop - queue->tx_unmap_ops; ++i) { in xenvif_tx_dealloc_action()
1339 netdev_err(queue->vif->dev, in xenvif_tx_dealloc_action()
1349 for (i = 0; i < gop - queue->tx_unmap_ops; ++i) in xenvif_tx_dealloc_action()
1350 xenvif_idx_release(queue, pending_idx_release[i], in xenvif_tx_dealloc_action()
1356 int xenvif_tx_action(struct xenvif_queue *queue, int budget) in xenvif_tx_action() argument
1361 if (unlikely(!tx_work_todo(queue))) in xenvif_tx_action()
1364 xenvif_tx_build_gops(queue, budget, &nr_cops, &nr_mops); in xenvif_tx_action()
1369 gnttab_batch_copy(queue->tx_copy_ops, nr_cops); in xenvif_tx_action()
1371 ret = gnttab_map_refs(queue->tx_map_ops, in xenvif_tx_action()
1373 queue->pages_to_map, in xenvif_tx_action()
1378 netdev_err(queue->vif->dev, "Map fail: nr %u ret %d\n", in xenvif_tx_action()
1381 WARN_ON_ONCE(queue->tx_map_ops[i].status == in xenvif_tx_action()
1386 work_done = xenvif_tx_submit(queue); in xenvif_tx_action()
1391 static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx, in xenvif_idx_release() argument
1398 pending_tx_info = &queue->pending_tx_info[pending_idx]; in xenvif_idx_release()
1400 spin_lock_irqsave(&queue->response_lock, flags); in xenvif_idx_release()
1402 make_tx_response(queue, &pending_tx_info->req, in xenvif_idx_release()
1409 index = pending_index(queue->pending_prod++); in xenvif_idx_release()
1410 queue->pending_ring[index] = pending_idx; in xenvif_idx_release()
1412 push_tx_responses(queue); in xenvif_idx_release()
1414 spin_unlock_irqrestore(&queue->response_lock, flags); in xenvif_idx_release()
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_unmap(struct xenvif_queue *queue, u16 pending_idx) in xenvif_idx_unmap() argument
1451 idx_to_kaddr(queue, pending_idx), in xenvif_idx_unmap()
1453 queue->grant_tx_handle[pending_idx]); in xenvif_idx_unmap()
1454 xenvif_grant_handle_reset(queue, pending_idx); in xenvif_idx_unmap()
1457 &queue->mmap_pages[pending_idx], 1); in xenvif_idx_unmap()
1459 netdev_err(queue->vif->dev, in xenvif_idx_unmap()
1470 static inline int tx_work_todo(struct xenvif_queue *queue) in tx_work_todo() argument
1472 if (likely(RING_HAS_UNCONSUMED_REQUESTS(&queue->tx))) in tx_work_todo()
1478 static inline bool tx_dealloc_work_todo(struct xenvif_queue *queue) in tx_dealloc_work_todo() argument
1480 return queue->dealloc_cons != queue->dealloc_prod; in tx_dealloc_work_todo()
1483 void xenvif_unmap_frontend_data_rings(struct xenvif_queue *queue) in xenvif_unmap_frontend_data_rings() argument
1485 if (queue->tx.sring) in xenvif_unmap_frontend_data_rings()
1486 xenbus_unmap_ring_vfree(xenvif_to_xenbus_device(queue->vif), in xenvif_unmap_frontend_data_rings()
1487 queue->tx.sring); in xenvif_unmap_frontend_data_rings()
1488 if (queue->rx.sring) in xenvif_unmap_frontend_data_rings()
1489 xenbus_unmap_ring_vfree(xenvif_to_xenbus_device(queue->vif), in xenvif_unmap_frontend_data_rings()
1490 queue->rx.sring); in xenvif_unmap_frontend_data_rings()
1493 int xenvif_map_frontend_data_rings(struct xenvif_queue *queue, in xenvif_map_frontend_data_rings() argument
1503 err = xenbus_map_ring_valloc(xenvif_to_xenbus_device(queue->vif), in xenvif_map_frontend_data_rings()
1512 BACK_RING_ATTACH(&queue->tx, txs, rsp_prod, XEN_PAGE_SIZE); in xenvif_map_frontend_data_rings()
1515 if (req_prod - rsp_prod > RING_SIZE(&queue->tx)) in xenvif_map_frontend_data_rings()
1518 err = xenbus_map_ring_valloc(xenvif_to_xenbus_device(queue->vif), in xenvif_map_frontend_data_rings()
1527 BACK_RING_ATTACH(&queue->rx, rxs, rsp_prod, XEN_PAGE_SIZE); in xenvif_map_frontend_data_rings()
1530 if (req_prod - rsp_prod > RING_SIZE(&queue->rx)) in xenvif_map_frontend_data_rings()
1536 xenvif_unmap_frontend_data_rings(queue); in xenvif_map_frontend_data_rings()
1540 static bool xenvif_dealloc_kthread_should_stop(struct xenvif_queue *queue) in xenvif_dealloc_kthread_should_stop() argument
1546 !atomic_read(&queue->inflight_packets); in xenvif_dealloc_kthread_should_stop()
1551 struct xenvif_queue *queue = data; in xenvif_dealloc_kthread() local
1554 wait_event_interruptible(queue->dealloc_wq, in xenvif_dealloc_kthread()
1555 tx_dealloc_work_todo(queue) || in xenvif_dealloc_kthread()
1556 xenvif_dealloc_kthread_should_stop(queue)); in xenvif_dealloc_kthread()
1557 if (xenvif_dealloc_kthread_should_stop(queue)) in xenvif_dealloc_kthread()
1560 xenvif_tx_dealloc_action(queue); in xenvif_dealloc_kthread()
1565 if (tx_dealloc_work_todo(queue)) in xenvif_dealloc_kthread()
1566 xenvif_tx_dealloc_action(queue); in xenvif_dealloc_kthread()