Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp133335imm; Tue, 21 Aug 2018 16:08:43 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda4r4EilOSbLEW97lTm0ejHKkig1Sf8yR6zQNPxFqkzSGnKeyuJ5ZkRMkOqIAitkUvRKde+ X-Received: by 2002:a62:8c8c:: with SMTP id m134-v6mr4420384pfd.130.1534892923000; Tue, 21 Aug 2018 16:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534892922; cv=none; d=google.com; s=arc-20160816; b=hi6tinPXEC7rrIOsBpGQyeOXEciewsWX1uHG1RwqUGzA/kkpJhimMhRhxPy1lqp+zw sAuVua6RjQNcY5WvVvx66wNsW9sS5y7uzLcjpHFOLAfOeIrX/bDA8Kr1SKid8ZGPKetE 8eOiuKMS1R3A13EEWTBGJDvNX7/EjqQx0uSiDlAGMJlZRs8KRWBqhfge/EU//GhADNUR Jn13yzI5A3cAP+6W+LMp1vCMQc7ciBI5JL03rmgjoPFxWFg6e5DFewPBZMlMIMxay4C+ nQjo66FFbMH3py/cDwQ2k2RifdrZCgwzj/NC3Fe30Cj2YTjr/6DiVpuklkSSenDhwJz9 UuOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=q+S0WBE+ww0WBF7Rp4aXBJ2suaTTN2WIocHJ/jf5pX4=; b=X1ZFxAJvTi09rPTBNPi1v2zoy7o0SBEXSfdzPdjHJdEEICac/50DhLM9UE/mOVI/m+ 6O7qaA9PbtI7I0QKrSg2vbVADr+RXglOcwxGL0BboiAR909ne2G/fA6hr6fw48krSXrc sgy1JjZ9gjuzO1utvWATaGt20VNyRAscBqTiUcm/PIbkybhYoYkFHGQ2/THG7aBsU64q AMNZGeXwenAJGGAtr9GBzf8LZ0YFFj4RMNfT8uvhtr0EjTnGLjWE0ZsLz1XJrEuwskyQ IBQzh7S7U4JF3FXUt0yfcal1BLsX4FetXdvqVvE/rIO6rFQpS3OH4kxX60C0lkm0OxKC W9jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j61-v6si49320plb.49.2018.08.21.16.08.14; Tue, 21 Aug 2018 16:08:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727569AbeHVCNh (ORCPT + 99 others); Tue, 21 Aug 2018 22:13:37 -0400 Received: from nautica.notk.org ([91.121.71.147]:52194 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726283AbeHVCNh (ORCPT ); Tue, 21 Aug 2018 22:13:37 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 6E98CC009; Wed, 22 Aug 2018 00:51:28 +0200 (CEST) Date: Wed, 22 Aug 2018 00:51:13 +0200 From: Dominique Martinet To: Doron Roberts-Kedes Cc: Tom Herbert , Dave Watson , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] strparser: remove any offset before parsing messages Message-ID: <20180821225113.GA6515@nautica> References: <1533854411-28184-1-git-send-email-asmadeus@codewreck.org> <1534855906-22870-1-git-send-email-asmadeus@codewreck.org> <20180821145321.GA44710@doronrk-mbp> <20180821193655.GA15354@nautica> <20180821211504.GA76892@doronrk-mbp.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180821211504.GA76892@doronrk-mbp.dhcp.thefacebook.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Doron Roberts-Kedes wrote on Tue, Aug 21, 2018: > On Tue, Aug 21, 2018 at 09:36:55PM +0200, Dominique Martinet wrote: > > One of the solutions I had suggested was adding a flag at strparser > > setup time to only do that pull for users which cannot handle offset, > > but nobody seemed interested two weeks ago. I can still do that. > > This seems overly complicated. That sounds much simpler than adding a similar feature to bpf if it doesn't already support it -- we already have an user-provided struct at strparser init timer (strp->cb) in which it would be easy to add a flag saying whether the callbacks support offset or not. That's maybe three more lines than the current patch, which is also pretty simple, I'm not sure what you're expecting from alternative solutions to call that overly complicated... > It seems like we mainly agree that the proposed patch is suboptimal for > existing clients of the library that use offset correctly (tls). > > It also seems like you've identified that the proper fix is in bpf. I don't think bpf itself needs to be changed here -- the offset is stored in a strparser specific struct so short of such a skb_pull I think we'd need to change the type of the bpf function, pass it it the extra parameter, and make it a user visible change breaking the kcm API... And I have no idea for sockmap but probably something similar. I can't think of that as better than adding a flag to strparser. (Also, note that pskb_pull will not copy any data or allocate memory unless we're pulling past the end of the skb, which seems pretty unlikely in that situation as we should have consumed any fully "eaten" skb before getting to a new one here -- so in practice this patch just adds a skb->data += offset with safety guards "just in case") > As an aside, I would recommend reaching the netdev FAQ page: > https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt > > It contains helpful hints about how to format email subjects (specifying > net vs. net-next) and determining when trees are closed (currently > closed). Thank you for pointing out to that document. While this bug has been around from day one of kcm it is still a bug fix so I'd rather let maintainers decide which tree it goes to. I wasn't aware that net-next closes during the Linus merge window, but if you want to split hairs, the FAQ says "do not send new net-next content to netdev [while closed]" and this isn't new content as the v0 of the patch was mostly the same and sent before the 4.18 release, (and, ironically, did not get any comment). Anyway, sure, I'll wait until next week for a v2 if that matters. Thanks, -- Dominique