All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Dario Faggioli <dario.faggioli@citrix.com>
Cc: wei.liu2@citrix.com, ian.campbell@citrix.com,
	stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com,
	ian.jackson@eu.citrix.com, xen-devel@lists.xen.org,
	jbeulich@suse.com, keir@xen.org, ufimtseva@gmail.com
Subject: Re: [PATCH v2 4/4] libxl: Add interface for querying hypervisor about PCI topology
Date: Wed, 07 Jan 2015 09:15:50 -0500	[thread overview]
Message-ID: <54AD3F96.2060502@oracle.com> (raw)
In-Reply-To: <1420621445.17031.18.camel@Abyss.station>

On 01/07/2015 04:04 AM, Dario Faggioli wrote:
> On Mon, 2015-01-05 at 21:18 -0500, Boris Ostrovsky wrote:
>> .. and use this new interface to display it along with CPU topology
>> and NUMA information when 'xl info -n' command is issued
>>
> Also, can we see how an `xl info -n' looks, on an IONUMA system?
>
>> @@ -195,6 +195,24 @@ int xc_cputopoinfo(xc_interface *xch,
>>       return 0;
>>   }
>>   
>> +int xc_pcitopoinfo(xc_interface *xch,
>> +                   xc_pcitopoinfo_t *put_info)
>> +{
>> +    int ret;
>> +    DECLARE_SYSCTL;
>> +
>> +    sysctl.cmd = XEN_SYSCTL_pcitopoinfo;
>> +
>> +    memcpy(&sysctl.u.pcitopoinfo, put_info, sizeof(*put_info));
>> +
>> +    if ( (ret = do_sysctl(xch, &sysctl)) != 0 )
>> +        return ret;
>> +
>> +    memcpy(put_info, &sysctl.u.pcitopoinfo, sizeof(*put_info));
>> +
>> +    return 0;
>> +}
>> @@ -5121,6 +5121,64 @@ libxl_cputopology *libxl_get_cpu_topology(libxl_ctx *ctx, int *nb_cpu_out)
>>       return ret;
>>   }
>>   
>> +libxl_pcitopology *libxl_get_pci_topology(libxl_ctx *ctx, int *num_devs)
>> +{
>> +    GC_INIT(ctx);
>> +    xc_pcitopoinfo_t tinfo;
>> +    DECLARE_HYPERCALL_BUFFER(xen_sysctl_pcitopo_t, pcitopo);
>> +    libxl_pcitopology *ret = NULL;
>> +    int i, rc;
>> +
> I see from where this comes from. However, at least from new functions,
> I think we should avoid using things like DECLARE_HYPERCALL_BUFFER etc.,
> in libxl. They belong in libxc, IMO.
>
> This is basically what Andrew was doing here (although that was on
> xc_{topology,numa}info:
>
> http://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen.git;a=shortlog;h=refs/heads/hwloc-support-experimental
> http://xenbits.xen.org/gitweb/?p=people/andrewcoop/xen.git;a=blobdiff;f=tools/libxc/xc_misc.c;h=4f672cead5a4d2b1fc23bcddb6fb49e4d6ec72b5;hp=330345459176961cacc7fda506e843831fe7156a;hb=3585994405b6a73c137309dd4be91f48c71e4903;hpb=9a80d5056766535ac624774b96495f8b97b1d28b
>
> Basically, what I'm suggesting is to have xc_pcitopoinfo() to do most of
> the work, with libxl_get_pci_topology being just a wrapper to it.


Maybe then I should update libxl_get_cpu_topology() and 
libxl_get_numainfo() as well for code uniformity.

-boris


>
> In fact, if you grep/cscope for things like DECLARE_HYPERCALL_BUFFER in
> tools/libxl, the *only* results are these:
>
> libxl.c             libxl_get_cpu_topology                  5076 DECLARE_HYPERCALL_BUFFER(xc_cpu_to_core_t, coremap);
> libxl.c             libxl_get_cpu_topology                  5077 DECLARE_HYPERCALL_BUFFER(xc_cpu_to_socket_t, socketmap);
> libxl.c             libxl_get_cpu_topology                  5078 DECLARE_HYPERCALL_BUFFER(xc_cpu_to_node_t, nodemap);
> libxl.c             libxl_get_numainfo                      5142 DECLARE_HYPERCALL_BUFFER(xc_node_to_memsize_t, memsize);
> libxl.c             libxl_get_numainfo                      5143 DECLARE_HYPERCALL_BUFFER(xc_node_to_memfree_t, memfree);
> libxl.c             libxl_get_numainfo                      5144 DECLARE_HYPERCALL_BUFFER(uint32_t, node_dists);
>
> And I think we should work toward removing these too, rather than adding
> new ones! :-)
>
> Regards,
> Dario
>

  reply	other threads:[~2015-01-07 14:15 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-06  2:18 [PATCH v2 0/4] Display IO topology when PXM data is available Boris Ostrovsky
2015-01-06  2:18 ` [PATCH v2 1/4] pci: Do not ignore device's PXM information Boris Ostrovsky
2015-01-06 11:55   ` Andrew Cooper
2015-01-07  9:01     ` Jan Beulich
2015-01-07  9:06   ` Jan Beulich
2015-01-07 14:42     ` Boris Ostrovsky
2015-01-07 14:47       ` Andrew Cooper
2015-01-07 15:07         ` Jan Beulich
2015-01-07 15:34           ` Boris Ostrovsky
2015-01-07 15:46             ` Jan Beulich
2015-01-07 15:06       ` Jan Beulich
2015-01-07 15:31         ` Boris Ostrovsky
2015-01-07 15:44           ` Jan Beulich
2015-01-06  2:18 ` [PATCH v2 2/4] sysctl: Make XEN_SYSCTL_topologyinfo sysctl a little more efficient Boris Ostrovsky
2015-01-06 13:41   ` Andrew Cooper
2015-01-06 14:45     ` Boris Ostrovsky
2015-01-07  9:12     ` Jan Beulich
2015-01-07 14:45       ` Boris Ostrovsky
2015-01-07 15:09         ` Jan Beulich
2015-01-16 15:56       ` Boris Ostrovsky
2015-01-16 16:06         ` Jan Beulich
2015-01-16 16:14           ` Boris Ostrovsky
2015-01-16 16:20             ` Jan Beulich
2015-01-16 16:34               ` Boris Ostrovsky
2015-01-16 16:42                 ` Jan Beulich
2015-01-16 16:16           ` Ian Campbell
2015-01-16 16:34             ` Jan Beulich
2015-01-16 16:38               ` Ian Campbell
2015-01-16 16:45                 ` Jan Beulich
2015-01-16 16:57                   ` Andrew Cooper
2015-01-16 17:07                     ` Boris Ostrovsky
2015-01-19  8:57                       ` Jan Beulich
2015-01-19 10:48                         ` Ian Campbell
2015-01-07 15:23     ` Jan Beulich
2015-01-19 17:26   ` Ian Campbell
2015-01-06  2:18 ` [PATCH v2 3/4] sysctl: Add sysctl interface for querying PCI topology Boris Ostrovsky
2015-01-06 16:55   ` Wei Liu
2015-01-06 18:15     ` Boris Ostrovsky
2015-01-07  9:21   ` Jan Beulich
2015-01-07 14:55     ` Boris Ostrovsky
2015-01-07 15:17       ` Jan Beulich
2015-01-07 15:54         ` Boris Ostrovsky
2015-01-07 16:52           ` Jan Beulich
2015-01-07 17:55           ` Dario Faggioli
2015-01-08  9:50             ` Jan Beulich
2015-01-08 15:49               ` Boris Ostrovsky
2015-01-08 15:54                 ` Jan Beulich
2015-01-06  2:18 ` [PATCH v2 4/4] libxl: Add interface for querying hypervisor about " Boris Ostrovsky
2015-01-06 17:08   ` Wei Liu
2015-01-07  9:04   ` Dario Faggioli
2015-01-07 14:15     ` Boris Ostrovsky [this message]
2015-01-07 14:45       ` Dario Faggioli
2015-01-19 17:32   ` Ian Campbell
2015-01-20 10:54     ` Roger Pau Monné
2015-01-20 10:56       ` Ian Campbell
2015-01-20 15:15     ` Boris Ostrovsky
2015-01-20 15:21       ` Ian Campbell
2015-01-20 16:04         ` Boris Ostrovsky
2015-01-20 16:15           ` Ian Campbell
2015-01-20 16:08     ` Egger, Christoph

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=54AD3F96.2060502@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=ufimtseva@gmail.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.