[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 5/7] VT-d: No need to set irq affinity for posted format IRTE



>>> On 17.10.16 at 09:02, <feng.wu@xxxxxxxxx> wrote:
>> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
>> Sent: Wednesday, October 12, 2016 9:56 PM
>> >>> On 11.10.16 at 02:57, <feng.wu@xxxxxxxxx> wrote:
>> > --- a/xen/drivers/passthrough/vtd/intremap.c
>> > +++ b/xen/drivers/passthrough/vtd/intremap.c
>> > @@ -547,6 +547,49 @@ static int remap_entry_to_msi_msg(
>> >      return 0;
>> >  }
>> >
>> > +static bool_t pi_can_suppress_irte_update(struct iremap_entry *new,
>> 
>> bool (and true/false respectively) please.
>> 
>> And then the function name suggests that no modification gets done
>> here (and hence the first parameter could be const too), yet the
>> implementation does otherwise (and I don't understand why).
> 
> The idea here is that if the old IRTE is in posted format and fields like
> 'fpd', 'sid', 'sq', or 'svt' is going to be changed , we need to use these
> new values for the new_ire, while we still need to use the old values
> of other fields in IRTE, so this function returns the new irte in its first
>  parameter it we cannot suppress the update. I try to do it in this
> function.

I don't understand: The caller fully constructs the new entry. Why
would you want to do further modifications here? I continue to
think that this function should solely check whether the changes
between old and new entry are such that the actual update (and
hence the flush) can be bypassed.

>> > +    const struct iremap_entry *old)
>> > +{
>> > +    bool_t ret = 1;
>> > +    u16 fpd, sid, sq, svt;
>> > +
>> > +    if ( !old->remap.p || !old->remap.im )
>> > +        return 0;
>> > +
>> > +    fpd = new->post.fpd;
>> > +    sid = new->post.sid;
>> > +    sq = new->post.sq;
>> > +    svt = new->post.svt;
>> > +
>> > +    *new = *old;
>> > +
>> > +    if ( fpd != old->post.fpd )
>> > +    {
>> > +        new->post.fpd = fpd;
>> > +        ret = 0;
>> > +    }
>> > +
>> > +    if ( sid != old->post.sid )
>> > +    {
>> > +        new->post.sid = sid;
>> > +        ret = 0;
>> > +    }
>> > +
>> > +    if ( sq != old->post.sq )
>> > +    {
>> > +        new->post.sq = sq;
>> > +        ret = 0;
>> > +    }
>> > +
>> > +    if ( svt != old->post.svt )
>> > +    {
>> > +        new->post.svt = svt;
>> > +        ret = 0;
>> > +    }
>> 
>> What's the selection of the fields based on? Namely, what about
>> vector, pda_l, and pda_h?
> 
> These filed are the common field between posted format and remapped format.
> 'vector' field has different meaning in the two formant, pda_l and pda_h is 
> only
> for posted format. As mentioned above, the purpose of this function is to find
> whether use need to update this common field in posted format, if it is, we 
> need
> to use them and reuse the old value of other fields (pda_l, pda_h, vector, 
> etc.).
> since we need to suppress affinity related update for posted format.

If that was the case, then the first thing you'd need to check would
be whether the format actually changes. If it doesn't, all fields need
to be compared, while if it does change, the write (and flush) clearly
can't be suppressed.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.