DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] virtio: check mbuf is direct when using any layout
@ 2016-05-09 16:19 Olivier Matz
  2016-05-23 13:52 ` Yuanhan Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Olivier Matz @ 2016-05-09 16:19 UTC (permalink / raw)
  To: dev, yuanhan.liu, huawei.xie, stephen

The commit dd856dfcb9e74 introduced an optimization that prepends virtio
header to mbuf data. It can be used when the tx mbuf is writeable, so we
need to check that the mbuf is direct (i.e. it embeds its own data).

Fixes: dd856dfcb9e74 "virtio: use any layout on Tx"

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 drivers/net/virtio/virtio_rxtx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index ef21d8e..ae28634 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -886,6 +886,7 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		/* optimize ring usage */
 		if (vtpci_with_feature(hw, VIRTIO_F_ANY_LAYOUT) &&
 		    rte_mbuf_refcnt_read(txm) == 1 &&
+		    RTE_MBUF_DIRECT(txm) &&
 		    txm->nb_segs == 1 &&
 		    rte_pktmbuf_headroom(txm) >= hdr_size &&
 		    rte_is_aligned(rte_pktmbuf_mtod(txm, char *),
-- 
2.8.0.rc3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] virtio: check mbuf is direct when using any layout
  2016-05-09 16:19 [dpdk-dev] [PATCH] virtio: check mbuf is direct when using any layout Olivier Matz
@ 2016-05-23 13:52 ` Yuanhan Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Yuanhan Liu @ 2016-05-23 13:52 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, huawei.xie, stephen

On Mon, May 09, 2016 at 06:19:35PM +0200, Olivier Matz wrote:
> The commit dd856dfcb9e74 introduced an optimization that prepends virtio
> header to mbuf data. It can be used when the tx mbuf is writeable, so we
> need to check that the mbuf is direct (i.e. it embeds its own data).
> 
> Fixes: dd856dfcb9e74 "virtio: use any layout on Tx"

Missing "()" here. Fixed and applied to dpdk-next-virtio.

Thanks.

	--yliu

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-23 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-09 16:19 [dpdk-dev] [PATCH] virtio: check mbuf is direct when using any layout Olivier Matz
2016-05-23 13:52 ` Yuanhan Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).