X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fvirtio%2Fvirtio_ethdev.c;h=ee5a98b7c073bba636c9fa96fdf28144b7410742;hb=239810607333f7e68979781b0c7be2a14c242f6a;hp=446c338fcd28f18b9933396f2914f157461501e5;hpb=efcda13648d25ed21bc9de2f19082fe8eb5ab8ff;p=dpdk.git diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 446c338fcd..ee5a98b7c0 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -149,7 +149,7 @@ virtio_pq_send_command(struct virtnet_ctl *cvq, struct virtio_pmd_ctrl *ctrl, int head; struct vring_packed_desc *desc = vq->ring_packed.desc_packed; struct virtio_pmd_ctrl *result; - int wrap_counter; + bool avail_wrap_counter, used_wrap_counter; uint16_t flags; int sum = 0; int k; @@ -161,7 +161,8 @@ virtio_pq_send_command(struct virtnet_ctl *cvq, struct virtio_pmd_ctrl *ctrl, * One RX packet for ACK. */ head = vq->vq_avail_idx; - wrap_counter = vq->avail_wrap_counter; + avail_wrap_counter = vq->avail_wrap_counter; + used_wrap_counter = vq->used_wrap_counter; desc[head].flags = VRING_DESC_F_NEXT; desc[head].addr = cvq->virtio_net_hdr_mem; desc[head].len = sizeof(struct virtio_net_ctrl_hdr); @@ -199,8 +200,8 @@ virtio_pq_send_command(struct virtnet_ctl *cvq, struct virtio_pmd_ctrl *ctrl, VRING_DESC_F_USED(!vq->avail_wrap_counter); desc[vq->vq_avail_idx].flags = flags; flags = VRING_DESC_F_NEXT; - flags |= VRING_DESC_F_AVAIL(wrap_counter) | - VRING_DESC_F_USED(!wrap_counter); + flags |= VRING_DESC_F_AVAIL(avail_wrap_counter) | + VRING_DESC_F_USED(!avail_wrap_counter); desc[head].flags = flags; rte_smp_wmb(); @@ -216,7 +217,7 @@ virtio_pq_send_command(struct virtnet_ctl *cvq, struct virtio_pmd_ctrl *ctrl, do { rte_rmb(); usleep(100); - } while (!desc_is_used(&desc[head], vq)); + } while (!__desc_is_used(&desc[head], used_wrap_counter)); /* now get used descriptors */ while (desc_is_used(&desc[vq->vq_used_cons_idx], vq)) { @@ -1613,6 +1614,8 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) if (virtio_negotiate_features(hw, req_features) < 0) return -1; + hw->weak_barriers = !vtpci_with_feature(hw, VIRTIO_F_ORDER_PLATFORM); + if (!hw->virtio_user_dev) { pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); rte_eth_copy_pci_info(eth_dev, pci_dev);