DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: "Yang, Zhiyong" <zhiyong.yang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "yliu@fridaylinux.org" <yliu@fridaylinux.org>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v2] net/virtio: fix rxq intr config fails using vfio-pci
Date: Thu, 9 Nov 2017 11:31:56 +0800	[thread overview]
Message-ID: <aab0432e-6126-bf1a-0417-1e0b559d6b1d@intel.com> (raw)
In-Reply-To: <E182254E98A5DA4EB1E657AC7CB9BD2A8B003770@BGSMSX101.gar.corp.intel.com>



On 11/9/2017 10:11 AM, Yang, Zhiyong wrote:
> Hi Jianfeng,
>
>> -----Original Message-----
>> From: Tan, Jianfeng
>> Sent: Wednesday, November 8, 2017 9:53 PM
>> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org
>> Cc: yliu@fridaylinux.org; maxime.coquelin@redhat.com
>> Subject: Re: [PATCH v2] net/virtio: fix rxq intr config fails using vfio-pci
>>
>>
>> Hi Zhiyong,
>>
>>
>> On 11/8/2017 7:03 PM, Zhiyong Yang wrote:
>>> When running l3fwd-power to test virtio rxq interrupt using vfio pci
>>> noiommu mode, startup fails. In the function virtio_read_caps, the
>>> code if (flags & PCI_MSIX_ENABLE) intends to double check if vfio msix
>>> is enabled or not. However, it is not enable at that stage. So
>>> use_msix is assigned to "0", not "1", which causes the failure of
>>> configuring rxq intr in l3fwd-power.
>>> This patch adds the function vtpci_msix_detect to detect the status of
>>> msix when interrupt changes happen.
>>> In the meanwhile, virtio_intr_enable/disable are introduced to wrap
>>> rte_intr_enable/disable to enhance the ability to detect msix. Only
>>> support and enable msix can assign "1" to use_msix.
>> Should be "2". Better to use macro here.
>>
>>> Fixes: cb482cb3a305 ("net/virtio: fix MAC address read")
>>> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
>>> ---
>>> @@ -1370,7 +1411,15 @@ virtio_init_device(struct rte_eth_dev *eth_dev,
>> uint64_t req_features)
>>>    	struct virtio_net_config local_config;
>>>    	struct rte_pci_device *pci_dev = NULL;
>>>    	int ret;
>>> +	int msix_detect;
>>>
>>> +	msix_detect = vtpci_msix_detect(RTE_ETH_DEV_TO_PCI(eth_dev));
>>> +	if (msix_detect < 0)
>>> +		return -1;
>>> +	else if (msix_detect == SUPPORT_MSIX_STATUS_ENABLED)
>>> +		hw->use_msix = 1;
>>> +	else
>>> +		hw->use_msix = 0;
>> Ditto, we directly assign return value to hw->use_msix.
>>
> The function call can be removed if use_misx  can use 0, 1, 2 directly
> We can implement the same logic  in  virtio_read_caps instead.

Actually, I prefer not hide such an assignment in this function name 
"*_detect".


> Thanks
> Zhiyong
>

  reply	other threads:[~2017-11-09  3:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31  9:44 [dpdk-dev] [PATCH] net/virtio: fix use_msix get the wrong value Zhiyong Yang
2017-11-01 15:40 ` Yuanhan Liu
2017-11-02  1:46   ` Yang, Zhiyong
2017-11-02  3:36 ` Tan, Jianfeng
2017-11-08 11:03 ` [dpdk-dev] [PATCH v2] net/virtio: fix rxq intr config fails using vfio-pci Zhiyong Yang
2017-11-08 13:52   ` Tan, Jianfeng
2017-11-09  1:28     ` Yang, Zhiyong
2017-11-09  2:11     ` Yang, Zhiyong
2017-11-09  3:31       ` Tan, Jianfeng [this message]
2017-11-09  3:18   ` [dpdk-dev] [PATCH v3] " Zhiyong Yang
2017-11-09  3:47     ` Tan, Jianfeng
2017-11-09  4:01       ` Yang, Zhiyong
2017-11-09  4:40         ` Tan, Jianfeng
2017-11-09  4:46     ` [dpdk-dev] [PATCH v4] " Zhiyong Yang
2017-11-09  6:51       ` Tan, Jianfeng
2017-11-09  8:18       ` Maxime Coquelin
2017-11-09  8:55       ` [dpdk-dev] [PATCH v5] " Zhiyong Yang
2017-11-09  9:08         ` Maxime Coquelin
2017-11-09  9:16           ` Yang, Zhiyong
2017-11-09  9:21         ` [dpdk-dev] [PATCH v6] " Zhiyong Yang
2017-11-11 14:34           ` Thomas Monjalon

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=aab0432e-6126-bf1a-0417-1e0b559d6b1d@intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=yliu@fridaylinux.org \
    --cc=zhiyong.yang@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).