blob: c26935684b6af96380ddb37d81df0011e8c4cfef [file] [log] [blame]
Pierre Pfister865d6ba2016-11-30 09:21:05 +00001From b002b56c0c8a1790549c23d93f3d57ffc212c6da Mon Sep 17 00:00:00 2001
2From: Pierre Pfister <ppfister@cisco.com>
3Date: Tue, 8 Nov 2016 10:24:48 +0100
4Subject: [PATCH] virtio: tx with can_push when VERSION_1 is set
5
6Current virtio driver advertises VERSION_1 support,
7but does not handle device's VERSION_1 support when
8sending packets (it looks for ANY_LAYOUT feature,
9which is absent).
10
11This patch enables 'can_push' in tx path when VERSION_1
12is advertised by the device.
13
14This significantly improves small packets forwarding rate
15towards devices advertising VERSION_1 feature.
16
17Signed-off-by: Pierre Pfister <ppfister@cisco.com>
18---
19 drivers/net/virtio/virtio_rxtx.c | 3 ++-
20 1 file changed, 2 insertions(+), 1 deletion(-)
21
22diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
23index 22d97a4..1e5a6b9 100644
24--- a/drivers/net/virtio/virtio_rxtx.c
25+++ b/drivers/net/virtio/virtio_rxtx.c
26@@ -1015,7 +1015,8 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
27 }
28
29 /* optimize ring usage */
30- if (vtpci_with_feature(hw, VIRTIO_F_ANY_LAYOUT) &&
31+ if ((vtpci_with_feature(hw, VIRTIO_F_ANY_LAYOUT) ||
32+ vtpci_with_feature(hw, VIRTIO_F_VERSION_1)) &&
33 rte_mbuf_refcnt_read(txm) == 1 &&
34 RTE_MBUF_DIRECT(txm) &&
35 txm->nb_segs == 1 &&
36--
372.7.4 (Apple Git-66)
38