patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Xu, Rosen" <rosen.xu@intel.com>,
	"Zhang, Tianfei" <tianfei.zhang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>, "Huang, Wei" <wei.huang@intel.com>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2 1/4] raw/ifpga/base: fix bug in IRQ	functions
Date: Thu, 15 Oct 2020 13:14:44 +0000	[thread overview]
Message-ID: <c72fd57d61064272be36199d388215a9@intel.com> (raw)
In-Reply-To: <BYAPR11MB2901067A55F7A01846A7E16489320@BYAPR11MB2901.namprd11.prod.outlook.com>



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Xu, Rosen
> Sent: Tuesday, September 29, 2020 9:42 AM
> To: Zhang, Tianfei <tianfei.zhang@intel.com>; dev@dpdk.org; Huang, Wei
> <wei.huang@intel.com>
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 1/4] raw/ifpga/base: fix bug in IRQ functions
> 
> Hi,
> 
> > -----Original Message-----
> > From: Zhang, Tianfei <tianfei.zhang@intel.com>
> > Sent: Monday, September 28, 2020 9:40
> > To: dev@dpdk.org; Xu, Rosen <rosen.xu@intel.com>; Huang, Wei
> > <wei.huang@intel.com>
> > Cc: stable@dpdk.org; Zhang, Tianfei <tianfei.zhang@intel.com>
> > Subject: [PATCH v2 1/4] raw/ifpga/base: fix bug in IRQ functions
> >
> > From: Wei Huang <wei.huang@intel.com>
> >
> > Using a pointer instead of using a structure and point to
> > ifpga_irq_handle[] in register and unregister interrupt functions.
> > Treat positive return value of ifpga_unregister_msix_irq() as successful.
> >
> > Fixes: e0a1aafe ("raw/ifpga: introduce IRQ functions")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Wei Huang <wei.huang@intel.com>
> > Signed-off-by: Tianfei zhang <tianfei.zhang@intel.com>
> > ---
> > v2: fix typo in commit log
> > ---
> >  drivers/raw/ifpga/ifpga_rawdev.c | 41
> > ++++++++++++++++++--------------
> >  1 file changed, 23 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/raw/ifpga/ifpga_rawdev.c
> > b/drivers/raw/ifpga/ifpga_rawdev.c
> > index a50173264..374a7ff1d 100644
> > --- a/drivers/raw/ifpga/ifpga_rawdev.c
> > +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> > @@ -1337,17 +1337,18 @@ int
> >  ifpga_unregister_msix_irq(enum ifpga_irq_type type,
> >  		int vec_start, rte_intr_callback_fn handler, void *arg)  {
> > -	struct rte_intr_handle intr_handle;
> > +	struct rte_intr_handle *intr_handle;
> >
> >  	if (type == IFPGA_FME_IRQ)
> > -		intr_handle = ifpga_irq_handle[0];
> > +		intr_handle = &ifpga_irq_handle[0];
> >  	else if (type == IFPGA_AFU_IRQ)
> > -		intr_handle = ifpga_irq_handle[vec_start + 1];
> > +		intr_handle = &ifpga_irq_handle[vec_start + 1];
> > +	else
> > +		return 0;
> >
> > -	rte_intr_efd_disable(&intr_handle);
> > +	rte_intr_efd_disable(intr_handle);
> >
> > -	return rte_intr_callback_unregister(&intr_handle,
> > -			handler, arg);
> > +	return rte_intr_callback_unregister(intr_handle, handler, arg);
> >  }
> >
> >  int
> > @@ -1357,7 +1358,7 @@ ifpga_register_msix_irq(struct rte_rawdev *dev,
> > int port_id,
> >  		void *arg)
> >  {
> >  	int ret;
> > -	struct rte_intr_handle intr_handle;
> > +	struct rte_intr_handle *intr_handle;
> >  	struct opae_adapter *adapter;
> >  	struct opae_manager *mgr;
> >  	struct opae_accelerator *acc;
> > @@ -1371,26 +1372,29 @@ ifpga_register_msix_irq(struct rte_rawdev
> > *dev, int port_id,
> >  		return -ENODEV;
> >
> >  	if (type == IFPGA_FME_IRQ) {
> > -		intr_handle = ifpga_irq_handle[0];
> > +		intr_handle = &ifpga_irq_handle[0];
> >  		count = 1;
> > -	} else if (type == IFPGA_AFU_IRQ)
> > -		intr_handle = ifpga_irq_handle[vec_start + 1];
> > +	} else if (type == IFPGA_AFU_IRQ) {
> > +		intr_handle = &ifpga_irq_handle[vec_start + 1];
> > +	} else {
> > +		return -EINVAL;
> > +	}
> >
> > -	intr_handle.type = RTE_INTR_HANDLE_VFIO_MSIX;
> > +	intr_handle->type = RTE_INTR_HANDLE_VFIO_MSIX;
> >
> > -	ret = rte_intr_efd_enable(&intr_handle, count);
> > +	ret = rte_intr_efd_enable(intr_handle, count);
> >  	if (ret)
> >  		return -ENODEV;
> >
> > -	intr_handle.fd = intr_handle.efds[0];
> > +	intr_handle->fd = intr_handle->efds[0];
> >
> >  	IFPGA_RAWDEV_PMD_DEBUG("register %s irq, vfio_fd=%d, fd=%d\n",
> > -			name, intr_handle.vfio_dev_fd,
> > -			intr_handle.fd);
> > +			name, intr_handle->vfio_dev_fd,
> > +			intr_handle->fd);
> >
> >  	if (type == IFPGA_FME_IRQ) {
> >  		struct fpga_fme_err_irq_set err_irq_set;
> > -		err_irq_set.evtfd = intr_handle.efds[0];
> > +		err_irq_set.evtfd = intr_handle->efds[0];
> >
> >  		ret = opae_manager_ifpga_set_err_irq(mgr, &err_irq_set);
> >  		if (ret)
> > @@ -1400,13 +1404,14 @@ ifpga_register_msix_irq(struct rte_rawdev
> > *dev, int port_id,
> >  		if (!acc)
> >  			return -EINVAL;
> >
> > -		ret = opae_acc_set_irq(acc, vec_start, count,
> > intr_handle.efds);
> > +		ret = opae_acc_set_irq(acc, vec_start, count,
> > +				intr_handle->efds);
> >  		if (ret)
> >  			return -EINVAL;
> >  	}
> >
> >  	/* register interrupt handler using DPDK API */
> > -	ret = rte_intr_callback_register(&intr_handle,
> > +	ret = rte_intr_callback_register(intr_handle,
> >  			handler, (void *)arg);
> >  	if (ret)
> >  		return -EINVAL;
> > --
> > 2.17.1
> 
> Acked-by: Rosen Xu <rosen.xu@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

  parent reply	other threads:[~2020-10-15 13:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1600846213-18093-1-git-send-email-tianfei.zhang@intel.com>
2020-09-23  7:30 ` [dpdk-stable] [PATCH v4 " Tianfei zhang
     [not found] ` <1601257218-6606-1-git-send-email-tianfei.zhang@intel.com>
2020-09-28  1:40   ` [dpdk-stable] [PATCH v2 " Tianfei zhang
2020-09-29  1:42     ` Xu, Rosen
2020-10-14  9:59       ` Zhang, Tianfei
2020-10-15 13:14       ` Zhang, Qi Z [this message]
2020-10-15 18:56     ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
2020-10-16  5:46       ` Zhang, Tianfei
     [not found] ` <1603443599-7356-1-git-send-email-tianfei.zhang@intel.com>
2020-10-23  8:59   ` [dpdk-stable] [PATCH v3 1/5] raw/ifpga/base: fix interrupt handler instance usage Tianfei zhang
2020-10-23  8:59   ` [dpdk-stable] [PATCH v3 2/5] raw/ifpga/base: handle unsupported interrupt type Tianfei zhang
2020-10-23  8:59   ` [dpdk-stable] [PATCH v3 3/5] raw/ifpga/base: fix return of IRQ unregister properly Tianfei zhang

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=c72fd57d61064272be36199d388215a9@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=rosen.xu@intel.com \
    --cc=stable@dpdk.org \
    --cc=tianfei.zhang@intel.com \
    --cc=wei.huang@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).