Re: [PATCH 08/30] IB/core: Support find sgid index using a filter function

Matan Barak
2015-02-19T12:48:27Z

On 2/19/2015 2:41 PM, Haggai Eran wrote:
> On 20/02/2015 00:02, Somnath Kotur wrote:
>> @@ -111,6 +111,33 @@ int ib_find_cached_gid_by_port(struct ib_device *device,
>> struct net *net,
>> int if_index,
>> u16 *index);
>> +
>> +/**
>> + * ib_find_cached_gid_by_port - Returns the GID table index where a specified
> You probably meant ib_find_gid_by_filter.

Correct, we'll fix for next version.

>
>> + * GID value occurs
>> + * @device: The device to query.
>> + * @gid: The GID value to search for.
>> + * @port_num: The port number of the device where the GID value could be
>> + * searched.
>> + * @filter: The filter function is executed on any matching GID in the table.
>> + * If the filter function returns true, the corresponding index is returned,
>> + * otherwise, we continue searching the GID table. It's guaranteed that
>> + * while filter is executed, ndev field is valid and the structure won't
>> + * change. filter is executed in an atomic context. filter must be NULL
>> + * when RoCE GID cache isn't supported on the respective device's port.
>> + * @index: The index into the cached GID table where the GID was found. This
>> + * parameter may be NULL.
>> + *
>> + * ib_find_cached_gid_by_port() searches for the specified GID value in
> Here too.

Thanks,
Matan

>
>> + * the local software cache.
>> + */
>> +int ib_find_gid_by_filter(struct ib_device *device,
>> + union ib_gid *gid,
>> + u8 port_num,
>> + bool (*filter)(const union ib_gid *gid,
>> + const struct ib_gid_attr *,
>> + void *),
>> + void *context, u16 *index);
>> /**
>> * ib_get_cached_pkey - Returns a cached PKey table entry
>> * @device: The device to query.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>