Pierre Pfister | 865d6ba | 2016-11-30 09:21:05 +0000 | [diff] [blame^] | 1 | From b002b56c0c8a1790549c23d93f3d57ffc212c6da Mon Sep 17 00:00:00 2001 |
| 2 | From: Pierre Pfister <ppfister@cisco.com> |
| 3 | Date: Tue, 8 Nov 2016 10:24:48 +0100 |
| 4 | Subject: [PATCH] virtio: tx with can_push when VERSION_1 is set |
| 5 | |
| 6 | Current virtio driver advertises VERSION_1 support, |
| 7 | but does not handle device's VERSION_1 support when |
| 8 | sending packets (it looks for ANY_LAYOUT feature, |
| 9 | which is absent). |
| 10 | |
| 11 | This patch enables 'can_push' in tx path when VERSION_1 |
| 12 | is advertised by the device. |
| 13 | |
| 14 | This significantly improves small packets forwarding rate |
| 15 | towards devices advertising VERSION_1 feature. |
| 16 | |
| 17 | Signed-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 | |
| 22 | diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c |
| 23 | index 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 | -- |
| 37 | 2.7.4 (Apple Git-66) |
| 38 | |