From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH 02/11] net/sfc/base: improve API to get supported filter matches Date: Tue, 7 Mar 2017 14:56:11 +0000 Message-ID: <4300b17f-60fd-4149-a9b6-7e31d8add7bb@intel.com> 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> <7e45bfb6-812f-e7a2-f259-eeadbebb9a44@solarflare.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Mark Spender To: Andrew Rybchenko , dev@dpdk.org Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 0E37D108A for ; Tue, 7 Mar 2017 15:56:15 +0100 (CET) In-Reply-To: <7e45bfb6-812f-e7a2-f259-eeadbebb9a44@solarflare.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 3/7/2017 2:47 PM, Andrew Rybchenko wrote: > 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. It is a whitespace warning, I think it can be OK for base code. > > Thanks, > Andrew.