DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: "Yang, Zhiyong" <zhiyong.yang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] bus/pci: fix wrong intr_handle.type with uio_pci_generic
Date: Thu, 28 Dec 2017 11:49:13 +0100	[thread overview]
Message-ID: <6678594.XHcc9ld5bA@xps> (raw)
In-Reply-To: <E182254E98A5DA4EB1E657AC7CB9BD2A8B01C7E5@BGSMSX101.gar.corp.intel.com>

28/12/2017 10:37, Yang, Zhiyong:
> Hi Thomas,
> 
> > -----Original Message-----
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > Sent: Thursday, December 28, 2017 5:05 PM
> > To: Yang, Zhiyong <zhiyong.yang@intel.com>
> > Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; stable@dpdk.org
> > Subject: Re: [PATCH] bus/pci: fix wrong intr_handle.type with uio_pci_generic
> > 
> > 28/12/2017 07:12, Zhiyong Yang:
> > > In the function rte_pci_ioport_map, if uio_pci_generic is used on X86
> > > platform, pci_ioport_map() is invoked, the operation
> > > ev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN; is execused directly,
> > > it causes the wrong assignment for uio_pci_generic, the patch fixes it.
> > [...]
> > > --- a/drivers/bus/pci/linux/pci.c
> > > +++ b/drivers/bus/pci/linux/pci.c
> > > @@ -723,7 +723,9 @@ pci_ioport_map(struct rte_pci_device *dev, int bar
> > __rte_unused,
> > >  	if (!found)
> > >  		return -1;
> > >
> > > -	dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
> > > +	if (dev->kdrv == RTE_KDRV_NONE)
> > > +		dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
> > 
> > I don't understand the logic.
> > NONE is different of UNKNOWN.
> > 
> > Your are talking about uio_pci_generic. In this case, it should be
> > RTE_KDRV_UIO_GENERIC.
> 
> If we use uio_pci_generic,  dev->intr_handle.type has already been assigned to
> The right value RTE_INTR_HANDLE_UIO_INTX before it, but in the function pci_ioport_map
> the wrong value is assigned to dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
> Two cases both call pci_ioport_map  on x86 platform.
> one is RTE_KDRV_UIO_GENERIC
> the other is RTE_KDRV_NONE 
> if I understand right, for uio_generic, it should not be assigned to RTE_INTR_HANDLE_UNKNOWN;
> This case has already the right value, don't need to assign again. 
> The original code should be considered to handle RTE_KDRV_NONE case only.

OK thanks for the explanation.
I had overlooked your patch.

Please, could add some of this text in v2?
I think it is good to explain that the right value is already set,
and we must avoid overwriting the default "UNKNOWN" value.

One more question, why is it needed to set the value to "UNKNOWN" in this
function? It should already be set to this value (0) at init.

  reply	other threads:[~2017-12-28 10:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28  6:12 Zhiyong Yang
2017-12-28  9:05 ` Thomas Monjalon
2017-12-28  9:37   ` Yang, Zhiyong
2017-12-28 10:49     ` Thomas Monjalon [this message]
2017-12-29  2:10       ` Yang, Zhiyong
2017-12-29  7:55 ` [dpdk-dev] [PATCH v2] " Zhiyong Yang
2017-12-29 11:07   ` Thomas Monjalon
2017-12-30 14:19     ` Yang, Zhiyong
2018-01-03  3:29     ` Yang, Zhiyong
2018-01-09 15:34       ` Thomas Monjalon
2018-01-10  1:28         ` Yang, Zhiyong
2018-01-10  2:32   ` [dpdk-dev] [PATCH v3] " Zhiyong Yang
2018-01-12  0:04     ` 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=6678594.XHcc9ld5bA@xps \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stable@dpdk.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).