From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by mail.toke.dk (Postfix) with ESMTPS id E90689CD5CF for ; Fri, 9 Dec 2022 03:57:50 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=GyiB/ru/ Received: by mail-pf1-x42c.google.com with SMTP id n3so2746647pfq.10 for ; Thu, 08 Dec 2022 18:57:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZN6Ds0GTGoNBiJrF9Iw5CyP8TuCwXyyFiKu0u0AYj3o=; b=GyiB/ru/0wWy627fKFRf5xcbvQS0BJ8wjivpjdLr/jysYEYsWgTjKhZgqS613S0SYH 3RH06S7roc5hcQ2Q/Rgsrc5POIfClXZ+C5qNT+Qf6u37GTguwWGJTo8ULTS9ZBAylSP/ GpLP4GiSwaQXLCtUNM0cU8NZhL3HVlColoQBwrIGxO72Vfl0/0rTkUw/JpfvvwSeFwNC sBzbDLcEum7Z5NencBueTDev53cKyjRJ47rC92ZO6wpYXK0wjy7W1Q63xVUypB83ORRL Bx3Iu9G9X3E9RysOQOzjN7nx5thaYbL8isfylMs8WJKUBrCnQENKOmcrX4J30rIfqvW8 BPKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZN6Ds0GTGoNBiJrF9Iw5CyP8TuCwXyyFiKu0u0AYj3o=; b=XJTVQb0rUby7S1SaBl1QHdES4FM9RsmIH1hyuf1fi4uf5fjcmjKz3WTL3y5yKrAoWU P0OcjWc8BAuEtWLAEUlCP0n3NcXkENjJziGMBlpTEdF9CbLpFt/bCAK2e1LuNRqoHrdX LT4zxd7dFhl9hnYBwdAFov3Jfq/MNDptn4BdB/TP9P+44aJ8Rb+/LYTZ3HV+NOgrMyVK n1ArRUh/pkm1bTm0AypULtQrLDiVLmjeaNy3U6/BPWlV6UpX3qGoiVYnAY5AAZ3sSDAJ EwThd8iAIbIbKxnNC55R+2/JgCZdx2mCAzbmn62pMbptUi2U+4qFvZNIh1Co0kfAfTEC rfsw== X-Gm-Message-State: ANoB5pn141csgIhwealcxP1YtZ8ZFrvE3SyWoKrMdJozY0uNJ76rQ852 +y9mYMefPOM/Q6F+vMLlZH9pfCZ1ykymwLVUyNKlGg== X-Google-Smtp-Source: AA0mqf6h7cGJ0arIuPLaA3bnYaBrIgzkzfJ4sPigj43qbYngE+KpkAKk8+NEqmPC3E2BU2h8mlvavmvG1riFJPLdpV0= X-Received: by 2002:a63:2160:0:b0:46f:f26e:e8ba with SMTP id s32-20020a632160000000b0046ff26ee8bamr71539985pgm.250.1670554668099; Thu, 08 Dec 2022 18:57:48 -0800 (PST) MIME-Version: 1.0 References: <20221206024554.3826186-1-sdf@google.com> <20221206024554.3826186-4-sdf@google.com> <20221207210019.41dc9b6b@kernel.org> <20221208173053.1145a8cb@kernel.org> In-Reply-To: <20221208173053.1145a8cb@kernel.org> From: Stanislav Fomichev Date: Thu, 8 Dec 2022 18:57:36 -0800 Message-ID: To: Jakub Kicinski Content-Type: text/plain; charset="UTF-8" Message-ID-Hash: GTZHGYX4ANX4QW4UM3HVIJZJ4HOG3HNX X-Message-ID-Hash: GTZHGYX4ANX4QW4UM3HVIJZJ4HOG3HNX X-MailFrom: sdf@google.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, haoluo@google.com, jolsa@kernel.org, David Ahern , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org X-Mailman-Version: 3.3.7 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v3 03/12] bpf: XDP metadata RX kfuncs List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, Dec 8, 2022 at 5:30 PM Jakub Kicinski wrote: > > On Thu, 8 Dec 2022 11:07:43 -0800 Stanislav Fomichev wrote: > > > > bpf_free_used_maps(aux); > > > > bpf_free_used_btfs(aux); > > > > - if (bpf_prog_is_offloaded(aux)) > > > > + if (bpf_prog_is_dev_bound(aux)) > > > > bpf_prog_offload_destroy(aux->prog); > > > > > > This also looks a touch like a mix of terms (condition vs function > > > called). > > > > Here, not sure, open to suggestions. These > > bpf_prog_offload_init/bpf_prog_offload_destroy are generic enough > > (now) that I'm calling them for both dev_bound/offloaded. > > > > The following paths trigger for both offloaded/dev_bound cases: > > > > if (bpf_prog_is_dev_bound()) bpf_prog_offload_init(); > > if (bpf_prog_is_dev_bound()) bpf_prog_offload_destroy(); > > > > Do you think it's worth it having completely separate > > dev_bound/offloaded paths? Or, alternatively, can rename to > > bpf_prog_dev_bound_{init,destroy} but still handle both cases? > > Any offload should be bound, right? So I think functions which handle > both can use the bound naming scheme, only the offload-specific ones > should explicitly use offload? Agreed. Will rename the common ones to dev_offload!