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

Function update_queuing_status

dpdk/drivers/net/vhost/rte_eth_vhost.c:745–787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

743}
744
745static void
746update_queuing_status(struct rte_eth_dev *dev, bool wait_queuing)
747{
748 struct pmd_internal *internal = dev->data->dev_private;
749 struct vhost_queue *vq;
750 struct rte_vhost_vring_state *state;
751 unsigned int i;
752 int allow_queuing = 1;
753
754 if (!dev->data->rx_queues || !dev->data->tx_queues)
755 return;
756
757 if (rte_atomic32_read(&internal->started) == 0 ||
758 rte_atomic32_read(&internal->dev_attached) == 0)
759 allow_queuing = 0;
760
761 state = vring_states[dev->data->port_id];
762
763 /* Wait until rx/tx_pkt_burst stops accessing vhost device */
764 for (i = 0; i < dev->data->nb_rx_queues; i++) {
765 vq = dev->data->rx_queues[i];
766 if (vq == NULL)
767 continue;
768 if (allow_queuing && state->cur[vq->virtqueue_id])
769 rte_atomic32_set(&vq->allow_queuing, 1);
770 else
771 rte_atomic32_set(&vq->allow_queuing, 0);
772 while (wait_queuing && rte_atomic32_read(&vq->while_queuing))
773 rte_pause();
774 }
775
776 for (i = 0; i < dev->data->nb_tx_queues; i++) {
777 vq = dev->data->tx_queues[i];
778 if (vq == NULL)
779 continue;
780 if (allow_queuing && state->cur[vq->virtqueue_id])
781 rte_atomic32_set(&vq->allow_queuing, 1);
782 else
783 rte_atomic32_set(&vq->allow_queuing, 0);
784 while (wait_queuing && rte_atomic32_read(&vq->while_queuing))
785 rte_pause();
786 }
787}
788
789static void
790queue_setup(struct rte_eth_dev *eth_dev, struct pmd_internal *internal)

Callers 5

new_deviceFunction · 0.85
destroy_deviceFunction · 0.85
vring_state_changedFunction · 0.85
eth_dev_startFunction · 0.85
eth_dev_stopFunction · 0.85

Calls 3

rte_atomic32_readFunction · 0.85
rte_atomic32_setFunction · 0.85
rte_pauseFunction · 0.50

Tested by

no test coverage detected