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

Re: [Xen-devel] [RFC v2 08/12] tools: create general interfaces to support psr allocation features.



On Thu, Jul 20, 2017 at 04:49:09PM +0800, Yi Sun wrote:
[...]
> +
> +#ifdef LIBXL_HAVE_PSR_MBA
> +/*
> + * Function to set a domain's value. It operates on a single or multiple
> + * target(s) defined in 'target_map'. 'target_map' specifies all the sockets
> + * to be operated on.
> + */
> +int libxl_psr_set_val(libxl_ctx *ctx, uint32_t domid,
> +                      libxl_psr_cbm_type type, libxl_bitmap *target_map,
> +                      uint64_t val);
> +/*
> + * Function to get a domain's cbm. It operates on a single 'target'.
> + * 'target' specifies which socket to be operated on.
> + */
> +int libxl_psr_get_val(libxl_ctx *ctx, uint32_t domid,
> +                      libxl_psr_cbm_type type, uint32_t target,

There is no need for target to be uint32_t right? Unsigned int should
work too?

> +                      uint64_t *val);
> +/*
> + * On success, the function returns an array of elements in 'info',
> + * and the length in 'nr'.
> + */
> +int libxl_psr_get_hw_info(libxl_ctx *ctx, libxl_psr_hw_info **info,
> +                          int *nr, libxl_psr_feat_type type, int lvl);
> +void libxl_psr_hw_info_list_free(libxl_psr_hw_info *list, int nr);

nr should be unsigned int.

> +#endif /* LIBXL_HAVE_PSR_MBA */
> +#endif /* LIBXL_HAVE_PSR_CAT */
>  
>  /* misc */
>  
> diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
> index f55ba1e..8319301 100644
> --- a/tools/libxl/libxl_psr.c
> +++ b/tools/libxl/libxl_psr.c
> @@ -425,6 +425,30 @@ void libxl_psr_cat_info_list_free(libxl_psr_cat_info 
> *list, int nr)
>      free(list);
>  }
>  
> +int libxl_psr_set_val(libxl_ctx *ctx, uint32_t domid,
> +                      libxl_psr_cbm_type type, libxl_bitmap *target_map,
> +                      uint64_t val)
> +{
> +    return EXIT_FAILURE;

ERROR_FAIL here.

> +
> +libxl_psr_hw_info = Struct("psr_hw_info", [
> +    ("id", uint32),
> +    ("u", KeyedUnion(None, libxl_psr_feat_type, "type",
> +          [("cat_info", Struct(None, [
> +                                         ("cos_max",     uint32),
> +                                         ("cbm_len",     uint32),
> +                                         ("cdp_enabled", bool),
> +                               ])),
> +           ("mba_info", Struct(None, [
> +                                         ("cos_max",     uint32),
> +                                         ("thrtl_max",   uint32),
> +                                         ("linear",      bool),
> +                               ])),
> +          ]))

If this is output only please mark it as dir=DIR_OUT.

> +    ])
> -- 
> 1.9.1
> 

_______________________________________________
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®.