From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mail.toke.dk (Postfix) with ESMTPS id 21BAA9E9C54 for ; Wed, 15 Feb 2023 17:05:32 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=U/IVNMvF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676477133; x=1708013133; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=VyaFW8x5nVd+hNRKDXSixCBjw1sWadNMA60zaL2EYf4=; b=U/IVNMvFhjd3ksSSBNfn/yBHG27ROy09onfv7bdDOHk6iT5Ztz7uLNCH T3u0lt+HDB10UXZLi2SLVQ12lmvIhUHSA6wkJae4pA6WdJFmSS3evr927 Z1++KF5HMaHwRTii6bCJd+U0hQvDVJ6m5pBc99qBA2KlCfGgKnVe+TARe AsSTfLM83lS77ee+5ZY3TJUxks+M4+tLHG18furRx+xYgoE4NILilfwe5 mqkq45B0VWcnmWCKZ1k2BcBAIsieRKvVu+u1a6jPgjBxmuIn6FAhmRBBO P/iwPgLMzZBD2fFPI+MgGQCRQtM7n4mO6wx2vqiC8Kr/QpCFV5p1s0Cqo A==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="393866774" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="393866774" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 08:03:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="915205019" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="915205019" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga006.fm.intel.com with ESMTP; 15 Feb 2023 08:03:38 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 15 Feb 2023 08:03:37 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Wed, 15 Feb 2023 08:03:37 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.106) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 15 Feb 2023 08:03:37 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GqfJ535mdQ5u3fo1MBExpPDDndWK1WOSFbJBKn02twbcGlCG6T9r6NjAzwI6nGA1V6a1uIDIf36wKVzCK5xQBx1xUdpK+QjFldxCSXijWOTJ3FHX1d5pTfM6ZwCOATzZxUTqjZRyxzoytW3yzuvY6Y3caXeZEMi4W3Z14gprdJdiMh4G+yBBibXQb54dT46dmr1fRoqNgEZ/AgaH9vVE70lUbtFKMN6gzx3ODKCE9GgDhmYTuu6g92ZZ9FpWkSO0EwdbrBct+UUyBWsoehIcEbpzUyMCZLYFZxFv9C/peIRL2CAmnOHJ6bJidkLlrHGjcBtsQFDYxECNvO0oJCDMDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OF7uAWXiO8GdBhcWTlPbcKU5Rgll75Q1/DVVGgLxSKA=; b=IW/plhKM4sbDcXV2TGgzNw1kAyxyP7QVpePWu+WpIenD/xwXaURRs4lVp0tJ5jEU5Q2ZiwDkfCUKQl4B5kxaC5RoUsoQEvm+Hd7gqdvykONOrmHhBwp+UuInRYPTilLZ7mv8N89GIwoisLKGoe1UZYIeQW3ISSWDW6vvWYFTodYAaJNRQ0xLEp5NpBkL66eNSDG1gy+9pJLXRoP1EapDZPKJPwu4/lRuGF8DM6W7Sk960M2brZRFA6TdhkIzw4Tqy8mzpsGp3vmNxV58ARykHsScNQ7K8OWWk5WMl+//HdGGJcyQTOjoAv97C3fGJrX/n9wvvsWmBr9Q2azKceZnLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5471.namprd11.prod.outlook.com (2603:10b6:5:39d::10) by BL3PR11MB6434.namprd11.prod.outlook.com (2603:10b6:208:3ba::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Wed, 15 Feb 2023 16:03:33 +0000 Received: from DM4PR11MB5471.namprd11.prod.outlook.com ([fe80::b7b7:8e90:2dcd:b8e9]) by DM4PR11MB5471.namprd11.prod.outlook.com ([fe80::b7b7:8e90:2dcd:b8e9%8]) with mapi id 15.20.6086.026; Wed, 15 Feb 2023 16:03:33 +0000 Date: Wed, 15 Feb 2023 16:45:18 +0100 From: Larysa Zaremba To: Jesper Dangaard Brouer Message-ID: References: <167645577609.1860229.12489295285473044895.stgit@firesoul> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <167645577609.1860229.12489295285473044895.stgit@firesoul> X-ClientProxiedBy: FR3P281CA0066.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4b::17) To DM4PR11MB5471.namprd11.prod.outlook.com (2603:10b6:5:39d::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5471:EE_|BL3PR11MB6434:EE_ X-MS-Office365-Filtering-Correlation-Id: 45bd28ab-40e7-4157-26ad-08db0f6e301c X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XckRpkw04xdogpwGvmjjWdUGQLy2hGwdOs72qQAcdoHMXMHlrjohqczBIwKYWgvFIbYDtW3yq+w/ao0HUBa5/5rYBUQm5xkkW4sXMBkWxnV5dNFMh4NDR0Eiyrll8/uEacIsnvI1xLVgYX2+DwFA3XToTBqlwwOtmEJvRTOwtXQCvsIT5bQNyr2QpkuEQfTcGiox/yRn5CkAIVobmybwQEh5EECsDClNysfLvrknh9QCsPS5m7DrnZSGrovLZkvli8eYxs5u/pMKQLamXO8CR//+El1AOng9R0+IGsrcHQUqWkikl6dC9S9QDl1iCzcOtNIILPlmYA4ZWca3UjG24Uvv4cxojum9UYyCCQp9kPk0RSbIsHulGur1cc53vrMYdNBm6eWZBZ7PG887AsNAF0V2Z259eUQ1NJjSVz1YnyTqw3ljcEBtPoD7YFRW1ztyYx4Nv1i0A2I0VdMHHkDTBgqyy3pTzGBxj86CJ8CNZ/snyMCt7hjyn2s5fbuU8Gbgyu0pnKOYWy5GcUOELSeYWTrg9D4mac4HA8r8QXVMmGtUcthBvCwrlT8b2p3SEHnfja+knfZp08oBoGkNhjG5EmXZafZgzUGuWlM7rHwPSJF8GJ8wTR5fN+pC/y9e7FQ/lMGwf16trE8URjcZDVQ1Lw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB5471.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(7916004)(346002)(39860400002)(136003)(396003)(376002)(366004)(451199018)(83380400001)(478600001)(6486002)(6506007)(6666004)(9686003)(186003)(6512007)(26005)(44832011)(38100700002)(41300700001)(82960400001)(5660300002)(86362001)(8936002)(33716001)(316002)(66476007)(66556008)(2906002)(66946007)(4326008)(6916009)(8676002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?UwHPa0x96p7ydAraLNQxHM9Uyr454S71GsD8cTDFaq7HLJCRr7iQnmBaPxDH?= =?us-ascii?Q?OmDl3GDMZ3BousMhhkhhrvjuTsyZliW8YGEkNurp0N4bZwK1ccxsnzBNFMWP?= =?us-ascii?Q?6wEwotCcvVZNBIQA7Y7uUdrT4RByVc8Qr1l9mq0F7Oz4VhMDKwLVp4caQYla?= =?us-ascii?Q?J406NbWnSTRkBeeIv6qep3/ZZu8bWQqB3apwFAdHPG1BLHH3IdiV5n56mc0m?= =?us-ascii?Q?ifwsb/kFOee+LSnt4bnmUD8ZwRhg0B3DaiLxHEUlXNpNWqGuUwzKNM8+QAf0?= =?us-ascii?Q?J2M1Wh/Y4EgQYLxCx99ccs3sqITsfJrvX4EzKi5kgH3vB53X5yjACJrbTAKE?= =?us-ascii?Q?lhe4fXkzOmStqn/jlJO5qdkYrQ+6GwHGTGGmci+jlbROPQk/klj0gIoNV/7u?= =?us-ascii?Q?MchZlbNqQpu2vmp8+/YyF9LXMbaibqrjjb50A1uvBL5j/DcfG0KuN7yTMnlE?= =?us-ascii?Q?fjqfxP4iz+wDFKGp6ZpDN3b0jyDb7044d3gnKoZkidpwg/6+vMeE/yqtLMn0?= =?us-ascii?Q?UdJF+gXXHzHHnC3Gy8Ryx/CHblZTj0q3EqQXhSoSiZxwGlZb1+fOlKheVu/S?= =?us-ascii?Q?DVUY8uBc8H+I7xUyNwpKzLTraspcYZnZt7Ev/zYcOEI5b6Jy8/uM4D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f+bQ4FuvQAhopicDJTG1q43UoZPe/UYdyR2MZ16u?= =?us-ascii?Q?+oMBQ3EL50jX9jj9pi7LeXtKpc3H12blG8Mq7g6LK6EeWl9VjDqAZ3IaVmKN?= =?us-ascii?Q?8A=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 45bd28ab-40e7-4157-26ad-08db0f6e301c X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5471.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2023 16:03:33.3819 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kuVJEcsHJCqRBkTk6oE5wLlVozj3WJtSV+mVzaDCD/o7GoaAnMRMPQOURtZsKbdz7hOPVbkBZPchVlLbOU7nRNe/BnS6+5v3Eag6Uavqy1E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR11MB6434 X-OriginatorOrg: intel.com Message-ID-Hash: 6TBENFMA7QNQOQVASJMBGHJRZZHG2PI2 X-Message-ID-Hash: 6TBENFMA7QNQOQVASJMBGHJRZZHG2PI2 X-MailFrom: larysa.zaremba@intel.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, 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 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. Maybe providing information in dmesg would be a better solution? > > 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? > > Signed-off-by: Jesper Dangaard Brouer > --- > net/core/xdp.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/net/core/xdp.c b/net/core/xdp.c > index 26483935b7a4..7bb5984ae4f7 100644 > --- a/net/core/xdp.c > +++ b/net/core/xdp.c > @@ -722,10 +722,12 @@ __diag_ignore_all("-Wmissing-prototypes", > * @timestamp: Return value pointer. > * > * Returns 0 on success or ``-errno`` on error. > + * > + * -ENODEV (19): means device driver doesn't implement kfunc > */ > __bpf_kfunc int bpf_xdp_metadata_rx_timestamp(const struct xdp_md *ctx, u64 *timestamp) > { > - return -EOPNOTSUPP; > + return -ENODEV; > } > > /** > @@ -734,10 +736,12 @@ __bpf_kfunc int bpf_xdp_metadata_rx_timestamp(const struct xdp_md *ctx, u64 *tim > * @hash: Return value pointer. > * > * Returns 0 on success or ``-errno`` on error. > + * > + * -ENODEV (19): means device driver doesn't implement kfunc > */ > __bpf_kfunc int bpf_xdp_metadata_rx_hash(const struct xdp_md *ctx, u32 *hash) > { > - return -EOPNOTSUPP; > + return -ENODEV; > } > > __diag_pop(); Documentation contains the following lines: Not all kfuncs have to be implemented by the device driver; when not implemented, the default ones that return ``-EOPNOTSUPP`` will be used. If you decide to proceed with current implementation, you'd need to update them in v2. > >