[dpdk-dev] [PATCH 01/14] net/sfc/base: support filters for encapsulated packets

Andrew Rybchenko arybchenko at solarflare.com
Tue Mar 6 16:13:12 CET 2018


On 02/27/2018 03:45 PM, Andrew Rybchenko wrote:
> From: Roman Zhukov <Roman.Zhukov at oktetlabs.ru>
>
> This adds filters for encapsulated packets to the list
> returned by ef10_filter_supported_filters().
>
> Signed-off-by: Roman Zhukov <Roman.Zhukov at oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
> Reviewed-by: Andy Moreton <amoreton at solarflare.com>
> ---
>   drivers/net/sfc/base/ef10_filter.c | 65 ++++++++++++++++++++++++++++++++------
>   1 file changed, 55 insertions(+), 10 deletions(-)

<...>

> -	rc = efx_mcdi_get_parser_disp_info(enp, buffer, buffer_length,
> -					    &mcdi_list_length);
> +	/*
> +	 * Two calls to MC_CMD_GET_PARSER_DISP_INFO are needed: one to get the
> +	 * list of supported filters for ordinary packets, and then another to
> +	 * get the list of supported filters for encapsulated packets.
> +	 */
> +	rc = efx_mcdi_get_parser_disp_info(enp, buffer, buffer_length, B_FALSE,
> +	    &mcdi_list_length);
>   	if (rc != 0) {
> -		if (rc == ENOSPC) {
> -			/* Pass through mcdi_list_length for the list length */
> -			*list_lengthp = mcdi_list_length;
> +		if (rc == ENOSPC)
> +			no_space = B_TRUE;
> +		else
> +			goto fail1;
> +	}
> +
> +	if (no_space) {
> +		next_buf_idx = 0;
> +		next_buf_length = 0;
> +	} else {
> +		EFSYS_ASSERT(mcdi_list_length < buffer_length);

In fact <= must be here since above call may return 0 if return array
fits exactly in provided buffer. I'll send v2.

> +		next_buf_idx = mcdi_list_length;
> +		next_buf_length = buffer_length - mcdi_list_length;
> +	}

<snip>


More information about the dev mailing list