From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nbfkord-smmo01.seg.att.com (nbfkord-smmo01.seg.att.com [209.65.160.76]) by dpdk.org (Postfix) with ESMTP id 57123952 for ; Tue, 7 Mar 2017 15:48:06 +0100 (CET) Received: from unknown [193.34.186.16] (EHLO webmail.solarflare.com) by nbfkord-smmo01.seg.att.com(mxl_mta-7.2.4-7) with ESMTP id 628ceb85.2b94fcc2d940.1066159.00-2468.3062910.nbfkord-smmo01.seg.att.com (envelope-from ); Tue, 07 Mar 2017 14:48:06 +0000 (UTC) X-MXL-Hash: 58bec82634659b9c-666d73e021071a8741abcb4d22079f621fb92b9e Received: from unknown [193.34.186.16] (EHLO webmail.solarflare.com) by nbfkord-smmo01.seg.att.com(mxl_mta-7.2.4-7) over TLS secured channel with ESMTP id 218ceb85.0.1066125.00-2381.3062852.nbfkord-smmo01.seg.att.com (envelope-from ); Tue, 07 Mar 2017 14:47:47 +0000 (UTC) X-MXL-Hash: 58bec8131f970f94-fc589c9cf340789763f6bcb6782e31853e9a11be Received: from [192.168.38.17] (84.52.89.52) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Tue, 7 Mar 2017 14:47:41 +0000 To: Ferruh Yigit , References: <1488470591-5853-1-git-send-email-arybchenko@solarflare.com> <1488470591-5853-3-git-send-email-arybchenko@solarflare.com> <0305e912-1d88-f6d5-39b4-dec8c410475c@intel.com> CC: Mark Spender From: Andrew Rybchenko Message-ID: <7e45bfb6-812f-e7a2-f259-eeadbebb9a44@solarflare.com> Date: Tue, 7 Mar 2017 17:47:36 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <0305e912-1d88-f6d5-39b4-dec8c410475c@intel.com> X-Originating-IP: [84.52.89.52] 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-22926.003 X-TM-AS-Result: No--4.427400-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-AnalysisOut: [v=2.1 cv=LaQ6n2ri c=1 sm=1 tr=0 a=8P+NB+fYZDP74ap4g4d9Kw==] X-AnalysisOut: [:17 a=RB3BGLmKESwA:10 a=6Iz7jQTuP9IA:10 a=zRKbQ67AAAAA:8 a] X-AnalysisOut: [=UZ6MU-7mWEXldYNiFhoA:9 a=1VWeiKvY2f7GL3HW:21 a=XNzEK84LCJ] X-AnalysisOut: [d2-tmh:21 a=pILNOxqGKmIA:10 a=QyXUC8HyAAAA:8 a=9ZeSNRwre6e] X-AnalysisOut: [8ZxEy2qoA:9 a=4DBbXKD0AbwRzyS3:21 a=82HDbw3IixteVSF3:21 a=] X-AnalysisOut: [154JO6ijktjSumvI:21 a=_W_S_7VecoQA:10 a=PA03WX8tBzeizutn5_] X-AnalysisOut: [OT:22 a=avl4LiGQNoF5OB0DmCJ7:22] X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [193.34.186.16] Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 02/11] net/sfc/base: improve API to get supported filter matches 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, 07 Mar 2017 14:48:06 -0000 On 03/07/2017 04:25 PM, Ferruh Yigit wrote: > On 3/2/2017 4:03 PM, Andrew Rybchenko wrote: >> From: Mark Spender >> >> 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 >> Signed-off-by: Andrew Rybchenko > <...> > >> >> - *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])) Ferruh, it is a base driver patch and base driver has a bit different coding conventions (due to usage on other operating systems). I hope it is not a problem. Thanks, Andrew.