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

Re: [Xen-devel] [PATCH v12 10/23] x86: refactor psr: L3 CAT: set value: implement cos finding flow.



>>> Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx> 06/14/17 3:25 AM >>>
>  static int find_cos(const uint32_t val[], unsigned int array_len,
>                      enum psr_feat_type feat_type,
>                      const struct psr_socket_info *info)
>  {
> +    unsigned int cos, cos_max;
> +    const unsigned int *ref = info->cos_ref;
> +    const struct feat_node *feat;
> +
> +    /* cos_max is the one of the feature which is being set. */
> +    feat = info->features[feat_type];
> +    if ( !feat )
> +        return -ENOENT;
> +
> +    cos_max = feat->cos_max;
> +
> +    for ( cos = 0; cos <= cos_max; cos++ )
> +    {
> +        const uint32_t *val_ptr = val;
> +        unsigned int len = array_len, i;
> +        int rc = 0;
> +
> +        if ( cos && !ref[cos] )
> +            continue;
> +
> +        for ( i = 0; i < ARRAY_SIZE(info->features); i++ )
> +        {
> +            const struct feat_props *props = feat_props[i];
> +
> +            feat = info->features[i];
> +            if ( !feat )
> +                continue;
> +
> +            if ( !props )
> +            {
> +                ASSERT_UNREACHABLE();
> +                return -ENOENT;
> +            }
> +
> +            if ( len < props->cos_num )
> +                return -ENOSPC;
> +
> +            /*
> +             * Compare value according to feature array order.
> +             * We must follow this order because value array is assembled
> +             * as this order.
> +             */
> +            rc = compare_val(val_ptr, feat, props, cos);
> +            if ( rc < 0 )
> +                return rc;
> +
> +            /* If fail to match, go to next cos to compare. */
> +            if ( !rc )
> +                break;
> +
> +            len -= props->cos_num;
> +
> +            val_ptr += props->cos_num;

Unnecessary blank line again between these two. With that once again
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

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