From: Pierre Pfister Date: Wed, 30 Nov 2016 09:18:42 +0000 (+0000) Subject: net/virtio: use any layout for version 1.0 X-Git-Tag: spdx-start~5178 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9edfedf5e45e3e35c13438c73c9903d07c8237c9;p=dpdk.git net/virtio: use any layout for version 1.0 Current virtio driver advertises VERSION_1 support, but does not handle device's VERSION_1 support when sending packets (it looks for ANY_LAYOUT feature, which is absent). This patch enables 'can_push' in tx path when VERSION_1 is advertised by the device. This significantly improves small packets forwarding rate towards devices advertising VERSION_1 feature. Signed-off-by: Pierre Pfister Acked-by: Yuanhan Liu --- diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 22d97a4ea5..1e5a6b932d 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -1015,7 +1015,8 @@ 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) && + if ((vtpci_with_feature(hw, VIRTIO_F_ANY_LAYOUT) || + vtpci_with_feature(hw, VIRTIO_F_VERSION_1)) && rte_mbuf_refcnt_read(txm) == 1 && RTE_MBUF_DIRECT(txm) && txm->nb_segs == 1 &&