From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Fastabend Subject: Re: [PATCH v2 bpf-next 0/2] sockmap: fix sg api usage Date: Thu, 29 Mar 2018 20:39:01 -0700 Message-ID: References: <20180330002100.5724-1-bhole_prashant_q7@lab.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Prashant Bhole , Daniel Borkmann , Alexei Starovoitov , "David S . Miller" Return-path: Received: from mail-pg0-f53.google.com ([74.125.83.53]:44670 "EHLO mail-pg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752645AbeC3DjO (ORCPT ); Thu, 29 Mar 2018 23:39:14 -0400 Received: by mail-pg0-f53.google.com with SMTP id v26so4334288pge.11 for ; Thu, 29 Mar 2018 20:39:13 -0700 (PDT) In-Reply-To: <20180330002100.5724-1-bhole_prashant_q7@lab.ntt.co.jp> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 03/29/2018 05:20 PM, Prashant Bhole wrote: > These patches fix sg api usage in sockmap. Previously sockmap didn't > use sg_init_table(), which caused hitting BUG_ON in sg api, when > CONFIG_DEBUG_SG is enabled > > v1: added sg_init_table() calls wherever needed. > > v2: > - Patch1 adds new helper function in sg api. sg_init_marker() > - Patch2 sg_init_marker() and sg_init_table() in appropriate places > > Backgroud: > While reviewing v1, John Fastabend raised a valid point about > unnecessary memset in sg_init_table() because sockmap uses sg table > which embedded in a struct. As enclosing struct is zeroed out, there > is unnecessary memset in sg_init_table. > > So Daniel Borkmann suggested to define another static inline function > in scatterlist.h which only initializes sg_magic. Also this function > will be called from sg_init_table. From this suggestion I defined a > function sg_init_marker() which sets sg_magic and calls sg_mark_end() > Series looks good to me thanks for finding and fixing this!