DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio-user: send kick to tx queue to notify backend on initialization
@ 2017-08-01 16:17 Steven
  2017-08-03  9:37 ` Maxime Coquelin
  2017-09-12  2:30 ` Yuanhan Liu
  0 siblings, 2 replies; 5+ messages in thread
From: Steven @ 2017-08-01 16:17 UTC (permalink / raw)
  To: yliu, maxime.coquelin; +Cc: dev

Acccording to the spec, https://fossies.org/linux/qemu/docs/specs/vhost-user.txt

client must start ring upon receiving a kick (that is, detecting that file
descriptor is reachable) on the descriptor specified by
VHOST_USER_SET_VRING_KICK.

The code sends a kick to the rx queue. It is missing sending a kick for the
tx queue. This patch is to add the missing code to comply with the spec.

Signed-off-by: Steven <sluong@cisco.com>
---
 drivers/net/virtio/virtio_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 00a3122..6362e14 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1747,6 +1747,11 @@ virtio_dev_start(struct rte_eth_dev *dev)
 		virtqueue_notify(rxvq->vq);
 	}
 
+	for (i = 0; i < dev->data->nb_tx_queues; i++) {
+		txvq = dev->data->tx_queues[i];
+		virtqueue_notify(txvq->vq);
+	}
+
 	PMD_INIT_LOG(DEBUG, "Notified backend at initialization");
 
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
-- 
2.10.1 (Apple Git-78)

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

* Re: [dpdk-dev] [PATCH] net/virtio-user: send kick to tx queue to notify backend on initialization
  2017-08-01 16:17 [dpdk-dev] [PATCH] net/virtio-user: send kick to tx queue to notify backend on initialization Steven
@ 2017-08-03  9:37 ` Maxime Coquelin
  2017-08-03 14:12   ` Steven Luong (sluong)
  2017-09-12  2:30 ` Yuanhan Liu
  1 sibling, 1 reply; 5+ messages in thread
From: Maxime Coquelin @ 2017-08-03  9:37 UTC (permalink / raw)
  To: Steven, yliu; +Cc: dev

Hi Steven,

On 08/01/2017 06:17 PM, Steven wrote:
> Acccording to the spec, https://fossies.org/linux/qemu/docs/specs/vhost-user.txt
> 
> client must start ring upon receiving a kick (that is, detecting that file
> descriptor is reachable) on the descriptor specified by
> VHOST_USER_SET_VRING_KICK.
> 
> The code sends a kick to the rx queue. It is missing sending a kick for the
> tx queue. This patch is to add the missing code to comply with the spec.
> 
> Signed-off-by: Steven <sluong@cisco.com>
> ---
>   drivers/net/virtio/virtio_ethdev.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 00a3122..6362e14 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1747,6 +1747,11 @@ virtio_dev_start(struct rte_eth_dev *dev)
>   		virtqueue_notify(rxvq->vq);
>   	}
>   
> +	for (i = 0; i < dev->data->nb_tx_queues; i++) {
> +		txvq = dev->data->tx_queues[i];
> +		virtqueue_notify(txvq->vq);
> +	}
> +

I'm not sure to get why we would need to send Txq notification whereas
no packet have been enqueued. That said, I don't think it hurts.

Steven, does it solve a real problem you are facing with virtio-user?

Yuanhan, what's your opinion on this?

Cheers,
Maxime

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

* Re: [dpdk-dev] [PATCH] net/virtio-user: send kick to tx queue to notify backend on initialization
  2017-08-03  9:37 ` Maxime Coquelin
@ 2017-08-03 14:12   ` Steven Luong (sluong)
  2017-09-11 14:29     ` Steven Luong (sluong)
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Luong (sluong) @ 2017-08-03 14:12 UTC (permalink / raw)
  To: Maxime Coquelin, yliu; +Cc: dev

Maxime,

Thank you so much for the reply.

1. It’s about conforming to the spec. Please read the text as I quoted in the email. A non-conforming implementation does not communicate with a conforming implementation such as VPP.
2. QEMU’s implementation is conforming and it is sending kick for both TX and RX queues upon initialization.

Steven

On 8/3/17, 2:37 AM, "dev on behalf of Maxime Coquelin" <dev-bounces@dpdk.org on behalf of maxime.coquelin@redhat.com> wrote:

    Hi Steven,
    
    On 08/01/2017 06:17 PM, Steven wrote:
    > Acccording to the spec, https://fossies.org/linux/qemu/docs/specs/vhost-user.txt
    > 
    > client must start ring upon receiving a kick (that is, detecting that file
    > descriptor is reachable) on the descriptor specified by
    > VHOST_USER_SET_VRING_KICK.
    > 
    > The code sends a kick to the rx queue. It is missing sending a kick for the
    > tx queue. This patch is to add the missing code to comply with the spec.
    > 
    > Signed-off-by: Steven <sluong@cisco.com>
    > ---
    >   drivers/net/virtio/virtio_ethdev.c | 5 +++++
    >   1 file changed, 5 insertions(+)
    > 
    > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
    > index 00a3122..6362e14 100644
    > --- a/drivers/net/virtio/virtio_ethdev.c
    > +++ b/drivers/net/virtio/virtio_ethdev.c
    > @@ -1747,6 +1747,11 @@ virtio_dev_start(struct rte_eth_dev *dev)
    >   		virtqueue_notify(rxvq->vq);
    >   	}
    >   
    > +	for (i = 0; i < dev->data->nb_tx_queues; i++) {
    > +		txvq = dev->data->tx_queues[i];
    > +		virtqueue_notify(txvq->vq);
    > +	}
    > +
    
    I'm not sure to get why we would need to send Txq notification whereas
    no packet have been enqueued. That said, I don't think it hurts.
    
    Steven, does it solve a real problem you are facing with virtio-user?
    
    Yuanhan, what's your opinion on this?
    
    Cheers,
    Maxime
    


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

* Re: [dpdk-dev] [PATCH] net/virtio-user: send kick to tx queue to notify backend on initialization
  2017-08-03 14:12   ` Steven Luong (sluong)
@ 2017-09-11 14:29     ` Steven Luong (sluong)
  0 siblings, 0 replies; 5+ messages in thread
From: Steven Luong (sluong) @ 2017-09-11 14:29 UTC (permalink / raw)
  To: Maxime Coquelin, yliu; +Cc: dev

Dear Maxime and Yuanhan,

Do you have any more question on this patch? According to the text in the spec, the vring/queue is supposed to be disable until a kick is received. This is to ensure that the kickfd is working properly prior to the operation and I think it makes sense. The only exception to this rule is when the driver opts out for the interrupt support (no kickfd) in VHOST_USER_SET_VRING_KICK message.

Steven

On 8/3/17, 7:12 AM, "dev on behalf of Steven Luong (sluong)" <dev-bounces@dpdk.org on behalf of sluong@cisco.com> wrote:

    Maxime,
    
    Thank you so much for the reply.
    
    1. It’s about conforming to the spec. Please read the text as I quoted in the email. A non-conforming implementation does not communicate with a conforming implementation such as VPP.
    2. QEMU’s implementation is conforming and it is sending kick for both TX and RX queues upon initialization.
    
    Steven
    
    On 8/3/17, 2:37 AM, "dev on behalf of Maxime Coquelin" <dev-bounces@dpdk.org on behalf of maxime.coquelin@redhat.com> wrote:
    
        Hi Steven,
        
        On 08/01/2017 06:17 PM, Steven wrote:
        > Acccording to the spec, https://fossies.org/linux/qemu/docs/specs/vhost-user.txt
        > 
        > client must start ring upon receiving a kick (that is, detecting that file
        > descriptor is reachable) on the descriptor specified by
        > VHOST_USER_SET_VRING_KICK.
        > 
        > The code sends a kick to the rx queue. It is missing sending a kick for the
        > tx queue. This patch is to add the missing code to comply with the spec.
        > 
        > Signed-off-by: Steven <sluong@cisco.com>
        > ---
        >   drivers/net/virtio/virtio_ethdev.c | 5 +++++
        >   1 file changed, 5 insertions(+)
        > 
        > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
        > index 00a3122..6362e14 100644
        > --- a/drivers/net/virtio/virtio_ethdev.c
        > +++ b/drivers/net/virtio/virtio_ethdev.c
        > @@ -1747,6 +1747,11 @@ virtio_dev_start(struct rte_eth_dev *dev)
        >   		virtqueue_notify(rxvq->vq);
        >   	}
        >   
        > +	for (i = 0; i < dev->data->nb_tx_queues; i++) {
        > +		txvq = dev->data->tx_queues[i];
        > +		virtqueue_notify(txvq->vq);
        > +	}
        > +
        
        I'm not sure to get why we would need to send Txq notification whereas
        no packet have been enqueued. That said, I don't think it hurts.
        
        Steven, does it solve a real problem you are facing with virtio-user?
        
        Yuanhan, what's your opinion on this?
        
        Cheers,
        Maxime
        
    
    


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

* Re: [dpdk-dev] [PATCH] net/virtio-user: send kick to tx queue to notify backend on initialization
  2017-08-01 16:17 [dpdk-dev] [PATCH] net/virtio-user: send kick to tx queue to notify backend on initialization Steven
  2017-08-03  9:37 ` Maxime Coquelin
@ 2017-09-12  2:30 ` Yuanhan Liu
  1 sibling, 0 replies; 5+ messages in thread
From: Yuanhan Liu @ 2017-09-12  2:30 UTC (permalink / raw)
  To: Steven; +Cc: maxime.coquelin, dev

On Tue, Aug 01, 2017 at 09:17:36AM -0700, Steven wrote:
> Acccording to the spec, https://fossies.org/linux/qemu/docs/specs/vhost-user.txt
> 
> client must start ring upon receiving a kick (that is, detecting that file
> descriptor is reachable) on the descriptor specified by
> VHOST_USER_SET_VRING_KICK.
> 
> The code sends a kick to the rx queue. It is missing sending a kick for the
> tx queue. This patch is to add the missing code to comply with the spec.
> 
> Signed-off-by: Steven <sluong@cisco.com>

Applied to dpdk-next-virtio.

Thanks.

	--yliu

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

end of thread, other threads:[~2017-09-12  2:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-01 16:17 [dpdk-dev] [PATCH] net/virtio-user: send kick to tx queue to notify backend on initialization Steven
2017-08-03  9:37 ` Maxime Coquelin
2017-08-03 14:12   ` Steven Luong (sluong)
2017-09-11 14:29     ` Steven Luong (sluong)
2017-09-12  2:30 ` Yuanhan Liu

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