]> git.baikalelectronics.ru Git - kernel.git/commit
net: add a helper to avoid issues with HW TX timestamping and SO_TXTIME
authorVladimir Oltean <olteanv@gmail.com>
Wed, 10 Mar 2021 14:50:44 +0000 (16:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Mar 2021 20:45:16 +0000 (12:45 -0800)
commit3002c8479713a87385136f808faa6e61627c04d9
tree54bd8b80cdc06c39573fd793dc54054163d3d683
parent9022d03abff5cc17b1febd9d5c1a75d8e594fb59
net: add a helper to avoid issues with HW TX timestamping and SO_TXTIME

As explained in commit 99a441fa00fa ("net: enetc: allow hardware
timestamping on TX queues with tc-etf enabled"), hardware TX
timestamping requires an skb with skb->tstamp = 0. When a packet is sent
with SO_TXTIME, the skb->skb_mstamp_ns corrupts the value of skb->tstamp,
so the drivers need to explicitly reset skb->tstamp to zero after
consuming the TX time.

Create a helper named skb_txtime_consumed() which does just that. All
drivers which offload TC_SETUP_QDISC_ETF should implement it, and it
would make it easier to assess during review whether they do the right
thing in order to be compatible with hardware timestamping or not.

Suggested-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/enetc.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/igc/igc_main.c
include/net/pkt_sched.h