Re: Can someone help me understand the reason for this code in ib_isert.c?

Eli Cohen
2014-10-26T14:08:08Z

On Sun, Oct 26, 2014 at 01:57:33PM +0100, Bart Van Assche wrote:
>
> Applications really need a way to query what the maximum supported
> number of scatter/gather entries per work request is. The current
> approach, namely using "dev_attr.max_sge - <magic value>" is
> cumbersome since this approach doesn't work if the value of max_sge
> reported by the HCA is small. I see two possible solutions: either
> modify the max_sge value reported by the mlx4 and mlx5 drivers or
> introduce a new parameter in struct ib_device_attr.
>
Hi Bart,
we already have reported max_sge value. Maybe what we need is another
field, "guarnateed_num_sge" so applicatios providing this value can be
sure it would succeed (or there is some other problem). Then they can
either use this value or iterate from max_sge down to
guarnateed_num_sge to find the highest possible value.