linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add sending TX hardware timestamp for TC ETF Qdisc
@ 2020-12-09 14:37 Erez Geva
  2020-12-09 14:37 ` [PATCH 1/3] Add TX sending hardware timestamp Erez Geva
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Erez Geva @ 2020-12-09 14:37 UTC (permalink / raw)
  To: netdev, linux-kernel, linux-arch, Alexey Kuznetsov,
	Arnd Bergmann, Cong Wang, David S . Miller, Hideaki YOSHIFUJI,
	Jakub Kicinski, Jamal Hadi Salim, Jiri Pirko, Alexei Starovoitov,
	Colin Ian King, Daniel Borkmann, Eric Dumazet, Eyal Birger,
	Gustavo A . R . Silva, Jakub Sitnicki, John Ogness, Jon Rosen,
	Kees Cook, Mao Wenan, Marc Kleine-Budde, Martin KaFai Lau,
	Matthieu Baerts, Andrei Vagin, Dmitry Safonov,
	Eric W . Biederman, Ingo Molnar, John Stultz, Miaohe Lin,
	Michal Kubecek, Or Cohen, Oleg Nesterov, Peter Zijlstra,
	Richard Cochran, Stefan Schmidt, Willem de Bruijn, Xie He,
	Stephen Boyd, Thomas Gleixner, Vladis Dronov,
	Sebastian Andrzej Siewior, Frederic Weisbecker
  Cc: Vinicius Costa Gomes, Vedang Patel, Ines Molzahn, Simon Sudler,
	Andreas Meisinger, Andreas Bucher, Henning Schild, Jan Kiszka,
	Andreas Zirkler, Ermin Sakic, An Ninh Nguyen, Michael Saenger,
	Bernd Maehringer, Gisela Greinert, Erez Geva, Erez Geva

Add support for TX sending hardware timestamp with
 Traffic control Earliest TxTime First (ETF) Qdisc.

Why do we need additional timestamp?
Current ETF requires to synchronization the system clock
to the PTP Hardware clock (PHC) we want to send through.
But there are cases that we can not synchronize the system clock with
the desired NIC PHC.
1. We use several NICs with several PTP domains that our device
   is not allowed to be PTP master of.
2. We are using another clock source which we need for our system.
   Yet our device is not allowed to be PTP master.

Regardless of the exact topology, as the Linux tradition is to allow
the user the freedom to choose,
we propose a patch that will add a hardware timestamp to the packet.
The TC-ETF will use the first timestamp and compare it with
the system clock while send the packet to the network interface driver
with that hardware timestamp that is correlated with the PHC.

Note 1: we do encourage the users to synchronize the system clock with
  a PTP clock. Synchronizing the system clock with a PTP clock will
  reduce the frequency difference of the PHC and the system clock,
  increase the accurecy and may enable the user to reduce the ETF delta.

Note 2: In our network usage models sending a frame has to be very
  precise in relation to the PHC. Our user application does have
  the exact send time as of PHC perspective so it is able
  to provide the hw timestamp.

Note 3: The user can estimate the clocks conversion error done
  in the user application and add it to the delta setting of the ETF.

The patches contain:
 1. A new flag for the SO_TXTIME socket option.
 2. A new cmsg header, SCM_HW_TXTIME to pass the TX hardware timestamp.
 3. Add the hardware timestamp to the socket cookie and to the inet cork.
 4. As ETF Qdisc is irrelevant to TCP, ignore the TCP.
 5. A new flag to the ETF Qdisc setting that mandate
    the use of the hardware timestamp in the SKB.
 6. The ETF sort packets according to hardware timestamp,
    Yet pass the packet to network interface driver based
    on the system clock timestamp.

Note 4: The socket buffer hardware timestamp is used by
      the network interface driver to send the actual sending timestamp
      back to the application. The timestamp is used by the TC ETF
      before the socket buffer arrives in the network interface driver.

Erez Geva (3):
  Add TX sending hardware timestamp.
  Pass TX sending hardware timestamp to a socket's buffer.
  The TC ETF Qdisc pass the hardware timestamp to the interface driver.

 include/net/inet_sock.h           |  1 +
 include/net/sock.h                |  2 ++
 include/uapi/asm-generic/socket.h |  3 ++
 include/uapi/linux/net_tstamp.h   |  3 +-
 include/uapi/linux/pkt_sched.h    |  1 +
 net/core/sock.c                   |  9 +++++
 net/ipv4/ip_output.c              |  2 ++
 net/ipv4/raw.c                    |  1 +
 net/ipv6/ip6_output.c             |  2 ++
 net/ipv6/raw.c                    |  1 +
 net/packet/af_packet.c            |  3 ++
 net/sched/sch_etf.c               | 59 +++++++++++++++++++++++++------
 12 files changed, 75 insertions(+), 12 deletions(-)


base-commit: b65054597872ce3aefbc6a666385eabdf9e288da
-- 
2.20.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-12-16  2:02 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 14:37 [PATCH 0/3] Add sending TX hardware timestamp for TC ETF Qdisc Erez Geva
2020-12-09 14:37 ` [PATCH 1/3] Add TX sending hardware timestamp Erez Geva
2020-12-09 14:48   ` Willem de Bruijn
2020-12-09 15:21     ` Geva, Erez
2020-12-09 17:37       ` Willem de Bruijn
2020-12-09 20:18         ` Geva, Erez
2020-12-10 19:11           ` Willem de Bruijn
2020-12-10 22:37             ` Geva, Erez
2020-12-10 23:30               ` Willem de Bruijn
2020-12-11  0:27                 ` Vinicius Costa Gomes
2020-12-11 14:44                   ` Geva, Erez
2020-12-11 15:15                   ` Willem de Bruijn
2020-12-11 14:22                 ` Geva, Erez
2020-12-10  3:11   ` kernel test robot
2020-12-10 12:41     ` Geva, Erez
2020-12-10 18:17       ` Geva, Erez
2020-12-12  8:47       ` [kbuild-all] " Philip Li
2020-12-16  2:01         ` Rong Chen
2020-12-09 14:37 ` [PATCH 2/3] Pass TX sending hardware timestamp to a socket's buffer Erez Geva
2020-12-09 14:37 ` [PATCH 3/3] The TC ETF Qdisc pass the hardware timestamp to the interface driver Erez Geva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).