MCPcopy Create free account
hub / github.com/F-Stack/f-stack / virtqueue_rxvq_flush_split

Function virtqueue_rxvq_flush_split

dpdk/drivers/net/virtio/virtqueue.c:90–136  ·  view source on GitHub ↗

Flush the elements in the used ring. */

Source from the content-addressed store, hash-verified

88
89/* Flush the elements in the used ring. */
90static void
91virtqueue_rxvq_flush_split(struct virtqueue *vq)
92{
93 struct virtnet_rx *rxq = &vq->rxq;
94 struct virtio_hw *hw = vq->hw;
95 struct vring_used_elem *uep;
96 struct vq_desc_extra *dxp;
97 uint16_t used_idx, desc_idx;
98 uint16_t nb_used, i;
99
100 nb_used = virtqueue_nused(vq);
101
102 for (i = 0; i < nb_used; i++) {
103 used_idx = vq->vq_used_cons_idx & (vq->vq_nentries - 1);
104 uep = &vq->vq_split.ring.used->ring[used_idx];
105 if (hw->use_vec_rx) {
106 desc_idx = used_idx;
107 rte_pktmbuf_free(vq->rxq.sw_ring[desc_idx]);
108 vq->vq_free_cnt++;
109 } else if (hw->use_inorder_rx) {
110 desc_idx = (uint16_t)uep->id;
111 dxp = &vq->vq_descx[desc_idx];
112 if (dxp->cookie != NULL) {
113 rte_pktmbuf_free(dxp->cookie);
114 dxp->cookie = NULL;
115 }
116 vq_ring_free_inorder(vq, desc_idx, 1);
117 } else {
118 desc_idx = (uint16_t)uep->id;
119 dxp = &vq->vq_descx[desc_idx];
120 if (dxp->cookie != NULL) {
121 rte_pktmbuf_free(dxp->cookie);
122 dxp->cookie = NULL;
123 }
124 vq_ring_free_chain(vq, desc_idx);
125 }
126 vq->vq_used_cons_idx++;
127 }
128
129 if (hw->use_vec_rx) {
130 while (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) {
131 virtio_rxq_rearm_vec(rxq);
132 if (virtqueue_kick_prepare(vq))
133 virtqueue_notify(vq);
134 }
135 }
136}
137
138/* Flush the elements in the used ring. */
139void

Callers 1

virtqueue_rxvq_flushFunction · 0.85

Calls 7

virtqueue_nusedFunction · 0.85
rte_pktmbuf_freeFunction · 0.85
vq_ring_free_inorderFunction · 0.85
virtio_rxq_rearm_vecFunction · 0.85
vq_ring_free_chainFunction · 0.70
virtqueue_kick_prepareFunction · 0.70
virtqueue_notifyFunction · 0.70

Tested by

no test coverage detected