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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AC91C001B2 for ; Fri, 9 Dec 2022 02:57:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229877AbiLIC5x (ORCPT ); Thu, 8 Dec 2022 21:57:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229865AbiLIC5u (ORCPT ); Thu, 8 Dec 2022 21:57:50 -0500 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D41A71A82A for ; Thu, 8 Dec 2022 18:57:48 -0800 (PST) Received: by mail-pf1-x42e.google.com with SMTP id a14so2772525pfa.1 for ; Thu, 08 Dec 2022 18:57:48 -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=59sNVbNTQV1F7VjGtBZlVBJs0rRYEOk8j4xJWkJPJs3AKjlQX3CtP7+l/TkDarkAMb sf283k+V6BFdqmeRbIPTHkNXXtnFJSN3V2zaoQFhK6f6DBnHy6evqNLYKZ2Y4CwJXxRy GdDHu0eH+HoHpE3UuGY8MCh1ZFy60POcPw7Fhk2XrjHHkPu97X4xs7nMCgQQcr6ONDVK zN1I+p+E1Nh+YNF5BhuRt/1VTOXO5VULdPy78IWhxZEPamC6GJ6hDirOrw+uYLysahIl LGz7EJXYmfrs4flqbVfcfwo1KpkeB3YLVfFjDFCPXsBklOqoCD3Nmj69Tgouggj+wA0+ D3Ug== X-Gm-Message-State: ANoB5pkQfgGzeXvyavzSlBWI3zI7cRSiwIJNFllj6QwYKL1gIG3PXSRT fnETXznl2xiLHWjsYHO+gX/0cvogColQBetq959PnA== 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: Subject: Re: [PATCH bpf-next v3 03/12] bpf: XDP metadata RX kfuncs To: Jakub Kicinski 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org 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!