qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" <longpeng2@huawei.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: chenjiashang <chenjiashang@huawei.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Gonglei \(Arei\)" <arei.gonglei@huawei.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"philmd@redhat.com" <philmd@redhat.com>
Subject: RE: [PATCH v3 4/9] msix: simplify the conditional in msix_set/unset_vector_notifiers
Date: Fri, 8 Oct 2021 01:02:22 +0000	[thread overview]
Message-ID: <6fd74c74cc50462da1dd68e19cef3989@huawei.com> (raw)
In-Reply-To: <20211001170405.085fa9e1.alex.williamson@redhat.com>



> -----Original Message-----
> From: Alex Williamson [mailto:alex.williamson@redhat.com]
> Sent: Saturday, October 2, 2021 7:04 AM
> To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> <longpeng2@huawei.com>
> Cc: philmd@redhat.com; pbonzini@redhat.com; marcel.apfelbaum@gmail.com;
> mst@redhat.com; qemu-devel@nongnu.org; Gonglei (Arei)
> <arei.gonglei@huawei.com>; chenjiashang <chenjiashang@huawei.com>
> Subject: Re: [PATCH v3 4/9] msix: simplify the conditional in
> msix_set/unset_vector_notifiers
> 
> On Tue, 21 Sep 2021 07:01:57 +0800
> "Longpeng(Mike)" <longpeng2@huawei.com> wrote:
> 
> > 'msix_function_masked' is synchronized with the device's config,
> > we can use it to replace the complex conditional statementis in
> > msix_set/unset_vector_notifiers.
> >
> > Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
> > ---
> >  hw/pci/msix.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/hw/pci/msix.c b/hw/pci/msix.c
> > index ae9331cd0b..67682289af 100644
> > --- a/hw/pci/msix.c
> > +++ b/hw/pci/msix.c
> > @@ -592,8 +592,7 @@ int msix_set_vector_notifiers(PCIDevice *dev,
> >      dev->msix_vector_release_notifier = release_notifier;
> >      dev->msix_vector_poll_notifier = poll_notifier;
> >
> > -    if ((dev->config[dev->msix_cap + MSIX_CONTROL_OFFSET] &
> > -        (MSIX_ENABLE_MASK | MSIX_MASKALL_MASK)) == MSIX_ENABLE_MASK) {
> > +    if (!dev->msix_function_masked) {
> >          for (vector = 0; vector < dev->msix_entries_nr; vector++) {
> >              ret = msix_set_notifier_for_vector(dev, vector);
> >              if (ret < 0) {
> > @@ -622,8 +621,7 @@ void msix_unset_vector_notifiers(PCIDevice *dev)
> >      assert(dev->msix_vector_use_notifier &&
> >             dev->msix_vector_release_notifier);
> >
> > -    if ((dev->config[dev->msix_cap + MSIX_CONTROL_OFFSET] &
> > -        (MSIX_ENABLE_MASK | MSIX_MASKALL_MASK)) == MSIX_ENABLE_MASK) {
> > +    if (!dev->msix_function_masked) {
> >          for (vector = 0; vector < dev->msix_entries_nr; vector++) {
> >              msix_unset_notifier_for_vector(dev, vector);
> >          }
> 
> This appears to be a cleanup that's not required for the functionality
> of this series.  I'd suggest proposing it separately.  Same for the
> patch 5/9 in this series.  If it makes a functional difference it
> should be described in the commit log.  Thanks,
> 

OK, will remove these two patches in the v4, thanks.

> Alex



  reply	other threads:[~2021-10-08  1:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20 23:01 [PATCH v3 0/9] optimize the downtime for vfio migration Longpeng(Mike)
2021-09-20 23:01 ` [PATCH v3 1/9] vfio: simplify the conditional statements in vfio_msi_enable Longpeng(Mike)
2021-09-20 23:01 ` [PATCH v3 2/9] vfio: move re-enabling INTX out of the common helper Longpeng(Mike)
2021-09-20 23:01 ` [PATCH v3 3/9] vfio: simplify the failure path in vfio_msi_enable Longpeng(Mike)
2021-09-20 23:01 ` [PATCH v3 4/9] msix: simplify the conditional in msix_set/unset_vector_notifiers Longpeng(Mike)
2021-10-01 23:04   ` Alex Williamson
2021-10-08  1:02     ` Longpeng (Mike, Cloud Infrastructure Service Product Dept.) [this message]
2021-09-20 23:01 ` [PATCH v3 5/9] msix: reset poll_notifier to NULL if fail to set notifiers Longpeng(Mike)
2021-09-20 23:01 ` [PATCH v3 6/9] kvm: irqchip: extract kvm_irqchip_add_deferred_msi_route Longpeng(Mike)
2021-09-20 23:02 ` [PATCH v3 7/9] vfio: add infrastructure to commit the deferred kvm routing Longpeng(Mike)
2021-10-01 23:04   ` Alex Williamson
2021-10-08  1:26     ` Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
2021-09-20 23:02 ` [PATCH v3 8/9] Revert "vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration" Longpeng(Mike)
2021-10-01 23:04   ` Alex Williamson
2021-10-08  1:32     ` Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
2021-09-20 23:02 ` [PATCH v3 9/9] vfio: defer to commit kvm irq routing when enable msi/msix Longpeng(Mike)
2021-10-01 23:04   ` Alex Williamson
2021-10-05 13:10     ` Longpeng (Mike, Cloud Infrastructure Service Product Dept.)

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=6fd74c74cc50462da1dd68e19cef3989@huawei.com \
    --to=longpeng2@huawei.com \
    --cc=alex.williamson@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=chenjiashang@huawei.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).