From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH v3 18/21] net/virtio: add support for mergeable buffers with packed virtqueues Date: Fri, 6 Apr 2018 12:05:02 +0200 Message-ID: <927d4379-cc6c-bb5b-3b55-15863c0879af@redhat.com> References: <20180405101031.26468-1-jfreimann@redhat.com> <20180405101031.26468-19-jfreimann@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: tiwei.bie@intel.com, yliu@fridaylinux.org, mst@redhat.com To: Jens Freimann , dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id E66AD1CEFD for ; Fri, 6 Apr 2018 12:05:05 +0200 (CEST) In-Reply-To: <20180405101031.26468-19-jfreimann@redhat.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Maybe better to place this patch right after the non-mrg one. On 04/05/2018 12:10 PM, Jens Freimann wrote: > Implement support for receiving merged buffers in virtio when packed virtqueues > are enabled. > > Signed-off-by: Jens Freimann > --- > drivers/net/virtio/virtio_ethdev.c | 10 ++-- > drivers/net/virtio/virtio_rxtx.c | 107 +++++++++++++++++++++++++++++++++---- > drivers/net/virtio/virtqueue.h | 1 + > 3 files changed, 104 insertions(+), 14 deletions(-) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index 7367d9c5d..a3c3376d7 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -1322,15 +1322,15 @@ set_rxtx_funcs(struct rte_eth_dev *eth_dev) > { > struct virtio_hw *hw = eth_dev->data->dev_private; > > - /* workarount for packed vqs which don't support mrg_rxbuf at this point */ > - if (vtpci_packed_queue(hw) && vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) { > - eth_dev->rx_pkt_burst = &virtio_recv_pkts_packed; > - } else if (hw->use_simple_rx) { > + if (hw->use_simple_rx) { > PMD_INIT_LOG(INFO, "virtio: using simple Rx path on port %u", > eth_dev->data->port_id); > eth_dev->rx_pkt_burst = virtio_recv_pkts_vec; > } else if (vtpci_packed_queue(hw)) { > - eth_dev->rx_pkt_burst = &virtio_recv_pkts_packed; > + if (vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) > + eth_dev->rx_pkt_burst = &virtio_recv_mergeable_pkts; > + else > + eth_dev->rx_pkt_burst = &virtio_recv_pkts_packed; > } else if (vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) { > PMD_INIT_LOG(INFO, > "virtio: using mergeable buffer Rx path on port %u", > diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c > index 9220ae661..a48ca6aaa 100644 > --- a/drivers/net/virtio/virtio_rxtx.c > +++ b/drivers/net/virtio/virtio_rxtx.c > @@ -155,8 +155,8 @@ vq_ring_free_chain(struct virtqueue *vq, uint16_t desc_idx) > vq->vq_free_cnt = (uint16_t)(vq->vq_free_cnt + dxp->ndescs); > if ((dp->flags & VRING_DESC_F_INDIRECT) == 0) { > while (dp->flags & VRING_DESC_F_NEXT) { > - desc_idx_last = dp->next; > - dp = &vq->vq_ring.desc[dp->next]; > + desc_idx_last = desc_idx++; > + dp = &vq->vq_ring.desc[desc_idx]; Are you sure this change is in the right patch? > } > } > dxp->ndescs = 0; > @@ -177,6 +177,76 @@ vq_ring_free_chain(struct virtqueue *vq, uint16_t desc_idx) > dp->next = VQ_RING_DESC_CHAIN_END; > } >