Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp134664lqj; Wed, 10 Apr 2024 06:25:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVCPR57X/mQhBwl0CEo3uVYfAfdkNmcJH2vtQNWOFhfPuwUs2OAAuhbxUNcV/tBePAra1oWepH13OkaJq212Hao5braXLlqvatCPZ8lnA== X-Google-Smtp-Source: AGHT+IF1z3CnL7ihCsTM/ihu0fCvUFKT/0W6Ijz7UQ4/dyEhi/bJoNbu6gqVW0aYKYkwROoGVi8E X-Received: by 2002:a17:90b:205:b0:2a2:1eb3:6c6e with SMTP id fy5-20020a17090b020500b002a21eb36c6emr2208894pjb.28.1712755541310; Wed, 10 Apr 2024 06:25:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712755541; cv=pass; d=google.com; s=arc-20160816; b=lGfs5AeyakFvdNjmWxTTWrKTIOdWJ8Fv4gmuDw/ELdvFqoykljBlcLd//bz4w+D8Y5 ltLDbaNl/Bpw1WMLxGiezom7V9kGjlQ6SfOU8QMZWcW2E/xxP82hP+NT2PoNurAJIxNh 0KcqoR4vOK3/Q7099NJmbPb2Dvel+wAO6vDJI3LjvSvhlVdQvVlkPccxLB+iHIVo6Sqd xIM0DgsF+qMyPfaiHGxcPvcTaoA7kY8wc52ZLXAPCQz/Ano2IV8zI5+ISTfhIdFpMVXT hq25jfZAGg9CFxSGs0jxYE4D+MJMo3RZj6S6FROTKvaUpeoxxh60idhsOrYiSzv7MzDv xQeA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=Ajq0aujXCuZR/hPPmBZjzCDzXVdd1KsQBq3zyD6ZwFM=; fh=5dON7r4AtzD8+GS9VVEYm2xVWYtCEXbPhBa1K0Slz44=; b=AJjLXzXvaIORVIuxKjyaR7yqh4ppEGPesXxDCDrLqvVp7TZe2xeIzanOvxdUAZQl0z a7hsFzBjSMVqETw0kqF/5lcmRmVme1pQ90T5CMt1kk+UAWL/YDcX36Vb3jmEb2YziYDs 2X+8kkOTlRmgfEeoJKFAg3LKQqt2dSP3JkOSowjDGbPwpk3bPt+aHFFxC9HXqunDnhU7 EIPft4K0oq/nPH3Zqxf9PHs/zwbMqYPwIrb0YD2bHQ5KseoRopRn1RKTLQHDwFgvVxgw af+0jYgpaUIASHiSWESyICUW1jnqcRmD53q2UjVtZSV/+GIP2KyUOkyF3rL50lOMKvl/ MMbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AmJGkZwR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-138584-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x3-20020a17090a530300b002a266e11459si892386pjh.117.2024.04.10.06.25.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 06:25:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138584-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AmJGkZwR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-138584-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9DD3128C47C for ; Wed, 10 Apr 2024 13:23:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C75A15F404; Wed, 10 Apr 2024 13:19:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AmJGkZwR" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E71915E7F3; Wed, 10 Apr 2024 13:19:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712755170; cv=none; b=MFv5kMvvWq6MhAX6pOO8cBnE4+xSYfpCQulplP+x6vxZ4g/XH8PjGU9sFSBDosoCgqNF36gDA2CC4goftmN5D74foTKR5DDpYDQkUYObPIi9hrWJdraiWr9XwVCKDw0lc6PUbTVP0LQPeyuRg5dKPaOMNfFHCow/7rNokxXXyzU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712755170; c=relaxed/simple; bh=7se5ngO8xSqrBrYVcIfdidvmDgbPuUTqHOL6en4qQVU=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CSEm0WdNgSgO3wikbkEtfF3dtZlqKMzMTUxRtibv/vF9eMsZTzdE5NYmF6kMxSSihpSsOxeYbdVqGrZyHg0b6M090pWFTSj6DhKWyq3Dg/A6rKs2hKT9nFDpbMTn8itEg5KGQ/hcRfpkrF79PGmckB+EHiF4YdI1B/2wlcHF4kk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AmJGkZwR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15CDCC433C7; Wed, 10 Apr 2024 13:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712755169; bh=7se5ngO8xSqrBrYVcIfdidvmDgbPuUTqHOL6en4qQVU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AmJGkZwRmpXPRRQRM8thAnRLozPe+7AfndnUdcZZjePLeBqE8gLDqV85hwYfru1no OywxqhbWaSMnd3geADvxVHDihAnBTTlpe3zWU2AQqUGTklC9CXatBt/hMDMU6xnl83 ZCVybJQcpQqGwcrXHwZqziKzpgF/lT1iAOV4PF5sthyOEkvFCmE7ah0ddmOkMGhnLv ZOu1TSWObnVHMGJUNiqJYdGI3zNFrS7y9V2hum085QrwnmtI42NgBuo1YlQbnu+ntn AWt2FurM4UTJX/+NHbbvvWNgsSof58OjhWS1ZgYxI6tI/Wk1STSbcr/PaSgQ9RuUVE jSXLbC/s/+2DA== Date: Wed, 10 Apr 2024 06:19:28 -0700 From: Jakub Kicinski To: Rahul Rameshbabu Cc: Willem de Bruijn , John Fraker , netdev@vger.kernel.org, Praveen Kaligineedi , Harshitha Ramamurthy , Shailend Chand , Willem de Bruijn , "David S. Miller" , Junfeng Guo , Ziwei Xiao , Jeroen de Borst , linux-kernel@vger.kernel.org, kory.maincent@bootlin.com, andrew@lunn.ch, richardcochran@gmail.com Subject: Re: [PATCH net-next] gve: Correctly report software timestamping capabilities Message-ID: <20240410061928.712ff9a3@kernel.org> In-Reply-To: <87jzl5akh5.fsf@nvidia.com> References: <20240408180918.2773238-1-jfraker@google.com> <661550e348224_23a2b2294f7@willemb.c.googlers.com.notmuch> <20240409172838.247738f3@kernel.org> <87jzl5akh5.fsf@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 09 Apr 2024 21:40:46 -0700 Rahul Rameshbabu wrote: > > My gut tells me we force drivers to set the ethtool op because > > while at it they will probably also implement tx stamping. > > I think the logic should be the other way (in terms of the > relationship). A call to skb_tx_timestamp should throw a warning if the > driver does not advertise its timestamping capabilities. This way, a > naive netdev driver for some lightweight device does not need to worry > about this. I agree that anyone implementing tx timestamping should have > this operation defined. An skb does not contain any mechanism to > reference the driver's ethtool callback. Maybe the right choice is to > have a ts capability function registered for each netdev that can be > used by the core stack and that powers the ethtool operation as well > instead of the existing callback for ethtool? Adding a check which only need to runs once in the lifetime of the driver to the fastpath may be a little awkward. Another option would be a sufficiently intelligent grep, which would understand which files constitute a driver. At which point grepping for the ethtool op and skb_tx_timestamp would be trivial?