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

Re: [Xen-devel] [PATCH v11 15/23] x86: refactor psr: CDP: implement set value callback function.



>>> On 06.06.17 at 12:43, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> Ok, I should think more. :)
> 
> Then, please check below solution.
> 
> This case only happens in CDP mode that the input cbm_type corresponds to L3
> CAT but current feat_type is CDP. In all other modes, the input cbm_type
> corresponds to its own mode. So, maybe we can implement codes as below.
> 
> //Add an input parameter 'bool strict'
> static enum psr_feat_type psr_cbm_type_to_feat_type(enum cbm_type type, boot 
> strict)
> {
> ...
>     switch ( type )
>     {
>     case PSR_CBM_TYPE_L3:
>         feat_type = PSR_SOCKET_L3_CAT;
> 
>         /*
>          * If type is L3 CAT but we cannot find it in feat_props array,
>          * try CDP.
>          */
>         if ( !feat_props[feat_type] && !strict )
>             feat_type = PSR_SOCKET_L3_CDP;
> 
>         break;
> 
>     case PSR_CBM_TYPE_L3_DATA:
>     case PSR_CBM_TYPE_L3_CODE:
>         feat_type = PSR_SOCKET_L3_CDP;
>         break;
> ...
> }
> 
> //Input feat_type is PSR_SOCKET_L3_CDP, type is PSR_CBM_TYPE_L3
> static int insert_val_into_array(feat_type, type)
> {
> ...
>     for ( i = 0; i < props->cos_num; i++ )
>     {
>         if ( type == props->type[i] ||
>              feat_type != psr_cbm_type_to_feat_type(type, true) )
>         {
>             val[i] = new_val;
>             ret = 0;
>         }
>     }
> 
>     return ret;
> }

Thanks, this looks better, but I will want to see this in context of
the next version of the patch series before making up a final
opinion.

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