@@ -470,7 +470,7 @@ struct skb_shared_hwtstamps {
/* Definitions for tx_flags in struct skb_shared_info */
enum {
/* generate hardware time stamp */
- SKBTX_HW_TSTAMP = 1 << 0,
+ __SKBTX_HW_TSTAMP = 1 << 0,
/* generate software time stamp when queueing packet to NIC */
SKBTX_SW_TSTAMP = 1 << 1,
@@ -494,6 +494,8 @@ enum {
SKBTX_BPF = 1 << 7,
};
+#define SKBTX_HW_TSTAMP (__SKBTX_HW_TSTAMP | SKBTX_BPF)
+
#define SKBTX_ANY_SW_TSTAMP (SKBTX_SW_TSTAMP | \
SKBTX_SCHED_TSTAMP | \
SKBTX_BPF)
@@ -5551,7 +5551,7 @@ static bool skb_enable_app_tstamp(struct sk_buff *skb, int tstype, bool sw)
if (sw)
flag = SKBTX_SW_TSTAMP;
else
- flag = SKBTX_HW_TSTAMP;
+ flag = __SKBTX_HW_TSTAMP;
break;
case SCM_TSTAMP_ACK:
if (TCP_SKB_CB(skb)->txstamp_ack)
@@ -676,7 +676,7 @@ void __sock_tx_timestamp(__u32 tsflags, __u8 *tx_flags)
u8 flags = *tx_flags;
if (tsflags & SOF_TIMESTAMPING_TX_HARDWARE) {
- flags |= SKBTX_HW_TSTAMP;
+ flags |= __SKBTX_HW_TSTAMP;
/* PTP hardware clocks can provide a free running cycle counter
* as a time base for virtual clocks. Tell driver to use the
To avoid changing so many callers using SKBTX_HW_TSTAMP from drivers, use this simple modification like this patch does to support printing hardware timestamp. Signed-off-by: Jason Xing <kerneljasonxing@gmail.com> --- include/linux/skbuff.h | 4 +++- net/core/skbuff.c | 2 +- net/socket.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-)