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.129.124]) by mail.toke.dk (Postfix) with ESMTPS id 19F669E9CE4 for ; Wed, 15 Feb 2023 18:50:16 +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=Q3QBLJSp DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676483415; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SYt3GY5lyZNnxZGhWHCPOfmt09yQokio9neVGfzdx1g=; b=Q3QBLJSprPGL+COaG74YgiKyU3PSr95TNVtXxzHEWTTRINHqwVQ4OezYv5LO/lOqVtgZlT LRhbF9e7uFBHvZz+ROGlR5VTGCE1wMH7zWjyxagDEwrikPuZRaqD86DCBi4vdxrlMfTAek tSguXIZ92O5zeGSanmSfHzHHKQXu97o= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-47-inxozvhrNSeP6yMPcQiocg-1; Wed, 15 Feb 2023 12:50:14 -0500 X-MC-Unique: inxozvhrNSeP6yMPcQiocg-1 Received: by mail-ed1-f71.google.com with SMTP id fd23-20020a056402389700b004aaa054d189so13392768edb.11 for ; Wed, 15 Feb 2023 09:50:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:to :content-language:subject:cc:user-agent:mime-version:date:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SYt3GY5lyZNnxZGhWHCPOfmt09yQokio9neVGfzdx1g=; b=kC9IpSK+PdHiNoXWEg2sNsx0L1rEMpMng/XDEZpfsz95AZ9ysOxaBEU6uftZE1D4rJ Lxl4huAcizCWwiNzLKlFZ4TLyNZhbAj1gvasUm1v8RnJXf+AoW7JKjDnZSJXq/tGqVAs WMjJHpTrhEZcOI39XzFoIf1CNA0pjlSX+OSRfs4DQgtLCD5nXflpN2d8eKVf2GqAgfof lnYoKPrJBXykhJ6Bwt8iDaOf4QtPPYlhNSSYUA82h0wEdOwFX5XcNkOTxE4f7Hb3wh58 xGdD52ZZIoi2JbYYkNTawsHEVtcAXMSrM+HihwbxsgdgYW+x2Ctf0Nj0mgMv5wDjQMky jSyA== X-Gm-Message-State: AO0yUKVLrQByJlfL+skE15zpIsdhck1qv7n2eSnmLVYqF9gPrJbJhiDZ ayxDlp66t33hmI+HeNCP5CPvzDBRtM7zphBl/mL/nFwCsOLnHcHBsQG65Rq+/cj3yxyZc9pnnOo Tv+bm6geDZMFgtqRXkNWC X-Received: by 2002:a17:906:90c9:b0:8aa:502c:44d3 with SMTP id v9-20020a17090690c900b008aa502c44d3mr3476282ejw.41.1676483413268; Wed, 15 Feb 2023 09:50:13 -0800 (PST) X-Google-Smtp-Source: AK7set9iIEgIIHlQTWzeKg0vskVXkoTDY8HQYB5bO3uIfG7SXwTSIum98IjhBq2cgl22xVLcdUdT4A== X-Received: by 2002:a17:906:90c9:b0:8aa:502c:44d3 with SMTP id v9-20020a17090690c900b008aa502c44d3mr3476267ejw.41.1676483412999; Wed, 15 Feb 2023 09:50:12 -0800 (PST) Received: from [192.168.42.100] (nat-cgn9-185-107-15-52.static.kviknet.net. [185.107.15.52]) by smtp.gmail.com with ESMTPSA id b15-20020a170906660f00b00871075bfcfesm9835089ejp.133.2023.02.15.09.50.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Feb 2023 09:50:12 -0800 (PST) From: Jesper Dangaard Brouer X-Google-Original-From: Jesper Dangaard Brouer Message-ID: <836540e1-6f8c-cbef-5415-c9ebc55d94d6@redhat.com> Date: Wed, 15 Feb 2023 18:50:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 To: Alexander Lobakin References: <167645577609.1860229.12489295285473044895.stgit@firesoul> In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: MTADMYMVB2Q5GMJUZAXUTJVWZU6MOPP5 X-Message-ID-Hash: MTADMYMVB2Q5GMJUZAXUTJVWZU6MOPP5 X-MailFrom: jbrouer@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: brouer@redhat.com, Larysa Zaremba , 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: 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? >> 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. > > +1, -%ENODEV shouldn't be used here. It stands for "no device", for > example the driver probing core doesn't treat it as an error or that > something is not supported (rather than there's no device installed > in a slot / on a bus etc.). > I wanted to choose something that isn't natural for a device driver developer to choose as a return code. I choose the "no device", because the "device" driver doesn't implement this. The important part is help ourselves (and support) to reliably determine if a device driver implements this kfunc or not. I'm not married to the specific errno. I hit this issue myself, when developing these kfuncs for igc. I was constantly loading and unloading the driver while developing this. And my kfunc would return -EOPNOTSUPP in some cases, and I couldn't understand why my code changes was not working, but in reality I was hitting the default kfunc implementation as it wasn't the correct version of the driver I had loaded. It would in practice have save me time while developing... Please suggest a better errno if the color is important to you. >> >>> >>> This is intended to ease supporting and troubleshooting setups. E.g. >>> when users on mailing list report -19 (ENODEV) as an error, then we can >>> immediately tell them their kernel is too old. >> >> Do you mean driver being too old, not kernel? Sure I guess, I do mean the driver version. I guess you are thinking in the lines of Intel customers compiling Intel out-of-tree kernel modules, this will also be practical and ease troubleshooting for Intel support teams. >>> >>> Signed-off-by: Jesper Dangaard Brouer >>> --- > [...] > > Thanks, > Olek >