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=d0c65e3752f383166a81bf99c779695363dadb0a;hpb=ec194c2f189525b2fb4be5604422a28ea5f08acd;p=dpdk.git diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index d0c65e3752..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)) { @@ -1481,10 +1482,9 @@ set_rxtx_funcs(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = virtio_recv_pkts_vec; } else if (hw->use_inorder_rx) { PMD_INIT_LOG(INFO, - "virtio: using inorder mergeable buffer Rx path on port %u", + "virtio: using inorder Rx path on port %u", eth_dev->data->port_id); - eth_dev->rx_pkt_burst = - &virtio_recv_mergeable_pkts_inorder; + eth_dev->rx_pkt_burst = &virtio_recv_pkts_inorder; } else if (vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) { PMD_INIT_LOG(INFO, "virtio: using mergeable buffer Rx path on port %u", @@ -1614,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); @@ -2049,13 +2051,8 @@ virtio_dev_configure(struct rte_eth_dev *dev) if (vtpci_with_feature(hw, VIRTIO_F_IN_ORDER)) { hw->use_inorder_tx = 1; - if (vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF) && - !vtpci_packed_queue(hw)) { - hw->use_inorder_rx = 1; - hw->use_simple_rx = 0; - } else { - hw->use_inorder_rx = 0; - } + hw->use_inorder_rx = 1; + hw->use_simple_rx = 0; } if (vtpci_packed_queue(hw)) {