* [dpdk-dev] [PATCH 0/3] Some fixes and doc updates for virtio-user
@ 2018-09-21 12:52 Tiwei Bie
2018-09-21 12:52 ` [dpdk-dev] [PATCH 1/3] net/virtio-user: fix multiple queue for vhost-kernel Tiwei Bie
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Tiwei Bie @ 2018-09-21 12:52 UTC (permalink / raw)
To: maxime.coquelin, zhihong.wang, dev
This series consists of some fixes and doc updates for virtio-user.
Tiwei Bie (3):
net/virtio-user: fix multiple queue for vhost-kernel
net/virtio: add the missing supported features
doc: update the doc for virtio-user
doc/guides/contributing/documentation.rst | 4 ++--
.../howto/virtio_user_as_exceptional_path.rst | 23 +++++++++++--------
.../virtio_user_for_container_networking.rst | 2 +-
drivers/net/virtio/virtio_ethdev.h | 5 +++-
.../net/virtio/virtio_user/virtio_user_dev.c | 4 +---
5 files changed, 21 insertions(+), 17 deletions(-)
--
2.18.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH 1/3] net/virtio-user: fix multiple queue for vhost-kernel
2018-09-21 12:52 [dpdk-dev] [PATCH 0/3] Some fixes and doc updates for virtio-user Tiwei Bie
@ 2018-09-21 12:52 ` Tiwei Bie
2018-09-27 11:47 ` Maxime Coquelin
2018-09-21 12:52 ` [dpdk-dev] [PATCH 2/3] net/virtio: add the missing supported features Tiwei Bie
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Tiwei Bie @ 2018-09-21 12:52 UTC (permalink / raw)
To: maxime.coquelin, zhihong.wang, dev; +Cc: stable
The multiple queue support in vhost-kernel is broken because
the dev->vhostfd is only available for vhost-user. We should
always try to enable queue pairs when it's not in server mode.
Fixes: 201a41651715 ("net/virtio-user: fix multiple queues fail in server mode")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
drivers/net/virtio/virtio_user/virtio_user_dev.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 869e96f87..55a82e4b0 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -549,13 +549,11 @@ virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs)
/* Server mode can't enable queue pairs if vhostfd is invalid,
* always return 0 in this case.
*/
- if (dev->vhostfd >= 0) {
+ if (!dev->is_server || dev->vhostfd >= 0) {
for (i = 0; i < q_pairs; ++i)
ret |= dev->ops->enable_qp(dev, i, 1);
for (i = q_pairs; i < dev->max_queue_pairs; ++i)
ret |= dev->ops->enable_qp(dev, i, 0);
- } else if (!dev->is_server) {
- ret = ~0;
}
dev->queue_pairs = q_pairs;
--
2.18.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH 2/3] net/virtio: add the missing supported features
2018-09-21 12:52 [dpdk-dev] [PATCH 0/3] Some fixes and doc updates for virtio-user Tiwei Bie
2018-09-21 12:52 ` [dpdk-dev] [PATCH 1/3] net/virtio-user: fix multiple queue for vhost-kernel Tiwei Bie
@ 2018-09-21 12:52 ` Tiwei Bie
2018-09-27 11:49 ` Maxime Coquelin
2018-09-21 12:52 ` [dpdk-dev] [PATCH 3/3] doc: update the doc for virtio-user Tiwei Bie
2018-09-27 12:18 ` [dpdk-dev] [PATCH 0/3] Some fixes and doc updates " Maxime Coquelin
3 siblings, 1 reply; 8+ messages in thread
From: Tiwei Bie @ 2018-09-21 12:52 UTC (permalink / raw)
To: maxime.coquelin, zhihong.wang, dev; +Cc: stable
The virtio features VIRTIO_NET_F_CSUM, VIRTIO_NET_F_HOST_TSO4
and VIRTIO_NET_F_HOST_TSO6 are supported by the virtio PMD.
But they are missing in the supported feature set. And since
below commit:
commit 4174a7b59d05 ("net/virtio: improve Tx offload features negotiation")
Virtio PMD will announce the Tx offloading capabilities based
on the features read from the device. And virtio-user won't
report the features which are not in virtio-PMD's supported
feature set. So since that commit, virtio-user won't announce
the DEV_TX_OFFLOAD_UDP_CKSUM, DEV_TX_OFFLOAD_TCP_CKSUM and
DEV_TX_OFFLOAD_TCP_TSO offloading capabilities even if the
vhost backend supports them.
This patch adds these missing features, and virtio-user will
report them if the backend supports them.
Fixes: 142678d42959 ("net/virtio-user: fix wrongly get/set features")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
drivers/net/virtio/virtio_ethdev.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
index b726ad108..e0f80e5a4 100644
--- a/drivers/net/virtio/virtio_ethdev.h
+++ b/drivers/net/virtio/virtio_ethdev.h
@@ -40,7 +40,10 @@
(VIRTIO_PMD_DEFAULT_GUEST_FEATURES | \
1u << VIRTIO_NET_F_GUEST_CSUM | \
1u << VIRTIO_NET_F_GUEST_TSO4 | \
- 1u << VIRTIO_NET_F_GUEST_TSO6)
+ 1u << VIRTIO_NET_F_GUEST_TSO6 | \
+ 1u << VIRTIO_NET_F_CSUM | \
+ 1u << VIRTIO_NET_F_HOST_TSO4 | \
+ 1u << VIRTIO_NET_F_HOST_TSO6)
/*
* CQ function prototype
--
2.18.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH 3/3] doc: update the doc for virtio-user
2018-09-21 12:52 [dpdk-dev] [PATCH 0/3] Some fixes and doc updates for virtio-user Tiwei Bie
2018-09-21 12:52 ` [dpdk-dev] [PATCH 1/3] net/virtio-user: fix multiple queue for vhost-kernel Tiwei Bie
2018-09-21 12:52 ` [dpdk-dev] [PATCH 2/3] net/virtio: add the missing supported features Tiwei Bie
@ 2018-09-21 12:52 ` Tiwei Bie
2018-09-27 11:53 ` Maxime Coquelin
2018-09-27 12:18 ` [dpdk-dev] [PATCH 0/3] Some fixes and doc updates " Maxime Coquelin
3 siblings, 1 reply; 8+ messages in thread
From: Tiwei Bie @ 2018-09-21 12:52 UTC (permalink / raw)
To: maxime.coquelin, zhihong.wang, dev
Update the doc for virtio-user to use the latest testpmd
parameters and commands.
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
doc/guides/contributing/documentation.rst | 4 ++--
.../howto/virtio_user_as_exceptional_path.rst | 23 +++++++++++--------
.../virtio_user_for_container_networking.rst | 2 +-
3 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
index 6a075553d..097575ad7 100644
--- a/doc/guides/contributing/documentation.rst
+++ b/doc/guides/contributing/documentation.rst
@@ -297,8 +297,8 @@ Line Length
testpmd -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
- -- -i --txqflags=0x0 --enable-hw-vlan --enable-lro \
- --enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 --txd=1024
+ -- -i --tx-offloads=0x0000002c --enable-lro --txq=2 --rxq=2 \
+ --txd=1024 --rxd=1024
Whitespace
diff --git a/doc/guides/howto/virtio_user_as_exceptional_path.rst b/doc/guides/howto/virtio_user_as_exceptional_path.rst
index 6a13c761e..4910c12df 100644
--- a/doc/guides/howto/virtio_user_as_exceptional_path.rst
+++ b/doc/guides/howto/virtio_user_as_exceptional_path.rst
@@ -57,8 +57,8 @@ compiling the kernel and those kernel modules should be inserted.
$(testpmd) -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queue_size=1024 \
- -- -i --txqflags=0x0 --enable-lro \
- --enable-rx-cksum --rxd=1024 --txd=1024
+ -- -i --tx-offloads=0x0000002c --enable-lro \
+ --txd=1024 --rxd=1024
This command runs testpmd with two ports, one physical NIC to communicate
with outside, and one virtio-user to communicate with kernel.
@@ -69,11 +69,6 @@ compiling the kernel and those kernel modules should be inserted.
VIRTIO_NET_F_GUEST_TSO6 feature so that large packets from kernel can be
transmitted to DPDK application and further TSOed by physical NIC.
-* ``--enable-rx-cksum``
-
- This is used to negotiate VIRTIO_NET_F_GUEST_CSUM so that packets from
- kernel can be deemed as valid Rx checksumed.
-
* ``queue_size``
256 by default. To avoid shortage of descriptors, we can increase it to 1024.
@@ -86,9 +81,17 @@ compiling the kernel and those kernel modules should be inserted.
$(testpmd) -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
- -- -i --txqflags=0x0 --enable-lro \
- --enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 \
- --txd=1024
+ -- -i --tx-offloads=0x0000002c --enable-lro \
+ --txq=2 --rxq=2 --txd=1024 --rxd=1024
+
+#. Enable Rx checksum offloads in testpmd:
+
+ .. code-block:: console
+
+ (testpmd) port stop 0
+ (testpmd) port config 0 rx_offload tcp_cksum on
+ (testpmd) port config 0 rx_offload udp_cksum on
+ (testpmd) port start 0
#. Start testpmd:
diff --git a/doc/guides/howto/virtio_user_for_container_networking.rst b/doc/guides/howto/virtio_user_for_container_networking.rst
index 476ce3a63..2313dc794 100644
--- a/doc/guides/howto/virtio_user_for_container_networking.rst
+++ b/doc/guides/howto/virtio_user_for_container_networking.rst
@@ -96,7 +96,7 @@ some minor changes.
dpdk-app-testpmd testpmd -l 6-7 -n 4 -m 1024 --no-pci \
--vdev=virtio_user0,path=/var/run/usvhost \
--file-prefix=container \
- -- -i --txqflags=0xf00 --disable-hw-vlan
+ -- -i
Note: If we run all above setup on the host, it's a shm-based IPC.
--
2.18.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 1/3] net/virtio-user: fix multiple queue for vhost-kernel
2018-09-21 12:52 ` [dpdk-dev] [PATCH 1/3] net/virtio-user: fix multiple queue for vhost-kernel Tiwei Bie
@ 2018-09-27 11:47 ` Maxime Coquelin
0 siblings, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2018-09-27 11:47 UTC (permalink / raw)
To: Tiwei Bie, zhihong.wang, dev; +Cc: stable
On 09/21/2018 02:52 PM, Tiwei Bie wrote:
> The multiple queue support in vhost-kernel is broken because
> the dev->vhostfd is only available for vhost-user. We should
> always try to enable queue pairs when it's not in server mode.
>
> Fixes: 201a41651715 ("net/virtio-user: fix multiple queues fail in server mode")
> Cc: stable@dpdk.org
>
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
> drivers/net/virtio/virtio_user/virtio_user_dev.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 2/3] net/virtio: add the missing supported features
2018-09-21 12:52 ` [dpdk-dev] [PATCH 2/3] net/virtio: add the missing supported features Tiwei Bie
@ 2018-09-27 11:49 ` Maxime Coquelin
0 siblings, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2018-09-27 11:49 UTC (permalink / raw)
To: Tiwei Bie, zhihong.wang, dev; +Cc: stable
On 09/21/2018 02:52 PM, Tiwei Bie wrote:
> The virtio features VIRTIO_NET_F_CSUM, VIRTIO_NET_F_HOST_TSO4
> and VIRTIO_NET_F_HOST_TSO6 are supported by the virtio PMD.
> But they are missing in the supported feature set. And since
> below commit:
>
> commit 4174a7b59d05 ("net/virtio: improve Tx offload features negotiation")
>
> Virtio PMD will announce the Tx offloading capabilities based
> on the features read from the device. And virtio-user won't
> report the features which are not in virtio-PMD's supported
> feature set. So since that commit, virtio-user won't announce
> the DEV_TX_OFFLOAD_UDP_CKSUM, DEV_TX_OFFLOAD_TCP_CKSUM and
> DEV_TX_OFFLOAD_TCP_TSO offloading capabilities even if the
> vhost backend supports them.
>
> This patch adds these missing features, and virtio-user will
> report them if the backend supports them.
>
> Fixes: 142678d42959 ("net/virtio-user: fix wrongly get/set features")
> Cc: stable@dpdk.org
>
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
> drivers/net/virtio/virtio_ethdev.h | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 3/3] doc: update the doc for virtio-user
2018-09-21 12:52 ` [dpdk-dev] [PATCH 3/3] doc: update the doc for virtio-user Tiwei Bie
@ 2018-09-27 11:53 ` Maxime Coquelin
0 siblings, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2018-09-27 11:53 UTC (permalink / raw)
To: Tiwei Bie, zhihong.wang, dev
On 09/21/2018 02:52 PM, Tiwei Bie wrote:
> Update the doc for virtio-user to use the latest testpmd
> parameters and commands.
>
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
> doc/guides/contributing/documentation.rst | 4 ++--
> .../howto/virtio_user_as_exceptional_path.rst | 23 +++++++++++--------
> .../virtio_user_for_container_networking.rst | 2 +-
> 3 files changed, 16 insertions(+), 13 deletions(-)
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks!
Maxime
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 0/3] Some fixes and doc updates for virtio-user
2018-09-21 12:52 [dpdk-dev] [PATCH 0/3] Some fixes and doc updates for virtio-user Tiwei Bie
` (2 preceding siblings ...)
2018-09-21 12:52 ` [dpdk-dev] [PATCH 3/3] doc: update the doc for virtio-user Tiwei Bie
@ 2018-09-27 12:18 ` Maxime Coquelin
3 siblings, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2018-09-27 12:18 UTC (permalink / raw)
To: Tiwei Bie, zhihong.wang, dev
On 09/21/2018 02:52 PM, Tiwei Bie wrote:
> This series consists of some fixes and doc updates for virtio-user.
>
>
> Tiwei Bie (3):
> net/virtio-user: fix multiple queue for vhost-kernel
> net/virtio: add the missing supported features
> doc: update the doc for virtio-user
>
> doc/guides/contributing/documentation.rst | 4 ++--
> .../howto/virtio_user_as_exceptional_path.rst | 23 +++++++++++--------
> .../virtio_user_for_container_networking.rst | 2 +-
> drivers/net/virtio/virtio_ethdev.h | 5 +++-
> .../net/virtio/virtio_user/virtio_user_dev.c | 4 +---
> 5 files changed, 21 insertions(+), 17 deletions(-)
>
Applied to dpdk-next-virtio/master.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-09-27 12:18 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-21 12:52 [dpdk-dev] [PATCH 0/3] Some fixes and doc updates for virtio-user Tiwei Bie
2018-09-21 12:52 ` [dpdk-dev] [PATCH 1/3] net/virtio-user: fix multiple queue for vhost-kernel Tiwei Bie
2018-09-27 11:47 ` Maxime Coquelin
2018-09-21 12:52 ` [dpdk-dev] [PATCH 2/3] net/virtio: add the missing supported features Tiwei Bie
2018-09-27 11:49 ` Maxime Coquelin
2018-09-21 12:52 ` [dpdk-dev] [PATCH 3/3] doc: update the doc for virtio-user Tiwei Bie
2018-09-27 11:53 ` Maxime Coquelin
2018-09-27 12:18 ` [dpdk-dev] [PATCH 0/3] Some fixes and doc updates " Maxime Coquelin
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).