[dpdk-dev] [PATCH 02/11] net/sfc/base: improve API to get supported filter matches
Ferruh Yigit
ferruh.yigit at intel.com
Tue Mar 7 14:25:00 CET 2017
On 3/2/2017 4:03 PM, Andrew Rybchenko wrote:
> From: Mark Spender <mspender at solarflare.com>
>
> The previous API had various problems, including the length of the
> caller provided buffer not being specified, no means being available
> to discover how big the buffer needs to be, and a lack of clarity of
> what the resulting list contains.
>
> To improve it:
> - add the buffer length as a parameter
> - if the provided buffer is too short, fail with ENOSPC and return
> the required length
> - ensure that the list contents are valid and add comments describing it
>
> It is safe to change this API as, unsuprisingly, it has no users.
>
> Signed-off-by: Mark Spender <mspender at solarflare.com>
> Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
<...>
>
> - *length = index;
> - memcpy(list, rx_matches, *length);
> + memcpy(buffer, rx_matches, list_length * sizeof (rx_matches[0]));
Checkpatch warning:
WARNING:SPACING: space prohibited between function name and open
parenthesis '('
#326: FILE: drivers/net/sfc/base/efx_filter.c:1410:
+ memcpy(buffer, rx_matches, list_length * sizeof (rx_matches[0]))
More information about the dev
mailing list