xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>,
	xiantao.zhang@intel.com, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH resend 2/3] x86: enable multi-vector MSI
Date: Wed, 17 Jul 2013 11:02:47 +0100	[thread overview]
Message-ID: <51E66BC7.7090406@citrix.com> (raw)
In-Reply-To: <51E54F1F02000078000E55C0@nat28.tlf.novell.com>

On 16/07/13 12:48, Jan Beulich wrote:
>>>> On 16.07.13 at 13:36, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> On 16/07/13 11:14, Jan Beulich wrote:
>>> +int get_free_pirqs(struct domain *d, unsigned int nr)
>>> +{
>>> +    unsigned int i, found = 0;
>>> +
>>> +    ASSERT(spin_is_locked(&d->event_lock));
>>> +
>>> +    for ( i = d->nr_pirqs - 1; i >= nr_irqs_gsi; --i )
>>> +        if ( is_free_pirq(d, pirq_info(d, i)) )
>>> +        {
>>> +            pirq_get_info(d, i);
>>> +            if ( ++found == nr )
>>> +                return i;
>>> +        }
>>> +        else
>>> +            found = 0;
>>> +
>>> +    return -ENOSPC;
>>> +}
>>> +
>> Is there any reason why this loop is backwards? Unless I am mistaken,
>> guests can choose their own pirqs when binding them, reducing the
>> likelyhood that the top of the available space will be free.
> This just follows the behavior of get_free_pirq(). I'm not up to
> having the two behave differently.
>
>>> @@ -210,8 +237,15 @@ int physdev_map_pirq(domid_t domid, int 
>>>   done:
>>>      spin_unlock(&d->event_lock);
>>>      spin_unlock(&pcidevs_lock);
>>> -    if ( (ret != 0) && (type == MAP_PIRQ_TYPE_MSI) && (*index == -1) )
>>> -        destroy_irq(irq);
>>> +    if ( ret != 0 )
>>> +        switch ( type )
>>> +        {
>>> +        case MAP_PIRQ_TYPE_MSI:
>>> +            if ( *index == -1 )
>>> +        case MAP_PIRQ_TYPE_MULTI_MSI:
>>> +                destroy_irq(irq);
>>> +            break;
>>> +        }
>> Do we not need to create and destroy entry_nr irqs in this function, or
>> is a multi-vector-msi now considered as just as single irq ?
>>
>> I ask because this appears to lack the "repeating certain operations for
>> all involved IRQs" described in the comment.
> No, there's a single create_irq() in the function, and having a single
> destroy_irq() here matches this. The remaining ones (both!) are in
> map_domain_pirq().

Ok.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> Also, as a general remark, asking for changes in a series that was
> posted 2.5 months ago (and deferred just because of the 4.3
> release process) seems a little strange to me. I had to repost
> merely to collect ack-s, and didn't really expect further requests
> for adjustments as there was ample time before to do so.
>
> Jan
>

2.5 months ago, I was very busy with XSAs, hotfixes and a release of
XenServer, so I appologies for not reviewing back then.

~Andrew

  reply	other threads:[~2013-07-17 10:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16 10:00 [PATCH resend 0/3] x86/IOMMU: multi-vector MSI Jan Beulich
2013-07-16 10:13 ` [PATCH resend 1/3] VT-d: enable for " Jan Beulich
2013-07-16 11:15   ` Andrew Cooper
2013-07-16 11:32     ` Jan Beulich
2013-07-17  9:50       ` Andrew Cooper
2013-07-18 10:48         ` Zhang, Xiantao
2013-07-16 10:14 ` [PATCH resend 2/3] x86: enable " Jan Beulich
2013-07-16 11:36   ` Andrew Cooper
2013-07-16 11:48     ` Jan Beulich
2013-07-17 10:02       ` Andrew Cooper [this message]
2013-08-05 13:11   ` Ping: " Jan Beulich
2013-08-08  9:02   ` Keir Fraser
2013-07-16 10:15 ` [PATCH resend 3/3] pciif: add multi-vector-MSI command Jan Beulich
2013-07-16 11:19   ` Andrew Cooper
2013-07-16 11:35     ` Jan Beulich
2013-07-17  9:02       ` Andrew Cooper
2013-08-05 13:12   ` Ping: " Jan Beulich
2013-08-08  9:02   ` Keir Fraser

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=51E66BC7.7090406@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.org \
    --cc=xiantao.zhang@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).