| 743 | } |
| 744 | |
| 745 | static void |
| 746 | update_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 | |
| 789 | static void |
| 790 | queue_setup(struct rte_eth_dev *eth_dev, struct pmd_internal *internal) |
no test coverage detected