From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mail.toke.dk (Postfix) with ESMTPS id A4BD59CFAD4 for ; Wed, 14 Dec 2022 11:54:40 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dvRrYCbh DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671015279; 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=lATICyjc4Te5qDzlf7xVSBXOIwfGudOTKNOg//tLkfs=; b=dvRrYCbhm1xDluxnXLd2Zlq7czEt72Snvqqw883/1lqTFSwcYr3lcggi+IObd0rUTdpWgp hIqaMq5BooHt2O6DxXf3fmcQTC/fkxaRGYtCuiOJ0k7up2lQ8QpwWyAveV2xsctchceXNP 6Nki4e7lrRvPdB+fsy4h4O68YIgePZo= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-214-mwWMKFjUPUuYl_MOq6N9bQ-1; Wed, 14 Dec 2022 05:54:35 -0500 X-MC-Unique: mwWMKFjUPUuYl_MOq6N9bQ-1 Received: by mail-ed1-f70.google.com with SMTP id y10-20020a056402358a00b0046fc5125069so5985611edc.23 for ; Wed, 14 Dec 2022 02:54:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lATICyjc4Te5qDzlf7xVSBXOIwfGudOTKNOg//tLkfs=; b=ueKaqkxMzLceiKt4lVVswYJbeGoNb7ZZ2K+x82IPtBFa+69eNhfnsklOmsvRTj8pGl G7Kt9MiYpQ2FBkkHu4xyYjdQhOY2dvSbz2rfgEknjPkYoYcFaFaBwN4r0ALwuKRzh+5P vrJLfBXKJOaQQ8orw/kNcl2Xb5sFFVJ/9fFqNbF6xUxgjIHkarKixEM+AVZ/KmXKfNo6 w56JAEwQbostKfrhIUSjqC+Frt2ERDs+sJLMrdVPe2DsN4hvPpZMMVyodcklXTbWZF8r dVTha+QREL0N3lvYZQiFHrpu6NJlZgtaXQhEVtDZycaZNdjyu4z1NRJjJxNfyysNWJnn NT2Q== X-Gm-Message-State: ANoB5pm16DQYzOQZTEOXSPBSGUGBCpg4D8LFymPpbr5mWFZ3ZVPagfhs g0V0JDJx+4QZEhJsWwF6+VxWhYtzbIdimfRB6zvIeNheyj3+ZqKYKVgssi3//gVUpkCxVg8UMsb 7R3M4hfjMvXR2LMhL1Az7 X-Received: by 2002:a17:906:714e:b0:7c1:23f2:c052 with SMTP id z14-20020a170906714e00b007c123f2c052mr18515805ejj.45.1671015274518; Wed, 14 Dec 2022 02:54:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf5aktP68eWjNGtYhMxkwuKx1/hjsdVsA515iq6ye8JxvoV9dLdzUmgRMuzJKw7+BuWsbeOGhw== X-Received: by 2002:a17:906:714e:b0:7c1:23f2:c052 with SMTP id z14-20020a170906714e00b007c123f2c052mr18515778ejj.45.1671015274127; Wed, 14 Dec 2022 02:54:34 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id u18-20020a1709061db200b007c16fdc93ddsm3795670ejh.81.2022.12.14.02.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 02:54:33 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id BE15482F543; Wed, 14 Dec 2022 11:54:32 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Stanislav Fomichev , bpf@vger.kernel.org In-Reply-To: <20221213023605.737383-6-sdf@google.com> References: <20221213023605.737383-1-sdf@google.com> <20221213023605.737383-6-sdf@google.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Wed, 14 Dec 2022 11:54:32 +0100 Message-ID: <877cyugsrb.fsf@toke.dk> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Message-ID-Hash: UBVO3CPEPAQMHODYETVSESHBWVZQLZCO X-Message-ID-Hash: UBVO3CPEPAQMHODYETVSESHBWVZQLZCO X-MailFrom: toke@redhat.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: 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, sdf@google.com, haoluo@google.com, jolsa@kernel.org, David Ahern , Jakub Kicinski , 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 v4 05/15] 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: Stanislav Fomichev writes: [..] > diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c > index d434a994ee04..c3e501e3e39c 100644 > --- a/kernel/bpf/core.c > +++ b/kernel/bpf/core.c > @@ -2097,6 +2097,13 @@ bool bpf_prog_map_compatible(struct bpf_map *map, > if (fp->kprobe_override) > return false; > > + /* When tail-calling from a non-dev-bound program to a dev-bound one, > + * XDP metadata helpers should be disabled. Until it's implemented, > + * prohibit adding dev-bound programs to tail-call maps. > + */ > + if (bpf_prog_is_dev_bound(fp->aux)) > + return false; > + nit: the comment is slightly inaccurate as the program running in a devmap/cpumap has nothing to do with tail calls. maybe replace it with: "XDP programs inserted into maps are not guaranteed to run on a particular netdev (and can run outside driver context entirely in the case of devmap and cpumap). Until device checks are implemented, prohibit adding dev-bound programs to program maps." Also, there needs to be a check in bpf_prog_test_run_xdp() to reject dev-bound programs there as well... -Toke