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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 7CDB4C54E4B for ; Tue, 12 May 2020 08:35:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5BC5B20674 for ; Tue, 12 May 2020 08:35:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="iJrsU4Rp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729118AbgELIfF (ORCPT ); Tue, 12 May 2020 04:35:05 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:45269 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725987AbgELIfF (ORCPT ); Tue, 12 May 2020 04:35:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589272503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Jcu7UayeiRoB+oPtxu5ro8xy76Yt5bLrrV9cfwYT0u4=; b=iJrsU4RpBOeI2JZmrs4gjEXDAw70a2sALlrFj6ODkZcIZf4xJsw1gbMamfgircUFcWQSPa 5gBQUVEJHltE4NeJzJLMxXjg8SWozTG3kY5BUHaOZ2Qqy7M8FKzmvqpUT0R9K/fLkcg2RC wH8xk004Ln9Y4Wyqnz/dODXZfNMzOFg= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-368-U-TncXLOMIqPoJonkjvbEg-1; Tue, 12 May 2020 04:35:02 -0400 X-MC-Unique: U-TncXLOMIqPoJonkjvbEg-1 Received: by mail-lj1-f198.google.com with SMTP id l5so1223022lje.23 for ; Tue, 12 May 2020 01:35:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Jcu7UayeiRoB+oPtxu5ro8xy76Yt5bLrrV9cfwYT0u4=; b=UNwgV3sQVSwtnkKI2dhkCD40rskMyb5Ti5TL+bo60wvm65W5ixSiWKfSJqJJnoXOwz JRprOWa8njUP3maLoKtJWETykE3a10vTn07wpzFFsePmp+HMXmsfabd17KkFs9laA+So 9t/14CbvFY8Or+CjMEcwKZZlRCMAFY138DkPy8oXSMdoP7V+uxTisu0usHHWT1BzsuhV ay3ljssQ51YFXHI5fPdvsFVtrPtZbSNlfJjoLy10bkYTHOVMvgISwr9kLi6dsZftubUh mLUy0vOC7OnwATWi2+2va+gdNrk+pft+tDWLDKZXFQMJT+6W13qsYkCoRBZ9WuhtziYS 7n7A== X-Gm-Message-State: AOAM531Nng6bn8O4DvmeyMqBOyjmwRro3gdF4Us2+STCqkYpbYPnJb95 McUrsyzLIqnpPe+a+gSiJoIpwurlCIIEWZxi3jsBhnMg/VEOEgEWmqVMuxoBoMXjPdphdvyqfLJ jH3DoKCP+ijKaVQ6c X-Received: by 2002:a2e:986:: with SMTP id 128mr9515209ljj.202.1589272500503; Tue, 12 May 2020 01:35:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFmvdz9SAXFfdnegZZctpbgnZj5hHOIAXiFoVO8Ry9W+nleEprJxW5rdu/858LPlqtM/tnwQ== X-Received: by 2002:a2e:986:: with SMTP id 128mr9515196ljj.202.1589272500266; Tue, 12 May 2020 01:35:00 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id y9sm12081878ljy.31.2020.05.12.01.34.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 01:34:59 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id BF311181509; Tue, 12 May 2020 10:34:58 +0200 (CEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Alexei Starovoitov Cc: Daniel Borkmann , Andrii Nakryiko , "David S. Miller" , Andrey Ignatov , Networking , bpf Subject: Re: bpf: ability to attach freplace to multiple parents In-Reply-To: <20200402215452.dkkbbymnhzlcux7m@ast-mbp> References: <87tv2e10ly.fsf@toke.dk> <87369wrcyv.fsf@toke.dk> <20200326195340.dznktutm6yq763af@ast-mbp> <87o8sim4rw.fsf@toke.dk> <20200402202156.hq7wpz5vdoajpqp5@ast-mbp> <87o8s9eg5b.fsf@toke.dk> <20200402215452.dkkbbymnhzlcux7m@ast-mbp> X-Clacks-Overhead: GNU Terry Pratchett Date: Tue, 12 May 2020 10:34:58 +0200 Message-ID: <87h7wlwnyl.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Alexei Starovoitov writes: >> > Currently fentry/fexit/freplace progs have single prog->aux->linked_prog pointer. >> > It just needs to become a linked list. >> > The api extension could be like this: >> > bpf_raw_tp_open(prog_fd, attach_prog_fd, attach_btf_id); >> > (currently it's just bpf_raw_tp_open(prog_fd)) >> > The same pair of (attach_prog_fd, attach_btf_id) is already passed into prog_load >> > to hold the linked_prog and its corresponding btf_id. >> > I'm proposing to extend raw_tp_open with this pair as well to >> > attach existing fentry/fexit/freplace prog to another target. >> > Internally the kernel verify that btf of current linked_prog >> > exactly matches to btf of another requested linked_prog and >> > if they match it will attach the same prog to two target programs (in case of freplace) >> > or two kernel functions (in case of fentry/fexit). >> >> API-wise this was exactly what I had in mind as well. > > perfect! Hi Alexei I don't suppose you've had a chance to whip up a patch for this, have you? :) -Toke