DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: "Tan, Jianfeng" <jianfeng.tan@intel.com>
Cc: David Marchand <david.marchand@6wind.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Xie, Huawei" <huawei.xie@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2] virtio: fix modify drv_flags for specific device
Date: Mon, 9 May 2016 11:01:26 -0700	[thread overview]
Message-ID: <20160509180126.GB5641@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <ED26CBA2FAD1BF48A8719AEF02201E36032E206C@SHSMSX103.ccr.corp.intel.com>

On Mon, May 09, 2016 at 09:14:41AM +0000, Tan, Jianfeng wrote:
>     When two virtio devices have different flags, it may lead to wrong
>     result. Then some unexpected behaviors happen, such as virtio would
>     set irq config when it's not supported.

Yes, that's the issue; and that's exactly something I was looking for in
a commit log.

Patch is applied to dpdk-next-virtio, with following changes:

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 1864186..995618a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1076,11 +1076,6 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
 		dev_flags &= ~RTE_ETH_DEV_INTR_LSC;
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	/* For virtio devices, dev_flags are decided according to feature
-	 * negotiation, aka if VIRTIO_NET_F_STATUS is set, and which kernel
-	 * driver is used, dynamically. And we should keep drv_flags shared
-	 * and unvaried.
-	 */
 	eth_dev->data->dev_flags = dev_flags;
 
 	rx_func_get(eth_dev);
---

Without this patch as the context, mentioning "drv_flags" here confuses
people.

And FYI, I made folloiwng commit log rewords.

Thanks.

	--yliu

 ---
 virtio: fix overwritten drv_flags

 The "drv_flags" is set with device as the input, which means different
 device (say, modern vs legacy) could end up with a different value. And
 the fact that "drv_flags" is shared by all devices means that every time
 we add a new device, it simply overwrites the value configured from the
 last device.

 Therefore, when two virtio devices have different flags, it may lead to
 wrong result, such as virtio would set irq config when it's not supported.

 Making the flag per device (using "dev->data->dev_flags") could let us
 have different value for each device, which would avoid the above issue.

      reply	other threads:[~2016-05-09 17:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26  2:24 [dpdk-dev] [PATCH] " Jianfeng Tan
2016-04-26 11:53 ` David Marchand
2016-04-27  5:10   ` Tan, Jianfeng
2016-04-27  5:20     ` David Marchand
2016-04-28 18:08 ` [dpdk-dev] [PATCH v2] " Jianfeng Tan
2016-05-02 17:55   ` Yuanhan Liu
2016-05-03  8:05   ` David Marchand
2016-05-04 23:18     ` Yuanhan Liu
2016-05-09  9:14       ` Tan, Jianfeng
2016-05-09 18:01         ` Yuanhan Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160509180126.GB5641@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    --cc=huawei.xie@intel.com \
    --cc=jianfeng.tan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).