Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2021713lqe; Tue, 9 Apr 2024 07:31:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkcefmZYlhlNLy1kgwcr8ctPC7mzmPHNZe3uugxicCTAupzDaMv1BUs3lF/50bw/pmF6+k+eFMZW6joom38Ez9PFhPwfEhSia09/jePg== X-Google-Smtp-Source: AGHT+IGrS0HEk+wBTCq8rJIxQZBXKlS8vvGfPZmOJBgjtvLYuO2xHWgpoMVD6bkn5kJnrkZ0xfKQ X-Received: by 2002:a17:906:b7c4:b0:a52:1be:f4a6 with SMTP id fy4-20020a170906b7c400b00a5201bef4a6mr459354ejb.21.1712673080295; Tue, 09 Apr 2024 07:31:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712673080; cv=pass; d=google.com; s=arc-20160816; b=RKg2Xv5ojJzW5ivWRwzjILqI8jjVI2L+OHCjyAUtPaazhFVJSG0XAiTH2HsMgXwjPH o0C5i/4Ahx7zfPuCEs2K15xV/hUars+CgHOXE9+OR46WxZPe1WKD3FlDDfutLJoziUsB eeMSRE0ZZHVv0xWIThTiSB2FlSOAQW9D+4vcvrbVae3ZiwUl3SJgSDobJq1geX95IvhV fmjXgBD+v3JtBcUnjxaUzHqc1WH0khIUqQnHCYXkSYO8TawdRXNGPZDLMDlf2PFIgoVt SfNmfPpR12mNF0/ZbVpXhkj++5/mhyTduTKdGpqKoyvWrpbASaMx2EJDsbkaQwPK32sn 0l7g== 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:subject:references:in-reply-to :message-id:cc:to:from:date:dkim-signature; bh=3sM7X07lq+AmKzTRDmOr5Z6+b5U2BleqB4mAYHqNgns=; fh=zhwZP+gxjbjAdLBMTiV9xheFV/9UrSKFW0VaPRDyYoY=; b=EiZ49mlDm23+DrbHd6atnD3Z2IS4GyC6VAGELMyyFNf5xDU3+k7rkyivGzb+l8u7Vp 8lYuOz2aBbMEZ3QTpV0VlW84ROVwAagPnFgM22L1hVqUPM1MBZtn2NJaLQcxGcnNhSuu BZ/hVLkANC438NVuv9TcD23Ts8RDwPXiTuEwVzayWxI6AxrDLSm65/XC4pC84OAIXJMJ /eMCayjJDQRpfICZ8FoGO1IxGMgm8DjwDOIwFKf8DOh2xs8W5fgb8c4pjTzMhX//cIWQ qkCPb/ipSUOBBOyuo159drisQ6mMuTKZTOY8srG1eX26x2vQplwLHBotXLsUlqeLC6Ag N6Tw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SpnTAMiZ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-137095-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137095-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e18-20020a170906315200b00a51c13876e1si3459506eje.372.2024.04.09.07.31.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 07:31:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137095-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SpnTAMiZ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-137095-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137095-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id BC8021F26347 for ; Tue, 9 Apr 2024 14:31:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F2B1130E53; Tue, 9 Apr 2024 14:29:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SpnTAMiZ" Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39567130AF0; Tue, 9 Apr 2024 14:29:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712672998; cv=none; b=fQbJl49eU4hJi+BbykUBQnAK6fnFQM6ukxeD3bwzdN0ur/A8rW+d2dvQqpfEJRSAkJKSUTIVZ8tXemWa/BKzkP4+I1mE/qwLDCQSY/v4mBYrbr4oNoBYKcRN5/Z3syKXywFrcJu7u6NkY0xtnOZa6mEMklTL4C762sEDD8ZJp7U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712672998; c=relaxed/simple; bh=Ag5XnqNucISfEvIbIkrbr8gYzPOeP7XpP2zxkk7XaU0=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: Mime-Version:Content-Type; b=cSHhj8ZBt/ysnmlnJ+08dqp1n2pw+xJfUHcfTGfnLbQ5DbBUUj7fQ8UPMYgud449G78ZbGbyZdZshuIBxC4AOSYnOm3y/mcjd/+cEy3kaLrUg4LruU8ikuHwCorTgPuRLs4o6yLf8Bi5q3NxwBWhHMsSv0lHjxOFl8ycE7c7D2E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SpnTAMiZ; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-69b236a942dso13135316d6.0; Tue, 09 Apr 2024 07:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712672996; x=1713277796; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=3sM7X07lq+AmKzTRDmOr5Z6+b5U2BleqB4mAYHqNgns=; b=SpnTAMiZuqMtN3llmrDk+ExAmMKiXUDe37yeWS6sQqN1aLI1To6syuKUxh8dYWtfkA UVA8Nyprp+X9P3Y6UiN1kvi2bV/bNYKe3xnW8N2Y0FhY4NQBDs7w3FCB3w4hmUfphRaq WSocGMXDGH9ilMgjTlJP4lr0t8pvMXsPkY0ZBO0ND7+NtjD9V99+zyf0oq5iM+Wb4YEM KIJ54JhXop+xix50BJiis0RJ5cvbTyK20Dvc9E2Tx0f//9lHDlS5DN8Focf9NDvEbORw Hqjgl7wJ/DYsQSQXaBK3pNFuPoNmaApbGNywVQlO9rJ1S4faK6eCx6rB613WYBcMaheb mzFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712672996; x=1713277796; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=3sM7X07lq+AmKzTRDmOr5Z6+b5U2BleqB4mAYHqNgns=; b=eungpY9T1r/OA/u3Qnoa/7HmMKnHUwUlwEqGiyXMNvzieI5fn5I8R2aKIx1cQEb1zw MqyAZWOMTSSURzWQhEtXyYOqTiG7sfCWYhHO2K/fe0PILEQcrPyG4QK6PDXjTS5dKulK SOMbq+ny66trsGyxxoUiaPXln/8GhyMPl0vM3inrvRvPGKJOJuT468XCBQG/nr9ftN4f w9jUv3+BrmQE+I0HYSjFGCy8Ll+UJoXPC3wS3EeKK6JB0J38EAnuba7Uwz3xjkZwVfz3 ZqLJ8Tbqq2NOMvF//DkAMyJeB7VHTIwM10uiVNairsj0/cUtuaUo8jfKHK/1P53wmHSq Hd9w== X-Forwarded-Encrypted: i=1; AJvYcCUFwlRsARLp/IPZoAoWt2g7H/HfwU9Fni84QvW9r9suQDLKNXHLYqI8zc9YYLh+rTY3+zgs4JEBhUviQFyRePRe5vi+6rzARykojSrO9Z3MHh2nqcXypZPlMjde6qzEV4lYeExQ X-Gm-Message-State: AOJu0YxLcMO1ZbdWNq7OkvQOhXsJzaX4UpZRyGVpTRgkTELhVguLE0T2 9vkx8GnSCbAvvWwgAQO0XmtVjR7lSPhDnvZ5YGfdNOD/zFjDpRvA X-Received: by 2002:a05:6214:c47:b0:69b:1c3c:aed9 with SMTP id r7-20020a0562140c4700b0069b1c3caed9mr3899574qvj.18.1712672995993; Tue, 09 Apr 2024 07:29:55 -0700 (PDT) Received: from localhost (73.84.86.34.bc.googleusercontent.com. [34.86.84.73]) by smtp.gmail.com with ESMTPSA id c16-20020a0ce650000000b0069915b47bf4sm3963763qvn.146.2024.04.09.07.29.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 07:29:55 -0700 (PDT) Date: Tue, 09 Apr 2024 10:29:55 -0400 From: Willem de Bruijn To: John Fraker , netdev@vger.kernel.org Cc: John Fraker , Praveen Kaligineedi , Harshitha Ramamurthy , Shailend Chand , Willem de Bruijn , "David S. Miller" , Jakub Kicinski , Junfeng Guo , Ziwei Xiao , Jeroen de Borst , linux-kernel@vger.kernel.org, kory.maincent@bootlin.com, andrew@lunn.ch, richardcochran@gmail.com Message-ID: <661550e348224_23a2b2294f7@willemb.c.googlers.com.notmuch> In-Reply-To: <20240408180918.2773238-1-jfraker@google.com> References: <20240408180918.2773238-1-jfraker@google.com> Subject: Re: [PATCH net-next] gve: Correctly report software timestamping capabilities 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=utf-8 Content-Transfer-Encoding: 7bit John Fraker wrote: > gve has supported software timestamp generation since its inception, > but has not advertised that support via ethtool. This patch correctly > advertises that support. > > Reviewed-by: Praveen Kaligineedi > Reviewed-by: Harshitha Ramamurthy > Signed-off-by: John Fraker Reviewed-by: Willem de Bruijn > > --- > drivers/net/ethernet/google/gve/gve_ethtool.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c > index 815dead..99f5aeb 100644 > --- a/drivers/net/ethernet/google/gve/gve_ethtool.c > +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c > @@ -4,6 +4,8 @@ > * Copyright (C) 2015-2021 Google, Inc. > */ > > +#include > +#include > #include > #include "gve.h" > #include "gve_adminq.h" > @@ -763,6 +765,15 @@ static int gve_set_coalesce(struct net_device *netdev, > return 0; > } > > +static int gve_get_ts_info(struct net_device *netdev, struct ethtool_ts_info *info) > +{ > + info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE | > + SOF_TIMESTAMPING_TX_SOFTWARE | > + SOF_TIMESTAMPING_SOFTWARE; > + > + return 0; This device calls skb_tx_timestamp in its ndo_start_xmit: the prerequisite for SOF_TIMESTAMPING_TX_SOFTWARE. All devices support SOF_TIMESTAMPING_RX_SOFTWARE by virtue of net_timestamp_check being called in the device independent code. To ethtool timestamping maintainers: It's quite unnecessary to have each device advertise SOF_TIMESTAMPING_RX_SOFTWARE | SOF_TIMESTAMPING_SOFTWARE. In __ethtool_get_ts_info we could just always add those flags to the result from the callees. if (phy_has_tsinfo(phydev)) return phy_ts_info(phydev, info); if (ops->get_ts_info) return ops->get_ts_info(dev, info); info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE | SOF_TIMESTAMPING_SOFTWARE; > +} > + > const struct ethtool_ops gve_ethtool_ops = { > .supported_coalesce_params = ETHTOOL_COALESCE_USECS, > .supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT, > @@ -784,5 +795,6 @@ const struct ethtool_ops gve_ethtool_ops = { > .set_tunable = gve_set_tunable, > .get_priv_flags = gve_get_priv_flags, > .set_priv_flags = gve_set_priv_flags, > - .get_link_ksettings = gve_get_link_ksettings > + .get_link_ksettings = gve_get_link_ksettings, > + .get_ts_info = gve_get_ts_info > }; > -- > 2.44.0.478.gd926399ef9-goog >