From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) by mail.toke.dk (Postfix) with ESMTPS id E410E9C2D22 for ; Wed, 16 Nov 2022 21:53:55 +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=RhE3GguR Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-13bd2aea61bso21629032fac.0 for ; Wed, 16 Nov 2022 12:53:55 -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=iP31vGQdnwIPrJ8QzQNj6IEJAV4JOhauU9F/tjVw540=; b=RhE3GguRkPEMkXUWs2VadW6PJBaWq89Jp2SiJNlls6JRTE8mYi/tH3+hYfFUZ0awNq rdTLnbDvvlWtlAn3A555cdj2q43IH77zOkuCycZ6mFrhsSPGwqOBP1OSDhPtcf7hQ9Uh nBhTGXY8+aR5+OofMmshbAQ6DRpJRA8ISYwI6CAjBYKV/kixobp2iboEeAj9OigYFk72 a1zhGyWFXEKFadwEDR2szNIf2XMcpM1xf2pdDKd0I5r/92MynGASw1G5HYhkOA/0gZO8 L8EvcpXXPkNsSNYo/1L7zgzrl3I0l/c+Qrav01bX+9oVZ+23tSVX5NvZzAFjyqSnCWn1 A+gQ== 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=iP31vGQdnwIPrJ8QzQNj6IEJAV4JOhauU9F/tjVw540=; b=AkJZvtE5rSqdRuibmZ3sMnhWMHt8s6pAoPCN29HwsQUx36nbVpMs+IaIszy+2a5MhX NLdIXfRg41ME4asm/QItJLFAwcvx/rM3rWzh3mw63VPaBmrpV8Q9fSctEu+EWDbeUpRf 8KP7WNboLLc3MbrNlLE6j4Lu1lxKMRNPxOHqaqOAYFAjUXcMpqSVOVHMX9fflCyNr8PH FIy1evwgpo2kFBsqPnuCJDtZKaCKORh6XGj5BZBnlkL13y8oxUFs0XJr05BkMo9RGyPB 3oRtolUEtZptkmxHLZbU922lM3mY0V0irLMdUV7vqcl6Hq9FTJ5gEJ1V1PaiqYvjHI5+ 4jxA== X-Gm-Message-State: ANoB5pm76+GAQv0KTUgYh1mAVZaG+WUer7NEhN1SyCfiIzpqJcTCDAYp Ik7kGWZe1iEpnOI7yQVjU5hxD2V5xFaW4IRELvcFoA== X-Google-Smtp-Source: AA0mqf6eJxglnZ5l/hFZloPm9zgfAzleZbfH7DZTmauEcjQrsRWNmtnycEjocULM0ilXXaKoHeZDHShdBtF4/d0XM+w= X-Received: by 2002:a05:6870:e9a2:b0:13b:be90:a68a with SMTP id r34-20020a056870e9a200b0013bbe90a68amr2712686oao.181.1668632034425; Wed, 16 Nov 2022 12:53:54 -0800 (PST) MIME-Version: 1.0 References: <20221115030210.3159213-1-sdf@google.com> <20221115030210.3159213-4-sdf@google.com> <20221116124256.04a75fba@kernel.org> In-Reply-To: <20221116124256.04a75fba@kernel.org> From: Stanislav Fomichev Date: Wed, 16 Nov 2022 12:53:43 -0800 Message-ID: To: Jakub Kicinski Content-Type: text/plain; charset="UTF-8" Message-ID-Hash: VKKKRN3CLMIYL7GKGSDOXBMJPI63HEAU X-Message-ID-Hash: VKKKRN3CLMIYL7GKGSDOXBMJPI63HEAU 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.6 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next 03/11] bpf: Support inlined/unrolled kfuncs for xdp metadata List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, Nov 16, 2022 at 12:43 PM Jakub Kicinski wrote: > > On Mon, 14 Nov 2022 19:02:02 -0800 Stanislav Fomichev wrote: > > diff --git a/net/core/dev.c b/net/core/dev.c > > index 117e830cabb0..a2227f4f4a0b 100644 > > --- a/net/core/dev.c > > +++ b/net/core/dev.c > > @@ -9258,6 +9258,13 @@ static int dev_xdp_attach(struct net_device *dev, struct netlink_ext_ack *extack > > return -EOPNOTSUPP; > > } > > > > + if (new_prog && > > + new_prog->aux->xdp_kfunc_ndo && > > + new_prog->aux->xdp_kfunc_ndo != dev->netdev_ops) { > > + NL_SET_ERR_MSG(extack, "Cannot attach to a different target device"); > > + return -EINVAL; > > + } > > This chunk can go up into the large > > if (new_prog) { > ... > > list of checks? Agreed, will move! > nit: aux->xdp_kfunc_ndo sounds like you're storing the kfunc NDO, > not all ndos. Throw in an 's' at the end, or some such? SG. But I'll most likely replace this xdp_kfunc_ndo with something like xdp_netdev and to add proper refcounting.