DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] net/virtio: fix vector Rx break caused by rxq flushing
@ 2017-12-29 13:02 王志克
  2017-12-30  4:02 ` Tiwei Bie
  0 siblings, 1 reply; 4+ messages in thread
From: 王志克 @ 2017-12-29 13:02 UTC (permalink / raw)
  To: tiwei.bie, dev

Hi tiwei,

Can you please provide a patch for 16.11.4? Thanks.

Br,
Wang Zhike

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

* Re: [dpdk-dev] net/virtio: fix vector Rx break caused by rxq flushing
  2017-12-29 13:02 [dpdk-dev] net/virtio: fix vector Rx break caused by rxq flushing 王志克
@ 2017-12-30  4:02 ` Tiwei Bie
  2018-01-03  8:21   ` 王志克
  0 siblings, 1 reply; 4+ messages in thread
From: Tiwei Bie @ 2017-12-30  4:02 UTC (permalink / raw)
  To: 王志克; +Cc: dev, bluca, yliu

Hi Zhike,

On Fri, Dec 29, 2017 at 01:02:04PM +0000, 王志克 wrote:
> Hi tiwei,
> 
> Can you please provide a patch for 16.11.4? Thanks.
> 

Normally, most commits in the stable tree are backported
from the commits in the mainline tree which contains below
Cc line:

Cc: stable@dpdk.org

This patch also contains such line. So after this patch
is applied to the mainline tree, it will be backported.

If you need the fix right now, you can download the latest
patch (which has been applied to dpdk-next-virtio tree)
from here:

https://dpdk.org/dev/patchwork/patch/32061/

It can be applied to DPDK 16.11.4 with the patch command.
After the patching, one small change is needed to get it
work:

diff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c
index 7fd8604..0e24194 100644
--- a/drivers/net/virtio/virtqueue.c
+++ b/drivers/net/virtio/virtqueue.c
@@ -88,7 +88,7 @@ virtqueue_rxvq_flush(struct virtqueue *vq)
 	for (i = 0; i < nb_used; i++) {
 		used_idx = vq->vq_used_cons_idx & (vq->vq_nentries - 1);
 		uep = &vq->vq_ring.used->ring[used_idx];
-		if (hw->use_simple_rx) {
+		if (hw->use_simple_rxtx) {
 			desc_idx = used_idx;
 			rte_pktmbuf_free(vq->sw_ring[desc_idx]);
 			vq->vq_free_cnt++;
@@ -104,7 +104,7 @@ virtqueue_rxvq_flush(struct virtqueue *vq)
 		vq->vq_used_cons_idx++;
 	}
 
-	if (hw->use_simple_rx) {
+	if (hw->use_simple_rxtx) {
 		while (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) {
 			virtio_rxq_rearm_vec(rxq);
 			if (virtqueue_kick_prepare(vq))

Besides, I'm not sure whether you are aware of this or not.
But just FYI, when you want to use the vector Rx of virtio
PMD, you need to be aware of the fact that the current
implementation of vector Rx doesn't really follow the virtio
spec. You can find more details in below link:

http://dpdk.org/ml/archives/dev/2017-December/084101.html

Best regards,
Tiwei Bie

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

* Re: [dpdk-dev] net/virtio: fix vector Rx break caused by rxq flushing
  2017-12-30  4:02 ` Tiwei Bie
@ 2018-01-03  8:21   ` 王志克
  2018-01-03 11:14     ` Tiwei Bie
  0 siblings, 1 reply; 4+ messages in thread
From: 王志克 @ 2018-01-03  8:21 UTC (permalink / raw)
  To: Tiwei Bie; +Cc: dev, bluca, yliu

Hi Tiwei,

Thanks for your help and info.

I have another question about your previous fix below.
You mentioned that " Otherwise it will lead to incorrect packet collection for port state." Do you mean port statistics? Or such packets may leads to issue, like more TCP restransmission? Thanks.


commit d8227497ec5c3de75fe378e09fc9673ae097fa73
Author: Tiwei Bie <tiwei.bie@intel.com>
Date:   Fri Oct 20 10:09:28 2017 +0800

    net/virtio: flush Rx queues on start

    After starting a device, the driver shouldn't deliver the
    packets that already existed before the device is started
    to applications. Otherwise it will lead to incorrect packet
    collection for port state. This patch fixes this issue by
    flushing the Rx queues when starting the device.


Br,
Wang Zhike
-----Original Message-----
From: Tiwei Bie [mailto:tiwei.bie@intel.com] 
Sent: Saturday, December 30, 2017 12:02 PM
To: 王志克
Cc: dev@dpdk.org; bluca@debian.org; yliu@fridaylinux.org
Subject: Re: net/virtio: fix vector Rx break caused by rxq flushing

Hi Zhike,

On Fri, Dec 29, 2017 at 01:02:04PM +0000, 王志克 wrote:
> Hi tiwei,
> 
> Can you please provide a patch for 16.11.4? Thanks.
> 

Normally, most commits in the stable tree are backported
from the commits in the mainline tree which contains below
Cc line:

Cc: stable@dpdk.org

This patch also contains such line. So after this patch
is applied to the mainline tree, it will be backported.

If you need the fix right now, you can download the latest
patch (which has been applied to dpdk-next-virtio tree)
from here:

https://dpdk.org/dev/patchwork/patch/32061/

It can be applied to DPDK 16.11.4 with the patch command.
After the patching, one small change is needed to get it
work:

diff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c
index 7fd8604..0e24194 100644
--- a/drivers/net/virtio/virtqueue.c
+++ b/drivers/net/virtio/virtqueue.c
@@ -88,7 +88,7 @@ virtqueue_rxvq_flush(struct virtqueue *vq)
 	for (i = 0; i < nb_used; i++) {
 		used_idx = vq->vq_used_cons_idx & (vq->vq_nentries - 1);
 		uep = &vq->vq_ring.used->ring[used_idx];
-		if (hw->use_simple_rx) {
+		if (hw->use_simple_rxtx) {
 			desc_idx = used_idx;
 			rte_pktmbuf_free(vq->sw_ring[desc_idx]);
 			vq->vq_free_cnt++;
@@ -104,7 +104,7 @@ virtqueue_rxvq_flush(struct virtqueue *vq)
 		vq->vq_used_cons_idx++;
 	}
 
-	if (hw->use_simple_rx) {
+	if (hw->use_simple_rxtx) {
 		while (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) {
 			virtio_rxq_rearm_vec(rxq);
 			if (virtqueue_kick_prepare(vq))

Besides, I'm not sure whether you are aware of this or not.
But just FYI, when you want to use the vector Rx of virtio
PMD, you need to be aware of the fact that the current
implementation of vector Rx doesn't really follow the virtio
spec. You can find more details in below link:

http://dpdk.org/ml/archives/dev/2017-December/084101.html

Best regards,
Tiwei Bie

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

* Re: [dpdk-dev] net/virtio: fix vector Rx break caused by rxq flushing
  2018-01-03  8:21   ` 王志克
@ 2018-01-03 11:14     ` Tiwei Bie
  0 siblings, 0 replies; 4+ messages in thread
From: Tiwei Bie @ 2018-01-03 11:14 UTC (permalink / raw)
  To: 王志克; +Cc: dev, bluca, yliu

Hi Zhike,

On Wed, Jan 03, 2018 at 08:21:26AM +0000, 王志克 wrote:
> Hi Tiwei,
> 
> Thanks for your help and info.
> 
> I have another question about your previous fix below.
> You mentioned that " Otherwise it will lead to incorrect packet collection for port state." Do you mean port statistics? Or such packets may leads to issue, like more TCP restransmission? Thanks.
> 

I was just repeating the problem description from another
team who raised the issue. The unexpected behavior caused
some problems when they use virtio PMD. But I don't know
the details of the problems they met. :(

Best regards,
Tiwei Bie

> 
> commit d8227497ec5c3de75fe378e09fc9673ae097fa73
> Author: Tiwei Bie <tiwei.bie@intel.com>
> Date:   Fri Oct 20 10:09:28 2017 +0800
> 
>     net/virtio: flush Rx queues on start
> 
>     After starting a device, the driver shouldn't deliver the
>     packets that already existed before the device is started
>     to applications. Otherwise it will lead to incorrect packet
>     collection for port state. This patch fixes this issue by
>     flushing the Rx queues when starting the device.
> 
> 
> Br,
> Wang Zhike
> -----Original Message-----
> From: Tiwei Bie [mailto:tiwei.bie@intel.com] 
> Sent: Saturday, December 30, 2017 12:02 PM
> To: 王志克
> Cc: dev@dpdk.org; bluca@debian.org; yliu@fridaylinux.org
> Subject: Re: net/virtio: fix vector Rx break caused by rxq flushing
> 
> Hi Zhike,
> 
> On Fri, Dec 29, 2017 at 01:02:04PM +0000, 王志克 wrote:
> > Hi tiwei,
> > 
> > Can you please provide a patch for 16.11.4? Thanks.
> > 
> 
> Normally, most commits in the stable tree are backported
> from the commits in the mainline tree which contains below
> Cc line:
> 
> Cc: stable@dpdk.org
> 
> This patch also contains such line. So after this patch
> is applied to the mainline tree, it will be backported.
> 
> If you need the fix right now, you can download the latest
> patch (which has been applied to dpdk-next-virtio tree)
> from here:
> 
> https://dpdk.org/dev/patchwork/patch/32061/
> 
> It can be applied to DPDK 16.11.4 with the patch command.
> After the patching, one small change is needed to get it
> work:
> 
> diff --git a/drivers/net/virtio/virtqueue.c b/drivers/net/virtio/virtqueue.c
> index 7fd8604..0e24194 100644
> --- a/drivers/net/virtio/virtqueue.c
> +++ b/drivers/net/virtio/virtqueue.c
> @@ -88,7 +88,7 @@ virtqueue_rxvq_flush(struct virtqueue *vq)
>  	for (i = 0; i < nb_used; i++) {
>  		used_idx = vq->vq_used_cons_idx & (vq->vq_nentries - 1);
>  		uep = &vq->vq_ring.used->ring[used_idx];
> -		if (hw->use_simple_rx) {
> +		if (hw->use_simple_rxtx) {
>  			desc_idx = used_idx;
>  			rte_pktmbuf_free(vq->sw_ring[desc_idx]);
>  			vq->vq_free_cnt++;
> @@ -104,7 +104,7 @@ virtqueue_rxvq_flush(struct virtqueue *vq)
>  		vq->vq_used_cons_idx++;
>  	}
>  
> -	if (hw->use_simple_rx) {
> +	if (hw->use_simple_rxtx) {
>  		while (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) {
>  			virtio_rxq_rearm_vec(rxq);
>  			if (virtqueue_kick_prepare(vq))
> 
> Besides, I'm not sure whether you are aware of this or not.
> But just FYI, when you want to use the vector Rx of virtio
> PMD, you need to be aware of the fact that the current
> implementation of vector Rx doesn't really follow the virtio
> spec. You can find more details in below link:
> 
> http://dpdk.org/ml/archives/dev/2017-December/084101.html
> 
> Best regards,
> Tiwei Bie

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

end of thread, other threads:[~2018-01-03 11:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-29 13:02 [dpdk-dev] net/virtio: fix vector Rx break caused by rxq flushing 王志克
2017-12-30  4:02 ` Tiwei Bie
2018-01-03  8:21   ` 王志克
2018-01-03 11:14     ` Tiwei Bie

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).