Hi Eli,
Sorry fot the late response.
> If strtol() fails, you may return with an invalid, non zero value for
> huge page size. Maybe use some temporary variable to hold the
> intermediate result.
If strtol() fails, for any reason, we always return value <= 0 for huge page
size.
This indicates that system's huge page size is unknown
and the second call to ibv_madvise_range_helper(), with huge page size,
will be skipped (as it supposed to be).
Thanks,
AlexV
Eli Cohen Wrote:
> On Sun, Nov 29, 2009 at 07:08:08PM +0200, Alex Vainman wrote:
>> + p_hpage_val = strstr(buf, label);
>> + if (!p_hpage_val) {
>> + errno = EINVAL;
>> + return -1;
>> + }
>> + p_hpage_val += strlen(label);
>> +
>> + errno = 0;
>> + ret_val = strtol(p_hpage_val, &end_pointer, 0);
>
> If strtol() fails, you may return with an invalid, non zero value for
> huge page size. Maybe use some temporary variable to hold the
> intermediate result.
>> +
>> + if (errno != 0)
>> + return -1;
>> +
>> + return ret_val * 1024;
>> +}
>> +
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html