Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp310849ybb; Thu, 28 Mar 2019 03:04:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIoQN95y6UN9hJgdyBSFFQw1tZ/1BQWUX3wqga31Q1fFPUkROoBZitw491bkz0wbkKwxkv X-Received: by 2002:a63:6f0a:: with SMTP id k10mr17033489pgc.78.1553767484741; Thu, 28 Mar 2019 03:04:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553767484; cv=none; d=google.com; s=arc-20160816; b=jwEFlbkOV+zrim7ZHTCuOUB2LFL1uLpNAVteXqazVHo9euf1ofWiox7Yn4WrSnoltg A8+DLqpQpLbP+Bsncw3Iplmgb1YRj1ibVgZEdZWNSmZuTpsxj/3VD0sekQLAwGwFTXiX BHFJr5CTYh7hCvGanBtR2WJxWgB9YkC8A8LV9hkqM6irvqGhxelPn4zhXsvuki36zViK p+VV3kehqHCivXsBeu3GSOiZGeIAOa0+0XOMcMA35HcJCAQmly3VfsMuWG0C9N9/HsYT qXOHrmjuQEf5oKR/1AASZhBV+0uo8NEOm4gKT1X8sAm6exLWzfu8pk/xHegZp56WaGDw E/uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5nFro12gJV1eCfzuQ4dPnhRDrRkeZJWmQv6i2xGnc78=; b=zl+BjBPbzox8CEUzc7RKHsuQk4KSSJ6as9K4/OlgiG1Fcg8hnnlWR/hA9CxBVj4P7j xjFrsbJOaTMtOFLehYXp3q/WM57z8Q7NumDUeMkSUw2UbdLgtYIN2000LY4LygPdPPfP PhZJgp7yxI6ecA8fC+XqgA809Uqk333YjKRVc3lHYI6EDs9uxnmteilG1KflWxNqcfjM hX/xJ1rrPFOuASRHL9rKIA3CaxBkN3M9FAGgVXQ6dZyeJEUk3AVdlueT9CixBOIy0yeC AvYE7o7ZohcPO5j6K+MIVPpqi99EnX9ba8/Juy/QYClmkFnJDvurdPQr4/kEcnfNgaAK xnvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q81si3956482pfc.126.2019.03.28.03.04.28; Thu, 28 Mar 2019 03:04:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727007AbfC1KDw (ORCPT + 99 others); Thu, 28 Mar 2019 06:03:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:33234 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725815AbfC1KDw (ORCPT ); Thu, 28 Mar 2019 06:03:52 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D1ED2ADAA; Thu, 28 Mar 2019 10:03:50 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 9DCADE1404; Thu, 28 Mar 2019 11:03:37 +0100 (CET) Date: Thu, 28 Mar 2019 11:03:37 +0100 From: Michal Kubecek To: Florian Fainelli Cc: David Miller , netdev@vger.kernel.org, Jakub Kicinski , Jiri Pirko , Andrew Lunn , John Linville , Stephen Hemminger , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v5 14/22] ethtool: provide timestamping information in GET_INFO request Message-ID: <20190328100337.GC26076@unicorn.suse.cz> References: <1dce7f6dd3308ad4b90300014823d071f37b0f74.1553532199.git.mkubecek@suse.cz> <262b84dc-e4fb-6c27-7de7-bc797d2247a0@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <262b84dc-e4fb-6c27-7de7-bc797d2247a0@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 27, 2019 at 08:36:53PM -0700, Florian Fainelli wrote: > > > On 3/25/2019 10:08 AM, Michal Kubecek wrote: > > Add timestamping information as provided by ETHTOOL_GET_TS_INFO ioctl > > command in GET_INFO reply if ETH_INFO_IM_TSINFO flag is set in the request. > > > > Add constants for counts of HWTSTAMP_TX_* and HWTSTAM_FILTER_* constants > > and provide symbolic names for timestamping related values so that they can > > be retrieved in GET_STRSET and GET_INFO requests. > > > > Signed-off-by: Michal Kubecek > > --- > > [snip] > > > +int __ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) > > +{ > > + const struct ethtool_ops *ops = dev->ethtool_ops; > > + struct phy_device *phydev = dev->phydev; > > + int err = 0; > > + > > + memset(info, 0, sizeof(*info)); > > + info->cmd = ETHTOOL_GET_TS_INFO; > > + > > + if (phydev && phydev->drv && phydev->drv->ts_info) { > > + err = phydev->drv->ts_info(phydev, info); > > + } else if (ops->get_ts_info) { > > + err = ops->get_ts_info(dev, info); > > + } else { > > + info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE | > > + SOF_TIMESTAMPING_SOFTWARE; > > + info->phc_index = -1; > > + } > > We don't have to solve this just yet, but this is the type of logic that > we want to be able to change in the future, there are a number of things > in the current ethtool code where, say, we always prefer PHY time > stamping over MAC time stamping when there should be a choice if both > are supported. For the record, this is just a code block carved out of existing ethtool_ts_info() where the only difference is that info is a pointer rather than a structure itself. > I don't know if you maintain a TODO for after when this patch series get > merged, but we may want to start one :) I have some informal TODO locally; some ideas are in the cover letter, I also mentioned some in my talk last week. Perhaps it is time to make it a publicly visible document and start collecting ideas. Michal