From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 928DAC433EF for ; Tue, 21 Sep 2021 23:02:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76CFC61168 for ; Tue, 21 Sep 2021 23:02:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229628AbhIUXEY (ORCPT ); Tue, 21 Sep 2021 19:04:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbhIUXEY (ORCPT ); Tue, 21 Sep 2021 19:04:24 -0400 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14A4CC061574; Tue, 21 Sep 2021 16:02:55 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id 73so3123035qki.4; Tue, 21 Sep 2021 16:02:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hKQQwmeziLQV3Zl8Z6GcoEmhM45LZd29KWKMsYh23DE=; b=ahCBou0Zc5Zw0Ae4Zgdi+EF+F4azkDGzbS9dBhFYXf+aRUXuXznNpCHOnDr0bf4rCA fCpAMCTC/3WwAo3sBtLHLUBdtKsHw2pmWh6WksKV2eZDtziH/5INZQxuPBvA6/Lye++Y K0ZPSINcjVdf5C7zLAf++qrHvUP14jM9lKee8lr2Et7z9w3g3j2h7nOZTm849oBmN8cM YyrYMP/AtgTAQGQnF0ZUC3y2gVf1kjT0IYtDEch1+J7kFDiQCf3cLiNFdpKz6fgl5K5/ 8hz7E3G1X7d8nHRKNXJIPSHmAx89XaCQTLTgfolsiAsPGTbpiihNEDITRRJRcK2/HhFQ gDFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hKQQwmeziLQV3Zl8Z6GcoEmhM45LZd29KWKMsYh23DE=; b=ov+8TzkLdlp78uDreYd9n/agDzwglM16cK+f5qxc2mUKNjjo2HZ5ZvZV+FQ3jD+8SP uub9c1PGR2hF7JMaKEtAIeRYonkEUnazgNo22Y5FX8UcVyg8RSh+7nYgo2MlltAvWqiC GMY6JWx3KyFthOh42vBghrlx1nfumuKgKW25VB8cuwNiNj/MMjH8aGa/vQPFkzH0xc90 zgYQES2Jasmi3Sd47GBg+5qCg53/rGGpn+QILu2GzaHjOTnWY+uejDIPQkmZjsuGjZUX 1l63bdGVbPCO/Du897RTuAn+ISqXTpA3TOIfMLnPwFF555+Jj5wUKmSSFq7t4TIWznRO vIPw== X-Gm-Message-State: AOAM533MX2Zm3zqGpGfm9kTsjXQUBL+ecLOkreLE3ml31xMNftMndRxW ov8j8t4Nlox5X49dVReGYkZ76XrDv+a+iP92VIw= X-Google-Smtp-Source: ABdhPJzZUkzfuWUQgF9JMzt8Ys1MIQz7T6Bzuq1WGLycqAXY3BsfCDksBmnUdTuJHyvV+4JspIBIfNIANPei3Le+gUY= X-Received: by 2002:a25:47c4:: with SMTP id u187mr44409544yba.225.1632265374225; Tue, 21 Sep 2021 16:02:54 -0700 (PDT) MIME-Version: 1.0 References: <20210920141526.3940002-1-memxor@gmail.com> <20210920141526.3940002-6-memxor@gmail.com> <20210921222348.4k6lg6jb73qcfpok@apollo.localdomain> In-Reply-To: <20210921222348.4k6lg6jb73qcfpok@apollo.localdomain> From: Andrii Nakryiko Date: Tue, 21 Sep 2021 16:02:42 -0700 Message-ID: Subject: Re: [PATCH bpf-next v4 05/11] bpf: Enable TCP congestion control kfunc from modules To: Kumar Kartikeya Dwivedi Cc: bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , Jesper Dangaard Brouer , =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , Networking , Jiri Olsa Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Tue, Sep 21, 2021 at 3:23 PM Kumar Kartikeya Dwivedi wrote: > > On Wed, Sep 22, 2021 at 03:48:55AM IST, Andrii Nakryiko wrote: > > On Mon, Sep 20, 2021 at 7:15 AM Kumar Kartikeya Dwivedi > > wrote: > > > > > > This commit moves BTF ID lookup into the newly added registration > > > helper, in a way that the bbr, cubic, and dctcp implementation set up > > > their sets in the bpf_tcp_ca kfunc_btf_set list, while the ones not > > > dependent on modules are looked up from the wrapper function. > > > > > > This lifts the restriction for them to be compiled as built in objects, > > > and can be loaded as modules if required. Also modify Makefile.modfinal > > > to resolve_btfids in TCP congestion control modules if the config option > > > is set, using the base BTF support added in the previous commit. > > > > > > See following commits for background on use of: > > > > > > CONFIG_X86 ifdef: > > > 569c484f9995 (bpf: Limit static tcp-cc functions in the .BTF_ids list to x86) > > > > > > CONFIG_DYNAMIC_FTRACE ifdef: > > > 7aae231ac93b (bpf: tcp: Limit calling some tcp cc functions to CONFIG_DYNAMIC_FTRACE) > > > > > > [ resolve_btfids uses --no-fail because some crypto kernel modules > > > under arch/x86/crypto generated from ASM do not have the .BTF sections ] > > > > > > Signed-off-by: Kumar Kartikeya Dwivedi > > > --- > > > include/linux/btf.h | 4 ++++ > > > kernel/bpf/btf.c | 3 +++ > > > net/ipv4/bpf_tcp_ca.c | 34 +++------------------------------- > > > net/ipv4/tcp_bbr.c | 28 +++++++++++++++++++++++++++- > > > net/ipv4/tcp_cubic.c | 26 +++++++++++++++++++++++++- > > > net/ipv4/tcp_dctcp.c | 26 +++++++++++++++++++++++++- > > > scripts/Makefile.modfinal | 1 + > > > 7 files changed, 88 insertions(+), 34 deletions(-) > > > > > > > [...] > > > > > diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal > > > index ff805777431c..b4f83533eda6 100644 > > > --- a/scripts/Makefile.modfinal > > > +++ b/scripts/Makefile.modfinal > > > @@ -41,6 +41,7 @@ quiet_cmd_btf_ko = BTF [M] $@ > > > cmd_btf_ko = \ > > > if [ -f vmlinux ]; then \ > > > LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J --btf_base vmlinux $@; \ > > > + $(RESOLVE_BTFIDS) --no-fail -s vmlinux $@; \ > > > > I think I've asked that before, but I don't remember this being > > answered. Why is this --no-fail? > > > > Sorry, the first time, I missed that mail, and then it was too late so I decided > to put the reason in the commit message above. > > > > [ resolve_btfids uses --no-fail because some crypto kernel modules > > > under arch/x86/crypto generated from ASM do not have the .BTF sections ] > > I could add a mode that fails only when processing a .BTF section present in > object fails, would that be better? Oh, missed [ ] part in the commit message. But yeah, it feels like it shouldn't be an error if the module legitimately doesn't have a .BTF section. Is it an error right now? cc Jiri, maybe that was intentional > > -- > Kartikeya