lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 Jul 2020 08:38:31 -0700
From:   Richard Cochran <richardcochran@...il.com>
To:     Vladimir Oltean <olteanv@...il.com>
Cc:     Kurt Kanzenbach <kurt@...utronix.de>, Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
        Rob Herring <robh+dt@...nel.org>, devicetree@...r.kernel.org,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Kamil Alkhouri <kamil.alkhouri@...offenburg.de>,
        ilias.apalodimas@...aro.org
Subject: Re: [PATCH v1 4/8] net: dsa: hellcreek: Add support for hardware
 timestamping

On Mon, Jul 13, 2020 at 05:12:17PM +0300, Vladimir Oltean wrote:
> On Mon, Jul 13, 2020 at 07:01:12AM -0700, Richard Cochran wrote:
> > I don't think it makes sense for DSA drivers to set this bit, as it
> > serves no purpose in the DSA context.
> > 
> 
> For whom does this bit serve a purpose, though, and how do you tell?

It had a historical purpose.  Originally, the stack delivered either a
hardware or a software time stamp, but not both.  This restriction was
eventually lifted via the SOF_TIMESTAMPING_OPT_TX_SWHW option, but
still the original behavior is preserved as the default.

You can see how SKBTX_IN_PROGRESS is used by the skb_tstamp_tx() path
here:

void __skb_tstamp_tx(struct sk_buff *orig_skb,
		     struct skb_shared_hwtstamps *hwtstamps,
		     struct sock *sk, int tstype)
{
	...

	if (!hwtstamps && !(sk->sk_tsflags & SOF_TIMESTAMPING_OPT_TX_SWHW) &&
	    skb_shinfo(orig_skb)->tx_flags & SKBTX_IN_PROGRESS)
		return;
}

It prevents SW time stamp when the flag is set.

Note that DSA drivers deliver TX time stamps via a different path,
namely skb_complete_tx_timestamp().  Also, DSA drivers don't provide
SW time stamping at all.

Q: When should drivers set SKBTX_IN_PROGRESS?

A: When the interface they represent offers both
   SOF_TIMESTAMPING_TX_HARDWARE and SOF_TIMESTAMPING_TX_SOFTWARE.

HTH,
Richard



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ