* [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt
@ 2017-07-19 3:18 Jiayu Hu
2017-07-19 3:23 ` Yang, Zhiyong
` (3 more replies)
0 siblings, 4 replies; 10+ 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] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt
2017-07-19 3:18 [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt Jiayu Hu
@ 2017-07-19 3:23 ` Yang, Zhiyong
2017-07-19 11:08 ` Yuanhan Liu
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ 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] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt
2017-07-19 3:18 [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt Jiayu Hu
2017-07-19 3:23 ` 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-dev] [PATCH v2] " Jiayu Hu
3 siblings, 1 reply; 10+ 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] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt
2017-07-19 11:08 ` Yuanhan Liu
@ 2017-07-19 16:03 ` Tan, Jianfeng
0 siblings, 0 replies; 10+ 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] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt
2017-07-19 3:18 [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt Jiayu Hu
2017-07-19 3:23 ` Yang, Zhiyong
2017-07-19 11:08 ` Yuanhan Liu
@ 2017-07-31 2:30 ` Yuanhan Liu
[not found] ` <ED946F0BEFE0A141B63BABBD629A2A9B38787115@shsmsx102.ccr.corp.intel.com>
2017-07-31 7:56 ` [dpdk-dev] [PATCH v2] " Jiayu Hu
3 siblings, 1 reply; 10+ 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] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt
[not found] ` <ED946F0BEFE0A141B63BABBD629A2A9B38787115@shsmsx102.ccr.corp.intel.com>
@ 2017-07-31 3:47 ` Yuanhan Liu
2017-07-31 7:28 ` Hu, Jiayu
0 siblings, 1 reply; 10+ messages in thread
From: Yuanhan Liu @ 2017-07-31 3:47 UTC (permalink / raw)
To: Hu, Jiayu; +Cc: Tan, Jianfeng, dev
On Mon, Jul 31, 2017 at 02:47:13AM +0000, Hu, Jiayu wrote:
> Hi Yuanhan,
>
> When we run l3fwd-power in VM with applying this patch in VM DPDK, QEMU will crash. I think this patch can't solve the problem correctly but I haven't figured out the reason. I am so sorry about it.
It's okay. But you should reply earlier here, so that I would not apply it.
Regarding the crash, I believe Jianfeng had met a similar issue before. IIRC,
it's about the order of event fd setups (or something like it). You might
want to contact him for more details.
And it's dropped.
--yliu
> > -----Original Message-----
> > From: Yuanhan Liu [mailto:yliu@fridaylinux.org]
> > Sent: Monday, July 31, 2017 10:30
> > To: Hu, Jiayu <jiayu.hu@intel.com>
> > Cc: dev@dpdk.org; Tan, Jianfeng <jianfeng.tan@intel.com>; Yao, Lei A
> > <lei.a.yao@intel.com>; stable@dpdk.org
> > Subject: Re: [PATCH] net/virtio: fix fail to configure rxq interrupt
> >
> > 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] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt
2017-07-31 3:47 ` Yuanhan Liu
@ 2017-07-31 7:28 ` Hu, Jiayu
0 siblings, 0 replies; 10+ messages in thread
From: Hu, Jiayu @ 2017-07-31 7:28 UTC (permalink / raw)
To: Yuanhan Liu; +Cc: Tan, Jianfeng, dev
Hi Yuanhan,
> -----Original Message-----
> From: Yuanhan Liu [mailto:yliu@fridaylinux.org]
> Sent: Monday, July 31, 2017 11:47 AM
> To: Hu, Jiayu <jiayu.hu@intel.com>
> Cc: Tan, Jianfeng <jianfeng.tan@intel.com>; dev@dpdk.org
> Subject: Re: [PATCH] net/virtio: fix fail to configure rxq interrupt
>
> On Mon, Jul 31, 2017 at 02:47:13AM +0000, Hu, Jiayu wrote:
> > Hi Yuanhan,
> >
> > When we run l3fwd-power in VM with applying this patch in VM DPDK,
> QEMU will crash. I think this patch can't solve the problem correctly but I
> haven't figured out the reason. I am so sorry about it.
>
> It's okay. But you should reply earlier here, so that I would not apply it.
>
> Regarding the crash, I believe Jianfeng had met a similar issue before. IIRC,
> it's about the order of event fd setups (or something like it). You might
> want to contact him for more details.
The root cause is that the interrupt should be set up before DRIVER_OK
is sent to QEMU. Otherwise, QEMU will crash.
The simplest way to enable RXQ interrupt after devices are initialized is to
re-init them via virtio_init_devices(), rather than to call virtio_configure_intr()
directly. This is also what Jianfeng does originally.
BRs,
Jiayu
>
> And it's dropped.
>
> --yliu
>
> > > -----Original Message-----
> > > From: Yuanhan Liu [mailto:yliu@fridaylinux.org]
> > > Sent: Monday, July 31, 2017 10:30
> > > To: Hu, Jiayu <jiayu.hu@intel.com>
> > > Cc: dev@dpdk.org; Tan, Jianfeng <jianfeng.tan@intel.com>; Yao, Lei A
> > > <lei.a.yao@intel.com>; stable@dpdk.org
> > > Subject: Re: [PATCH] net/virtio: fix fail to configure rxq interrupt
> > >
> > > 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] 10+ messages in thread
* [dpdk-dev] [PATCH v2] net/virtio: fix fail to configure rxq interrupt
2017-07-19 3:18 [dpdk-dev] [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 ` Maxime Coquelin
3 siblings, 1 reply; 10+ 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] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/virtio: fix fail to configure rxq interrupt
2017-07-31 7:56 ` [dpdk-dev] [PATCH v2] " Jiayu Hu
@ 2017-07-31 17:01 ` Maxime Coquelin
2017-07-31 17:17 ` Thomas Monjalon
0 siblings, 1 reply; 10+ 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] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/virtio: fix fail to configure rxq interrupt
2017-07-31 17:01 ` Maxime Coquelin
@ 2017-07-31 17:17 ` Thomas Monjalon
0 siblings, 0 replies; 10+ 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] 10+ messages in thread
end of thread, other threads:[~2017-07-31 17:17 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-19 3:18 [dpdk-dev] [PATCH] net/virtio: fix fail to configure rxq interrupt Jiayu Hu
2017-07-19 3:23 ` Yang, Zhiyong
2017-07-19 11:08 ` Yuanhan Liu
2017-07-19 16:03 ` Tan, Jianfeng
2017-07-31 2:30 ` Yuanhan Liu
[not found] ` <ED946F0BEFE0A141B63BABBD629A2A9B38787115@shsmsx102.ccr.corp.intel.com>
2017-07-31 3:47 ` Yuanhan Liu
2017-07-31 7:28 ` Hu, Jiayu
2017-07-31 7:56 ` [dpdk-dev] [PATCH v2] " Jiayu Hu
2017-07-31 17:01 ` 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).