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 77EA19EA1F1 for ; Thu, 16 Feb 2023 15:13:13 +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=MZ6aTmIe DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676556792; 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=iQyyCrcAoDa9nMDlTSNO31EHryQcbdbDgQyMH3QiR1c=; b=MZ6aTmIe9ntcPnJAu3b8WAJ0yrlnn0WK9Pnm0n2ZOlteOsZztRAY09DXu0WvkNfhSLLA7n t0gLLFxFmWQQvzIUQSMz6D06pGZuM/QlvqPR0nG6C4Sb7tXvu1LzSXnMrsFTJ9e3pGw6rg YG2/Bxe5XGeKCad5B/1Ii0aDK8/PsPU= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-656-e0sGDRqWO1uy_hZQ2Fi3Rw-1; Thu, 16 Feb 2023 09:13:10 -0500 X-MC-Unique: e0sGDRqWO1uy_hZQ2Fi3Rw-1 Received: by mail-ed1-f72.google.com with SMTP id o21-20020aa7dd55000000b004a245f58006so1723875edw.12 for ; Thu, 16 Feb 2023 06:13:10 -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=iQyyCrcAoDa9nMDlTSNO31EHryQcbdbDgQyMH3QiR1c=; b=fIV8jI3lKUPMtBtZOQodwpjQwjz8k3plD8krezSsSDJ+8Em/3kAamhtmVzfgXDhgZx 5fHtCVm929gDjKO9ESCCFKSIy4jU9tDWLuFWajwVJQG7Ifl1UHR8z0fszQOjdfS96Uj7 h+s+cehLcka7im8mSJD/GDh0ILyquD7mLaf2nnJSG7VZqFRbTeGUSwUK9rIOonTeQNDq Selmp6PSnyP5b3JQKzHZKUe+WwyzSwFw/oA5ZMHOdSZLmradUWVJWQwv6hKgfZNQanL0 1WIo719d/CVE55Y3jQB/u0eazZQi0b45I73MsFgIqlRXGL60ErtuwIXm0hHDY8PdCqb4 GECg== X-Gm-Message-State: AO0yUKXhfSv6zCTZEKcBev9mA4cH6Ka6k3db9cW7W4bfhdLc2JNqGDW9 h1+vqbuIp5hWmi6CFZB8D6rlN6UnyAno5mab5t6GHA8PbCvj2k0oF3TpAO0Z7FMgxsdXi73o1tQ p3Yi4IN4Z4r3d/pMyXb0q X-Received: by 2002:a17:906:1c08:b0:87b:d597:1fd5 with SMTP id k8-20020a1709061c0800b0087bd5971fd5mr6648626ejg.75.1676556789349; Thu, 16 Feb 2023 06:13:09 -0800 (PST) X-Google-Smtp-Source: AK7set+b+3gudZdBL27uKxFTUYqUbYo4EY/MNLUXZgR59sohSBV711oDGlR2+MjZRoIKRL+wKt90kQ== X-Received: by 2002:a17:906:1c08:b0:87b:d597:1fd5 with SMTP id k8-20020a1709061c0800b0087bd5971fd5mr6648583ejg.75.1676556788677; Thu, 16 Feb 2023 06:13:08 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id h27-20020a170906111b00b00872c0bccab2sm857436eja.35.2023.02.16.06.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 06:13:07 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 65B99974632; Thu, 16 Feb 2023 15:13:07 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Larysa Zaremba , Jesper Dangaard Brouer In-Reply-To: References: <167645577609.1860229.12489295285473044895.stgit@firesoul> <836540e1-6f8c-cbef-5415-c9ebc55d94d6@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Thu, 16 Feb 2023 15:13:07 +0100 Message-ID: <87lekxsnpo.fsf@toke.dk> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Message-ID-Hash: O3VG3MU4DDX5N6FLP6K3FX3UJWP5E2F4 X-Message-ID-Hash: O3VG3MU4DDX5N6FLP6K3FX3UJWP5E2F4 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: Alexander Lobakin , brouer@redhat.com, bpf@vger.kernel.org, netdev@vger.kernel.org, Stanislav Fomichev , martin.lau@kernel.org, ast@kernel.org, daniel@iogearbox.net, alexandr.lobakin@intel.com, xdp-hints@xdp-project.net X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next V1] xdp: bpf_xdp_metadata use NODEV for no device support List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Larysa Zaremba writes: > On Wed, Feb 15, 2023 at 06:50:10PM +0100, Jesper Dangaard Brouer wrote: >> >> On 15/02/2023 18.11, Alexander Lobakin wrote: >> > From: Zaremba, Larysa >> > Date: Wed, 15 Feb 2023 16:45:18 +0100 >> > >> > > On Wed, Feb 15, 2023 at 11:09:36AM +0100, Jesper Dangaard Brouer wrote: >> > > > With our XDP-hints kfunc approach, where individual drivers overload the >> > > > default implementation, it can be hard for API users to determine >> > > > whether or not the current device driver have this kfunc available. >> > > > >> > > > Change the default implementations to use an errno (ENODEV), that >> > > > drivers shouldn't return, to make it possible for BPF runtime to >> > > > determine if bpf kfunc for xdp metadata isn't implemented by driver. >> > > >> > > I think it diverts ENODEV usage from its original purpose too much. >> >> Can you suggest a errno that is a better fit? > > EOPNOTSUPP fits just fine. An alternative to changing the return code of the default kfuncs is also to just not have the driver functions themselves use that error code? :) >> > > Maybe providing information in dmesg would be a better solution? >> >> IMHO we really don't want to print any information in this code path, as >> this is being executed as part of the BPF-prog. This will lead to >> unfortunate latency issues. Also considering the packet rates this need >> to operate at. > > I meant printing messages at bpf program load time... > When driver functions are patched-in, you have all the information you may need > to inform user, if the default implementation for a particular function is used > instead. If you dump the byte code with bpftool (using `bpftool prog dump xlated`), the name of the function being called will be in the output, which is also a way to detect if the driver kfunc is being called... -Toke