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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed,  9 Dec 2020 15:37:03 +0100
From:   Erez Geva <>
        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 <>
Subject: [PATCH 0/3] Add sending TX hardware timestamp for TC ETF Qdisc

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

Powered by blists - more mailing lists