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

Re: [Xen-devel] [PATCH 3/7] ioreq: allow dispatching ioreqs to internal servers


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
  • Date: Thu, 22 Aug 2019 08:33:23 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=Paul.Durrant@xxxxxxxxxx; spf=Pass smtp.mailfrom=Paul.Durrant@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Delivery-date: Thu, 22 Aug 2019 08:33:30 +0000
  • Ironport-sdr: EdvrzaPFOV67dwlMH7y/Z8h8ejfCMQZ3a9WGP4a3WDrAWDH4RdG12aO2wKW2RAdrewnxlDDjlx fPhBGgz539J/6E8BT6PjwAn0Q+JhOkveCN0vcWyaPQQCaSYkuKn33p5du5te3dfuZgPLYYMpSQ Mv9zOKzwlE3R5vHomKFZwd8B3v4PGQ9WcILi6eHgx1Fxh5MMpQ209jS7d1Y74aCTCllGAQJdTm L+QrqtYuOnJP2gaNJQFh48Z9Ae66Mt1zq33pQFaStLVTwKc+fa8USwBdIv4mqYlyM8LP6t5VII z/U=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVWDENzumIAV6ZWEmsnxjuoJWjIacFylMQgADdmgCAAC+awA==
  • Thread-topic: [PATCH 3/7] ioreq: allow dispatching ioreqs to internal servers

> -----Original Message-----
> From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
> Sent: 22 August 2019 08:41
> To: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx; Jan Beulich <jbeulich@xxxxxxxx>; Andrew 
> Cooper
> <Andrew.Cooper3@xxxxxxxxxx>; Wei Liu <wl@xxxxxxx>
> Subject: Re: [PATCH 3/7] ioreq: allow dispatching ioreqs to internal servers
> 
> On Wed, Aug 21, 2019 at 06:29:04PM +0200, Paul Durrant wrote:
> > > -----Original Message-----
> > > From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
> > > Sent: 21 August 2019 15:59
> > > To: xen-devel@xxxxxxxxxxxxxxxxxxxx
> > > Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>; Paul Durrant 
> > > <Paul.Durrant@xxxxxxxxxx>; Jan Beulich
> > > <jbeulich@xxxxxxxx>; Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>; Wei Liu 
> > > <wl@xxxxxxx>
> > > Subject: [PATCH 3/7] ioreq: allow dispatching ioreqs to internal servers
> > >
> > > Internal ioreq servers are always processed first, and ioreqs are
> > > dispatched by calling the handler function. If no internal servers have
> > > registered for an ioreq it's then forwarded to external callers.
> >
> > Distinct id ranges would help here... Internal ids could be walked first, 
> > then external. If there's
> no possibility of interleaving then you don't need the retry.
> 
> So if internal vs external is keyed on the ID then we would end up
> with two different arrays in hvm_domain, one for internal and one for
> external ioreq servers.
> 
> Maybe instead of my previous suggestion it would be better to just
> define consecutive ranges for external and internal servers, like:
> 
> #define MAX_NR_EXTERNAL_IOREQ_SERVERS 8
> #define MAX_NR_INTERNAL_IOREQ_SERVERS 1
> #define MAX_NR_IOREQ_SERVERS \
>     (MAX_NR_EXTERNAL_IOREQ_SERVERS + MAX_NR_INTERNAL_IOREQ_SERVERS)
> 
> #define FOR_EACH_IOREQ_SERVER(d, id, s) \
>     for ( (id) = MAX_NR_IOREQ_SERVERS * 2; (id) != 0; ) \
>         if ( !(s = GET_IOREQ_SERVER(d, --(id))) ) \
>             continue; \
>         else
> 
> #define FOR_EACH_INTERNAL_IOREQ_SERVER(d, id, s) \
>     for ( (id) = MAX_NR_IOREQ_SERVERS; (id) > MAX_NR_INTERNAL_IOREQ_SERVERS 
> && (id) != 0; ) \
>         if ( !(s = GET_IOREQ_SERVER(d, --(id))) ) \
>             continue; \
>         else
> 
> #define FOR_EACH_EXTERNAL_IOREQ_SERVER(d, id, s) \
>     for ( (id) = MAX_NR_INTERNAL_IOREQ_SERVERS; (id) != 0; ) \
>         if ( !(s = GET_IOREQ_SERVER(d, --(id))) ) \
>             continue; \
>         else
> 
> That would also force FOR_EACH_IOREQ_SERVER to always process internal
> ioreq servers first.

Exactly what I was thinking.

> 
> We could even have something like:
> 
> union {
>     struct {
>         struct hvm_ioreq_server 
> *external_server[MAX_NR_EXTERNAL_IOREQ_SERVERS];
>         struct hvm_ioreq_server 
> *internal_server[MAX_NR_INTERNAL_IOREQ_SERVERS];
>     }
>     struct hvm_ioreq_server *server[MAX_NR_IOREQ_SERVERS];
> }
> 
> In order to split the arrays if required.
> 

I'd not considered a union, but it makes sense :-)

  Paul

> Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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