From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7B5C3402291E; Fri, 6 Apr 2018 10:05:05 +0000 (UTC) Received: from [10.36.112.46] (ovpn-112-46.ams2.redhat.com [10.36.112.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DEE262166BAE; Fri, 6 Apr 2018 10:05:03 +0000 (UTC) To: Jens Freimann , dev@dpdk.org Cc: tiwei.bie@intel.com, yliu@fridaylinux.org, mst@redhat.com References: <20180405101031.26468-1-jfreimann@redhat.com> <20180405101031.26468-19-jfreimann@redhat.com> From: Maxime Coquelin Message-ID: <927d4379-cc6c-bb5b-3b55-15863c0879af@redhat.com> Date: Fri, 6 Apr 2018 12:05:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180405101031.26468-19-jfreimann@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 06 Apr 2018 10:05:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 06 Apr 2018 10:05:05 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH v3 18/21] net/virtio: add support for mergeable buffers with packed virtqueues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 10:05:06 -0000 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; > } >