From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 7F5062A62 for ; Tue, 6 Mar 2018 16:13:23 +0100 (CET) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id ADD436C006E; Tue, 6 Mar 2018 15:13:21 +0000 (UTC) Received: from [192.168.38.17] (84.52.114.114) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Tue, 6 Mar 2018 15:13:17 +0000 To: CC: Roman Zhukov References: <1519735526-2259-1-git-send-email-arybchenko@solarflare.com> <1519735526-2259-2-git-send-email-arybchenko@solarflare.com> From: Andrew Rybchenko Message-ID: <34691bf0-76b7-025e-2a00-e36a1b197108@solarflare.com> Date: Tue, 6 Mar 2018 18:13:12 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1519735526-2259-2-git-send-email-arybchenko@solarflare.com> Content-Language: en-GB X-Originating-IP: [84.52.114.114] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.100.1062-23702.003 X-TM-AS-Result: No--13.950300-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-MDID: 1520349202-4fcnFSfazHvK Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 01/14] net/sfc/base: support filters for encapsulated packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2018 15:13:23 -0000 On 02/27/2018 03:45 PM, Andrew Rybchenko wrote: > From: Roman Zhukov > > This adds filters for encapsulated packets to the list > returned by ef10_filter_supported_filters(). > > Signed-off-by: Roman Zhukov > Signed-off-by: Andrew Rybchenko > Reviewed-by: Andy Moreton > --- > 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; > + }