DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: "Wu, Jingjing" <jingjing.wu@intel.com>,
	"Guo, Junfeng" <junfeng.guo@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"He, Xingguang" <xingguang.he@intel.com>,
	"Laatz, Kevin" <kevin.laatz@intel.com>,
	"Richardson, Bruce" <bruce.richardson@intel.com>
Subject: Re: [PATCH] examples/ntb: remove redundant logic for dev close
Date: Wed, 28 Jun 2023 09:53:21 +0200	[thread overview]
Message-ID: <10294010.qUNvkh4Gvn@thomas> (raw)
In-Reply-To: <DM6PR11MB37238A75ED1B0F4DED2ED578E724A@DM6PR11MB3723.namprd11.prod.outlook.com>

28/06/2023 04:37, Guo, Junfeng:
> From: Guo, Junfeng
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 14/06/2023 07:14, Junfeng Guo:
> > > > During EAL cleanup stage, all bus devices are cleaned up properly.
> > > > Based on this, there is no need to do extra device close process,
> > > > which may call the dev ops '*dev->dev_ops->dev_close' twice.
> > > >
> > > > If this dev ops for ntb was called twice, the interrupt handle for
> > > > EAL will be disabled twice and will lead to error for the seconde
> > > > time. Like this: "EAL: Error disabling MSI-X interrupts for fd xx"
> > >
> > > You should fix ntb to not disable interrupt twice.
> > 
> > Thanks for the comment!
> > 
> > Yes, it is exactly what this patch did.
> 
> Another solution is to add extra logic in dev_close, i.e., to do the
> interrupt disabling process only when the interrupt handler is valid.
> That is, to disable interrupt only when 'intr_handle->max_intr' or
> 'intr_handle->nb_efd' is non-zero.
> 
> But I'm not sure if this method is a better solution.
> Please help give some advice, thanks!

Yes this is what I suggest.
You cannot fix all applications in the world,
but you can fix the driver, so it is a better way :)

> > The interrupt disabling process is part of 'dev_close' ops, and will be
> > called twice (one in EAL cleanup, another in ntb example cleanup).
> > 
> > Now that fixed & covered by the EAL cleanup, there is no need to
> > run dev_close at ntb example. Just remove that redundant logic.




  reply	other threads:[~2023-06-28  7:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14  5:14 Junfeng Guo
2023-06-15  8:28 ` Ling, WeiX
2023-06-28  0:12 ` Thomas Monjalon
2023-06-28  2:19   ` Guo, Junfeng
2023-06-28  2:37     ` Guo, Junfeng
2023-06-28  7:53       ` Thomas Monjalon [this message]
2023-06-28  8:08         ` Guo, Junfeng
2023-06-28  9:12 ` [PATCH v2] raw/ntb: add check for disabling interrupt in dev close ops Junfeng Guo
2023-06-29  8:03   ` Ling, WeiX
2023-07-03  6:53   ` Wu, Jingjing
2023-07-03 15:44     ` 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=10294010.qUNvkh4Gvn@thomas \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=junfeng.guo@intel.com \
    --cc=kevin.laatz@intel.com \
    --cc=stable@dpdk.org \
    --cc=xingguang.he@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).