patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/virtio: fix fail to configure rxq interrupt
@ 2017-07-19  3:18 Jiayu Hu
  2017-07-19  3:23 ` [dpdk-stable] [dpdk-dev] " Yang, Zhiyong
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Jiayu Hu @ 2017-07-19  3:18 UTC (permalink / raw)
  To: dev; +Cc: jianfeng.tan, yliu, lei.a.yao, Jiayu Hu, stable

When use rte_eth_dev_configure() to enable rx queue interrupt for virtio
devices, virtio_configure_intr() isn't called to set up the interrupt
environment, which causes rx queue interrupt setup failed. This patch is
to fix this issue.

Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
Cc: stable@dpdk.org

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 00a3122..66656ed 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1688,6 +1688,13 @@ virtio_dev_configure(struct rte_eth_dev *dev)
 		return -ENOTSUP;
 	}
 
+	if (dev->data->dev_conf.intr_conf.rxq) {
+		if (virtio_configure_intr(dev) < 0) {
+			PMD_DRV_LOG(ERR, "failed to configure interrupt");
+			return -ENOTSUP;
+		}
+	}
+
 	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
 		/* Enable vector (0) for Link State Intrerrupt */
 		if (VTPCI_OPS(hw)->set_config_irq(hw, 0) ==
-- 
2.7.4

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt
  2017-07-19  3:18 [dpdk-stable] [PATCH] net/virtio: fix fail to configure rxq interrupt Jiayu Hu
@ 2017-07-19  3:23 ` Yang, Zhiyong
  2017-07-19 11:08 ` [dpdk-stable] " Yuanhan Liu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Yang, Zhiyong @ 2017-07-19  3:23 UTC (permalink / raw)
  To: Hu, Jiayu, dev; +Cc: Tan, Jianfeng, yliu, Yao, Lei A, Hu, Jiayu, stable



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jiayu Hu
> Sent: Wednesday, July 19, 2017 11:18 AM
> To: dev@dpdk.org
> Cc: Tan, Jianfeng <jianfeng.tan@intel.com>; yliu@fridaylinux.org; Yao, Lei A
> <lei.a.yao@intel.com>; Hu, Jiayu <jiayu.hu@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt
> 
> When use rte_eth_dev_configure() to enable rx queue interrupt for virtio devices,
> virtio_configure_intr() isn't called to set up the interrupt environment, which
> causes rx queue interrupt setup failed. This patch is to fix this issue.
> 
> Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Reviewed-by: Zhiyong Yang <zhiyong.yang@intel.com >

Thanks
Zhiyong

> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 00a3122..66656ed 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1688,6 +1688,13 @@ virtio_dev_configure(struct rte_eth_dev *dev)
>  		return -ENOTSUP;
>  	}
> 
> +	if (dev->data->dev_conf.intr_conf.rxq) {
> +		if (virtio_configure_intr(dev) < 0) {
> +			PMD_DRV_LOG(ERR, "failed to configure interrupt");
> +			return -ENOTSUP;
> +		}
> +	}
> +
>  	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
>  		/* Enable vector (0) for Link State Intrerrupt */
>  		if (VTPCI_OPS(hw)->set_config_irq(hw, 0) ==
> --
> 2.7.4

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

* Re: [dpdk-stable] [PATCH] net/virtio: fix fail to configure rxq interrupt
  2017-07-19  3:18 [dpdk-stable] [PATCH] net/virtio: fix fail to configure rxq interrupt Jiayu Hu
  2017-07-19  3:23 ` [dpdk-stable] [dpdk-dev] " Yang, Zhiyong
@ 2017-07-19 11:08 ` Yuanhan Liu
  2017-07-19 16:03   ` Tan, Jianfeng
  2017-07-31  2:30 ` Yuanhan Liu
  2017-07-31  7:56 ` [dpdk-stable] [PATCH v2] " Jiayu Hu
  3 siblings, 1 reply; 8+ messages in thread
From: Yuanhan Liu @ 2017-07-19 11:08 UTC (permalink / raw)
  To: Jiayu Hu, Tan, Jianfeng; +Cc: dev, lei.a.yao, stable

On Wed, Jul 19, 2017 at 11:18:23AM +0800, Jiayu Hu wrote:
> When use rte_eth_dev_configure() to enable rx queue interrupt for virtio
> devices, virtio_configure_intr() isn't called to set up the interrupt
> environment, which causes rx queue interrupt setup failed. This patch is
> to fix this issue.

Hmm, how was this supposed to work in the begining when this feature
was introduced? Jianfeng?

	--yliu


> 
> Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 00a3122..66656ed 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1688,6 +1688,13 @@ virtio_dev_configure(struct rte_eth_dev *dev)
>  		return -ENOTSUP;
>  	}
>  
> +	if (dev->data->dev_conf.intr_conf.rxq) {
> +		if (virtio_configure_intr(dev) < 0) {
> +			PMD_DRV_LOG(ERR, "failed to configure interrupt");
> +			return -ENOTSUP;
> +		}
> +	}
> +
>  	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
>  		/* Enable vector (0) for Link State Intrerrupt */
>  		if (VTPCI_OPS(hw)->set_config_irq(hw, 0) ==
> -- 
> 2.7.4

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

* Re: [dpdk-stable] [PATCH] net/virtio: fix fail to configure rxq interrupt
  2017-07-19 11:08 ` [dpdk-stable] " Yuanhan Liu
@ 2017-07-19 16:03   ` Tan, Jianfeng
  0 siblings, 0 replies; 8+ messages in thread
From: Tan, Jianfeng @ 2017-07-19 16:03 UTC (permalink / raw)
  To: Yuanhan Liu, Jiayu Hu; +Cc: dev, lei.a.yao, stable



On 7/19/2017 4:08 AM, Yuanhan Liu wrote:
> On Wed, Jul 19, 2017 at 11:18:23AM +0800, Jiayu Hu wrote:
>> When use rte_eth_dev_configure() to enable rx queue interrupt for virtio
>> devices, virtio_configure_intr() isn't called to set up the interrupt
>> environment, which causes rx queue interrupt setup failed. This patch is
>> to fix this issue.
> Hmm, how was this supposed to work in the begining when this feature
> was introduced? Jianfeng?

In the v17.05, virtio_configure_intr() will be called by 
virtio_dev_configure() if the request feature is changed. That's not 
correct.


>
> 	--yliu
>
>
>> Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
>> ---
>>   drivers/net/virtio/virtio_ethdev.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
>> index 00a3122..66656ed 100644
>> --- a/drivers/net/virtio/virtio_ethdev.c
>> +++ b/drivers/net/virtio/virtio_ethdev.c
>> @@ -1688,6 +1688,13 @@ virtio_dev_configure(struct rte_eth_dev *dev)
>>   		return -ENOTSUP;
>>   	}
>>   
>> +	if (dev->data->dev_conf.intr_conf.rxq) {
>> +		if (virtio_configure_intr(dev) < 0) {
>> +			PMD_DRV_LOG(ERR, "failed to configure interrupt");
>> +			return -ENOTSUP;
>> +		}
>> +	}
>> +

Hi Jiayu,

I would expect this will not work for virtio pci devices (QEMU might 
crash). Could you double check that?

Thanks,
Jianfeng

>>   	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
>>   		/* Enable vector (0) for Link State Intrerrupt */
>>   		if (VTPCI_OPS(hw)->set_config_irq(hw, 0) ==
>> -- 
>> 2.7.4

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

* Re: [dpdk-stable] [PATCH] net/virtio: fix fail to configure rxq interrupt
  2017-07-19  3:18 [dpdk-stable] [PATCH] net/virtio: fix fail to configure rxq interrupt Jiayu Hu
  2017-07-19  3:23 ` [dpdk-stable] [dpdk-dev] " Yang, Zhiyong
  2017-07-19 11:08 ` [dpdk-stable] " Yuanhan Liu
@ 2017-07-31  2:30 ` Yuanhan Liu
  2017-07-31  7:56 ` [dpdk-stable] [PATCH v2] " Jiayu Hu
  3 siblings, 0 replies; 8+ messages in thread
From: Yuanhan Liu @ 2017-07-31  2:30 UTC (permalink / raw)
  To: Jiayu Hu; +Cc: dev, jianfeng.tan, lei.a.yao, stable

On Wed, Jul 19, 2017 at 11:18:23AM +0800, Jiayu Hu wrote:
> When use rte_eth_dev_configure() to enable rx queue interrupt for virtio
> devices, virtio_configure_intr() isn't called to set up the interrupt
> environment, which causes rx queue interrupt setup failed. This patch is
> to fix this issue.
> 
> Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>

Applied to dpdk-next-virtio.

Thanks.

	--yliu

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

* [dpdk-stable] [PATCH v2] net/virtio: fix fail to configure rxq interrupt
  2017-07-19  3:18 [dpdk-stable] [PATCH] net/virtio: fix fail to configure rxq interrupt Jiayu Hu
                   ` (2 preceding siblings ...)
  2017-07-31  2:30 ` Yuanhan Liu
@ 2017-07-31  7:56 ` Jiayu Hu
  2017-07-31 17:01   ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
  3 siblings, 1 reply; 8+ messages in thread
From: Jiayu Hu @ 2017-07-31  7:56 UTC (permalink / raw)
  To: dev; +Cc: yliu, jianfeng.tan, lei.a.yao, Jiayu Hu, stable

When use rte_eth_dev_configure() to enable rx queue interrupt for virtio
devices, virtio_init_device() isn't called to set up the interrupt
environment, which causes rx queue interrupt setup failed. This patch is
to fix this issue.

Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
Cc: stable@dpdk.org

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
---
changes in v2:
- fix QEMU crash issue.

 drivers/net/virtio/virtio_ethdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 00a3122..e320811 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1659,9 +1659,16 @@ virtio_dev_configure(struct rte_eth_dev *dev)
 {
 	const struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
 	struct virtio_hw *hw = dev->data->dev_private;
+	int ret;
 
 	PMD_INIT_LOG(DEBUG, "configure");
 
+	if (dev->data->dev_conf.intr_conf.rxq) {
+		ret = virtio_init_device(dev, hw->req_guest_features);
+		if (ret < 0)
+			return ret;
+	}
+
 	/* Virtio does L4 checksum but not L3! */
 	if (rxmode->hw_ip_checksum) {
 		PMD_DRV_LOG(NOTICE,
-- 
2.7.4

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2] net/virtio: fix fail to configure rxq interrupt
  2017-07-31  7:56 ` [dpdk-stable] [PATCH v2] " Jiayu Hu
@ 2017-07-31 17:01   ` Maxime Coquelin
  2017-07-31 17:17     ` Thomas Monjalon
  0 siblings, 1 reply; 8+ messages in thread
From: Maxime Coquelin @ 2017-07-31 17:01 UTC (permalink / raw)
  To: Jiayu Hu, dev; +Cc: yliu, jianfeng.tan, lei.a.yao, stable



On 07/31/2017 09:56 AM, Jiayu Hu wrote:
> When use rte_eth_dev_configure() to enable rx queue interrupt for virtio
> devices, virtio_init_device() isn't called to set up the interrupt
> environment, which causes rx queue interrupt setup failed. This patch is
> to fix this issue.
> 
> Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
> ---
> changes in v2:
> - fix QEMU crash issue.
> 
>   drivers/net/virtio/virtio_ethdev.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 00a3122..e320811 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1659,9 +1659,16 @@ virtio_dev_configure(struct rte_eth_dev *dev)
>   {
>   	const struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
>   	struct virtio_hw *hw = dev->data->dev_private;
> +	int ret;
>   
>   	PMD_INIT_LOG(DEBUG, "configure");
>   
> +	if (dev->data->dev_conf.intr_conf.rxq) {
> +		ret = virtio_init_device(dev, hw->req_guest_features);
> +		if (ret < 0)
> +			return ret;
> +	}
> +
>   	/* Virtio does L4 checksum but not L3! */
>   	if (rxmode->hw_ip_checksum) {
>   		PMD_DRV_LOG(NOTICE,
> 

Looking at v1's discussions, it seems to be the right fix.
I haven't tried it myself, but it looks good to me:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2] net/virtio: fix fail to configure rxq interrupt
  2017-07-31 17:01   ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
@ 2017-07-31 17:17     ` Thomas Monjalon
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2017-07-31 17:17 UTC (permalink / raw)
  To: Jiayu Hu; +Cc: dev, Maxime Coquelin, yliu, jianfeng.tan, lei.a.yao, stable

31/07/2017 19:01, Maxime Coquelin:
> On 07/31/2017 09:56 AM, Jiayu Hu wrote:
> > When use rte_eth_dev_configure() to enable rx queue interrupt for virtio
> > devices, virtio_init_device() isn't called to set up the interrupt
> > environment, which causes rx queue interrupt setup failed. This patch is
> > to fix this issue.
> > 
> > Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
> 
> Looking at v1's discussions, it seems to be the right fix.
> I haven't tried it myself, but it looks good to me:
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Applied, thanks

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

end of thread, other threads:[~2017-07-31 17:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-19  3:18 [dpdk-stable] [PATCH] net/virtio: fix fail to configure rxq interrupt Jiayu Hu
2017-07-19  3:23 ` [dpdk-stable] [dpdk-dev] " Yang, Zhiyong
2017-07-19 11:08 ` [dpdk-stable] " Yuanhan Liu
2017-07-19 16:03   ` Tan, Jianfeng
2017-07-31  2:30 ` Yuanhan Liu
2017-07-31  7:56 ` [dpdk-stable] [PATCH v2] " Jiayu Hu
2017-07-31 17:01   ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
2017-07-31 17:17     ` Thomas Monjalon

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