DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	"Xie, Huawei" <huawei.xie@intel.com>,
	"yuanhan.liu@linux.intel.com" <yuanhan.liu@linux.intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH resend] virtio: fix link state regression
Date: Fri, 4 Dec 2015 16:18:36 +0000	[thread overview]
Message-ID: <8CEF83825BEC744B83065625E567D7C219F8D6B6@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1449244766-29031-1-git-send-email-stephen@networkplumber.org>

Hi Stephen,


> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Friday, December 4, 2015 3:59 PM
> To: Xie, Huawei <huawei.xie@intel.com>; yuanhan.liu@linux.intel.com;
> Iremonger, Bernard <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org; Stephen Hemminger <stephen@networkplumber.org>
> Subject: [PATCH resend] virtio: fix link state regression
> 
> Support for link state interrupt was broken on virtio by
> 
> commit bda66c418c85 ("ethdev: add device fields from PCI layer")
> 
> This is caused because the actual value of drv_flags is not set until after the
> resource_init has figured out whether it is using UIO or direct I/O
> instructions.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> ---
> 
> There maybe other drivers with the same problem. It would have been
> better to move the structure elements (and break ABI) rather than assume it
> safe to copy them.
> 
>  drivers/net/virtio/virtio_ethdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c
> b/drivers/net/virtio/virtio_ethdev.c
> index 74c00ee..8e12804 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1289,11 +1289,11 @@ eth_virtio_dev_init(struct rte_eth_dev
> *eth_dev)
> 
>  	pci_dev = eth_dev->pci_dev;
> 
> -	rte_eth_copy_pci_info(eth_dev, pci_dev);
> -
>  	if (virtio_resource_init(pci_dev) < 0)
>  		return -1;
> 
> +	rte_eth_copy_pci_info(eth_dev, pci_dev);
> +
>  	hw->use_msix = virtio_has_msix(&pci_dev->addr);
>  	hw->io_base = (uint32_t)(uintptr_t)pci_dev-
> >mem_resource[0].addr;
> 
> --
> 2.1.4

I think the call to rte_eth_copy_pci_info() needs to be a bit later.
After the following code:
	/* If host does not support status then disable LSC */
	if (!vtpci_with_feature(hw, VIRTIO_NET_F_STATUS))
		pci_dev->driver->drv_flags &= ~RTE_PCI_DRV_INTR_LSC;

I have submitted a patch for this earlier today

http://dpdk.org/dev/patchwork/patch/9345/

Regards,

Bernard.

      reply	other threads:[~2015-12-04 16:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 15:59 Stephen Hemminger
2015-12-04 16:18 ` Iremonger, Bernard [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=8CEF83825BEC744B83065625E567D7C219F8D6B6@IRSMSX108.ger.corp.intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=huawei.xie@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=yuanhan.liu@linux.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).