* [net-next 0/4] remove deprecated syststamp
@ 2014-07-25 22:01 Willem de Bruijn
2014-07-25 22:01 ` [net-next 1/4] octeon: remove deprecated syststamp timestamp Willem de Bruijn
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Willem de Bruijn @ 2014-07-25 22:01 UTC (permalink / raw)
To: netdev
Cc: davem, richardcochran, kreese, ddaney, dborkman, jdmason,
Willem de Bruijn
The network stack can generate two kinds of hardware timestamps:
- hwtstamp stores a hw timestamp in device-specific raw format
- syststamp convers the raw format to system time
The second is deprecated and only implemented by a single device
driver. The suggested alternative is to communicate hwtstamp +
directly expose the NIC PTP clock device through ptp_clock_info.
The remaining driver (octeon) does not expose such a standard
interface as of now. It does have its own PTP library that depends
on its own shared memory PTP clock interface.
This patchset
1. reverts the syststamp code in the one driver (octeon)
2. reverts an unnecessary zero initialization in another (vxge)
3. modifies PF_PACKET to use syststamp is != 0 (because always == 0)
4. modifies SCM_TIMESTAMPING in the same way
For backwards compatibility, the interfaces are not removed.
Applications can still request SOF_TIMESTAMPING_SYS_HARDWARE. The
response field in scm_timestamping also remains. As was the case
for hardware/drivers that did not implement the feature, the
setsockopt succeeds, but the response field is always zero.
--
2.0.0.526.g5318336
^ permalink raw reply [flat|nested] 7+ messages in thread
* [net-next 1/4] octeon: remove deprecated syststamp timestamp
2014-07-25 22:01 [net-next 0/4] remove deprecated syststamp Willem de Bruijn
@ 2014-07-25 22:01 ` Willem de Bruijn
2014-07-25 22:01 ` [net-next 2/4] vxge: " Willem de Bruijn
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Willem de Bruijn @ 2014-07-25 22:01 UTC (permalink / raw)
To: netdev
Cc: davem, richardcochran, kreese, ddaney, dborkman, jdmason,
Willem de Bruijn
Hardware timestamps can be exposed to userspace in raw hardware format
(hwtstamp) as well as converted to system time (syststamp). The second
variant is deprecated and only implemented by this driver.
The preferred method of hardware timestamp generation is to combine
hwtstamp with a device PTP clock. Octeon has its own PTP library
that relies on a shared memory interface to the PTP clock device.
Signed-off-by: Willem de Bruijn <willemb@google.com>
---
drivers/net/ethernet/octeon/octeon_mgmt.c | 25 +------------------------
1 file changed, 1 insertion(+), 24 deletions(-)
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
index 7dc3e9b..979c698 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -247,28 +247,6 @@ static void octeon_mgmt_rx_fill_ring(struct net_device *netdev)
}
}
-static ktime_t ptp_to_ktime(u64 ptptime)
-{
- ktime_t ktimebase;
- u64 ptpbase;
- unsigned long flags;
-
- local_irq_save(flags);
- /* Fill the icache with the code */
- ktime_get_real();
- /* Flush all pending operations */
- mb();
- /* Read the time and PTP clock as close together as
- * possible. It is important that this sequence take the same
- * amount of time to reduce jitter
- */
- ktimebase = ktime_get_real();
- ptpbase = cvmx_read_csr(CVMX_MIO_PTP_CLOCK_HI);
- local_irq_restore(flags);
-
- return ktime_sub_ns(ktimebase, ptpbase - ptptime);
-}
-
static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p)
{
union cvmx_mixx_orcnt mix_orcnt;
@@ -312,12 +290,12 @@ static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p)
/* Read the hardware TX timestamp if one was recorded */
if (unlikely(re.s.tstamp)) {
struct skb_shared_hwtstamps ts;
+ memset(&ts, 0, sizeof(ts));
/* Read the timestamp */
u64 ns = cvmx_read_csr(CVMX_MIXX_TSTAMP(p->port));
/* Remove the timestamp from the FIFO */
cvmx_write_csr(CVMX_MIXX_TSCTL(p->port), 0);
/* Tell the kernel about the timestamp */
- ts.syststamp = ptp_to_ktime(ns);
ts.hwtstamp = ns_to_ktime(ns);
skb_tstamp_tx(skb, &ts);
}
@@ -429,7 +407,6 @@ good:
struct skb_shared_hwtstamps *ts;
ts = skb_hwtstamps(skb);
ts->hwtstamp = ns_to_ktime(ns);
- ts->syststamp = ptp_to_ktime(ns);
__skb_pull(skb, 8);
}
skb->protocol = eth_type_trans(skb, netdev);
--
2.0.0.526.g5318336
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net-next 2/4] vxge: remove deprecated syststamp timestamp
2014-07-25 22:01 [net-next 0/4] remove deprecated syststamp Willem de Bruijn
2014-07-25 22:01 ` [net-next 1/4] octeon: remove deprecated syststamp timestamp Willem de Bruijn
@ 2014-07-25 22:01 ` Willem de Bruijn
2014-07-25 22:01 ` [net-next 3/4] packet: " Willem de Bruijn
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Willem de Bruijn @ 2014-07-25 22:01 UTC (permalink / raw)
To: netdev
Cc: davem, richardcochran, kreese, ddaney, dborkman, jdmason,
Willem de Bruijn
This driver explicitly clears a field that is unused and about to be
removed. Remove the initialization.
All fields in skb_shared_info before dataref are cleared in
__alloc_skb, so the removal is safe even while syststamp exists.
Signed-off-by: Willem de Bruijn <willemb@google.com>
---
drivers/net/ethernet/neterion/vxge/vxge-main.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c
index 7a0dead..2eda153 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
@@ -503,7 +503,6 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr,
skb_hwts = skb_hwtstamps(skb);
skb_hwts->hwtstamp = ns_to_ktime(ns);
- skb_hwts->syststamp.tv64 = 0;
}
/* rth_hash_type and rth_it_hit are non-zero regardless of
--
2.0.0.526.g5318336
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net-next 3/4] packet: remove deprecated syststamp timestamp
2014-07-25 22:01 [net-next 0/4] remove deprecated syststamp Willem de Bruijn
2014-07-25 22:01 ` [net-next 1/4] octeon: remove deprecated syststamp timestamp Willem de Bruijn
2014-07-25 22:01 ` [net-next 2/4] vxge: " Willem de Bruijn
@ 2014-07-25 22:01 ` Willem de Bruijn
2014-07-25 22:01 ` [net-next 4/4] net: " Willem de Bruijn
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Willem de Bruijn @ 2014-07-25 22:01 UTC (permalink / raw)
To: netdev
Cc: davem, richardcochran, kreese, ddaney, dborkman, jdmason,
Willem de Bruijn
No device driver will ever return an skb_shared_info structure with
syststamp non-zero, so remove the branch that tests for this and
optionally marks the packet timestamp as TP_STATUS_TS_SYS_HARDWARE.
Do not remove the definition TP_STATUS_TS_SYS_HARDWARE, as processes
may refer to it.
Signed-off-by: Willem de Bruijn <willemb@google.com>
---
Documentation/networking/packet_mmap.txt | 18 ++++++------------
include/uapi/linux/if_packet.h | 2 +-
net/packet/af_packet.c | 12 ++++--------
3 files changed, 11 insertions(+), 21 deletions(-)
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt
index 38112d5..a6d7cb9 100644
--- a/Documentation/networking/packet_mmap.txt
+++ b/Documentation/networking/packet_mmap.txt
@@ -1008,14 +1008,9 @@ hardware timestamps to be used. Note: you may need to enable the generation
of hardware timestamps with SIOCSHWTSTAMP (see related information from
Documentation/networking/timestamping.txt).
-PACKET_TIMESTAMP accepts the same integer bit field as
-SO_TIMESTAMPING. However, only the SOF_TIMESTAMPING_SYS_HARDWARE
-and SOF_TIMESTAMPING_RAW_HARDWARE values are recognized by
-PACKET_TIMESTAMP. SOF_TIMESTAMPING_SYS_HARDWARE takes precedence over
-SOF_TIMESTAMPING_RAW_HARDWARE if both bits are set.
-
- int req = 0;
- req |= SOF_TIMESTAMPING_SYS_HARDWARE;
+PACKET_TIMESTAMP accepts the same integer bit field as SO_TIMESTAMPING:
+
+ int req = SOF_TIMESTAMPING_RAW_HARDWARE;
setsockopt(fd, SOL_PACKET, PACKET_TIMESTAMP, (void *) &req, sizeof(req))
For the mmap(2)ed ring buffers, such timestamps are stored in the
@@ -1023,14 +1018,13 @@ tpacket{,2,3}_hdr structure's tp_sec and tp_{n,u}sec members. To determine
what kind of timestamp has been reported, the tp_status field is binary |'ed
with the following possible bits ...
- TP_STATUS_TS_SYS_HARDWARE
TP_STATUS_TS_RAW_HARDWARE
TP_STATUS_TS_SOFTWARE
... that are equivalent to its SOF_TIMESTAMPING_* counterparts. For the
-RX_RING, if none of those 3 are set (i.e. PACKET_TIMESTAMP is not set),
-then this means that a software fallback was invoked *within* PF_PACKET's
-processing code (less precise).
+RX_RING, if neither is set (i.e. PACKET_TIMESTAMP is not set), then a
+software fallback was invoked *within* PF_PACKET's processing code (less
+precise).
Getting timestamps for the TX_RING works as follows: i) fill the ring frames,
ii) call sendto() e.g. in blocking mode, iii) wait for status of relevant
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
index bac27fa..da2d668 100644
--- a/include/uapi/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
@@ -108,7 +108,7 @@ struct tpacket_auxdata {
/* Rx and Tx ring - header status */
#define TP_STATUS_TS_SOFTWARE (1 << 29)
-#define TP_STATUS_TS_SYS_HARDWARE (1 << 30)
+#define TP_STATUS_TS_SYS_HARDWARE (1 << 30) /* deprecated, never set */
#define TP_STATUS_TS_RAW_HARDWARE (1 << 31)
/* Rx ring - feature request bits */
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 614ca91..8d9f804 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -441,14 +441,10 @@ static __u32 tpacket_get_timestamp(struct sk_buff *skb, struct timespec *ts,
{
struct skb_shared_hwtstamps *shhwtstamps = skb_hwtstamps(skb);
- if (shhwtstamps) {
- if ((flags & SOF_TIMESTAMPING_SYS_HARDWARE) &&
- ktime_to_timespec_cond(shhwtstamps->syststamp, ts))
- return TP_STATUS_TS_SYS_HARDWARE;
- if ((flags & SOF_TIMESTAMPING_RAW_HARDWARE) &&
- ktime_to_timespec_cond(shhwtstamps->hwtstamp, ts))
- return TP_STATUS_TS_RAW_HARDWARE;
- }
+ if (shhwtstamps &&
+ (flags & SOF_TIMESTAMPING_RAW_HARDWARE) &&
+ ktime_to_timespec_cond(shhwtstamps->hwtstamp, ts))
+ return TP_STATUS_TS_RAW_HARDWARE;
if (ktime_to_timespec_cond(skb->tstamp, ts))
return TP_STATUS_TS_SOFTWARE;
--
2.0.0.526.g5318336
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [net-next 4/4] net: remove deprecated syststamp timestamp
2014-07-25 22:01 [net-next 0/4] remove deprecated syststamp Willem de Bruijn
` (2 preceding siblings ...)
2014-07-25 22:01 ` [net-next 3/4] packet: " Willem de Bruijn
@ 2014-07-25 22:01 ` Willem de Bruijn
2014-07-26 7:45 ` [net-next 0/4] remove deprecated syststamp Richard Cochran
2014-07-29 18:40 ` David Miller
5 siblings, 0 replies; 7+ messages in thread
From: Willem de Bruijn @ 2014-07-25 22:01 UTC (permalink / raw)
To: netdev
Cc: davem, richardcochran, kreese, ddaney, dborkman, jdmason,
Willem de Bruijn
The SO_TIMESTAMPING API defines three types of timestamps: software,
hardware in raw format (hwtstamp) and hardware converted to system
format (syststamp). The last has been deprecated in favor of combining
hwtstamp with a PTP clock driver. There are no active users in the
kernel.
The option was device driver dependent. If set, but without hardware
support, the correct behavior is to return zero in the relevant field
in the SCM_TIMESTAMPING ancillary message. Without device drivers
implementing the option, this field is effectively always zero.
Remove the internal plumbing to dissuage new drivers from implementing
the feature. Keep the SOF_TIMESTAMPING_SYS_HARDWARE flag, however, to
avoid breaking existing applications that request the timestamp.
Signed-off-by: Willem de Bruijn <willemb@google.com>
---
Documentation/networking/timestamping.txt | 12 ++----------
Documentation/networking/timestamping/timestamping.c | 7 +------
include/linux/skbuff.h | 14 +-------------
include/net/sock.h | 11 +++--------
net/core/sock.c | 4 ----
net/socket.c | 12 ++++--------
6 files changed, 11 insertions(+), 49 deletions(-)
diff --git a/Documentation/networking/timestamping.txt b/Documentation/networking/timestamping.txt
index 8b4ad80..897f942 100644
--- a/Documentation/networking/timestamping.txt
+++ b/Documentation/networking/timestamping.txt
@@ -88,15 +88,8 @@ hwtimeraw is the original hardware time stamp. Filled in if
SOF_TIMESTAMPING_RAW_HARDWARE is set. No assumptions about its
relation to system time should be made.
-hwtimetrans is the hardware time stamp transformed so that it
-corresponds as good as possible to system time. This correlation is
-not perfect; as a consequence, sorting packets received via different
-NICs by their hwtimetrans may differ from the order in which they were
-received. hwtimetrans may be non-monotonic even for the same NIC.
-Filled in if SOF_TIMESTAMPING_SYS_HARDWARE is set. Requires support
-by the network device and will be empty without that support. This
-field is DEPRECATED. Only one driver computes this value. New device
-drivers must leave this zero. Instead, they can expose the hardware
+hwtimetrans is always zero. This field is deprecated. It used to hold
+hw timestamps converted to system time. Instead, expose the hardware
clock device on the NIC directly as a HW PTP clock source, to allow
time conversion in userspace and optionally synchronize system time
with a userspace PTP stack such as linuxptp. For the PTP clock API,
@@ -191,7 +184,6 @@ struct skb_shared_hwtstamps {
* since arbitrary point in time
*/
ktime_t hwtstamp;
- ktime_t syststamp; /* hwtstamp transformed to system time base */
};
Time stamps for outgoing packets are to be generated as follows:
diff --git a/Documentation/networking/timestamping/timestamping.c b/Documentation/networking/timestamping/timestamping.c
index 8ba82bf..5cdfd74 100644
--- a/Documentation/networking/timestamping/timestamping.c
+++ b/Documentation/networking/timestamping/timestamping.c
@@ -76,7 +76,6 @@ static void usage(const char *error)
" SOF_TIMESTAMPING_RX_HARDWARE - hardware time stamping of incoming packets\n"
" SOF_TIMESTAMPING_RX_SOFTWARE - software fallback for incoming packets\n"
" SOF_TIMESTAMPING_SOFTWARE - request reporting of software time stamps\n"
- " SOF_TIMESTAMPING_SYS_HARDWARE - request reporting of transformed HW time stamps\n"
" SOF_TIMESTAMPING_RAW_HARDWARE - request reporting of raw HW time stamps\n"
" SIOCGSTAMP - check last socket time stamp\n"
" SIOCGSTAMPNS - more accurate socket time stamp\n");
@@ -202,9 +201,7 @@ static void printpacket(struct msghdr *msg, int res,
(long)stamp->tv_sec,
(long)stamp->tv_nsec);
stamp++;
- printf("HW transformed %ld.%09ld ",
- (long)stamp->tv_sec,
- (long)stamp->tv_nsec);
+ /* skip deprecated HW transformed */
stamp++;
printf("HW raw %ld.%09ld",
(long)stamp->tv_sec,
@@ -361,8 +358,6 @@ int main(int argc, char **argv)
so_timestamping_flags |= SOF_TIMESTAMPING_RX_SOFTWARE;
else if (!strcasecmp(argv[i], "SOF_TIMESTAMPING_SOFTWARE"))
so_timestamping_flags |= SOF_TIMESTAMPING_SOFTWARE;
- else if (!strcasecmp(argv[i], "SOF_TIMESTAMPING_SYS_HARDWARE"))
- so_timestamping_flags |= SOF_TIMESTAMPING_SYS_HARDWARE;
else if (!strcasecmp(argv[i], "SOF_TIMESTAMPING_RAW_HARDWARE"))
so_timestamping_flags |= SOF_TIMESTAMPING_RAW_HARDWARE;
else
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index b613557..281dece 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -210,20 +210,9 @@ static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
* struct skb_shared_hwtstamps - hardware time stamps
* @hwtstamp: hardware time stamp transformed into duration
* since arbitrary point in time
- * @syststamp: hwtstamp transformed to system time base (deprecated)
*
* Software time stamps generated by ktime_get_real() are stored in
- * skb->tstamp. The relation between the different kinds of time
- * stamps is as follows:
- *
- * syststamp and tstamp can be compared against each other in
- * arbitrary combinations. The accuracy of a
- * syststamp/tstamp/"syststamp from other device" comparison is
- * limited by the accuracy of the transformation into system time
- * base. This depends on the device driver and its underlying
- * hardware. The syststamp implementation is deprecated in favor
- * of hwtstamps and hw PTP clock sources exposed directly to
- * userspace.
+ * skb->tstamp.
*
* hwtstamps can only be compared against other hwtstamps from
* the same device.
@@ -233,7 +222,6 @@ static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
*/
struct skb_shared_hwtstamps {
ktime_t hwtstamp;
- ktime_t syststamp;
};
/* Definitions for tx_flags in struct skb_shared_info */
diff --git a/include/net/sock.h b/include/net/sock.h
index 7207733..b91c886 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -707,7 +707,6 @@ enum sock_flags {
SOCK_TIMESTAMPING_RX_SOFTWARE, /* %SOF_TIMESTAMPING_RX_SOFTWARE */
SOCK_TIMESTAMPING_SOFTWARE, /* %SOF_TIMESTAMPING_SOFTWARE */
SOCK_TIMESTAMPING_RAW_HARDWARE, /* %SOF_TIMESTAMPING_RAW_HARDWARE */
- SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */
SOCK_FASYNC, /* fasync() active */
SOCK_RXQ_OVFL,
SOCK_ZEROCOPY, /* buffers from userspace */
@@ -2166,16 +2165,13 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
* - software time stamp available and wanted
* (SOCK_TIMESTAMPING_SOFTWARE)
* - hardware time stamps available and wanted
- * (SOCK_TIMESTAMPING_SYS_HARDWARE or
- * SOCK_TIMESTAMPING_RAW_HARDWARE)
+ * SOCK_TIMESTAMPING_RAW_HARDWARE
*/
if (sock_flag(sk, SOCK_RCVTSTAMP) ||
sock_flag(sk, SOCK_TIMESTAMPING_RX_SOFTWARE) ||
(kt.tv64 && sock_flag(sk, SOCK_TIMESTAMPING_SOFTWARE)) ||
(hwtstamps->hwtstamp.tv64 &&
- sock_flag(sk, SOCK_TIMESTAMPING_RAW_HARDWARE)) ||
- (hwtstamps->syststamp.tv64 &&
- sock_flag(sk, SOCK_TIMESTAMPING_SYS_HARDWARE)))
+ sock_flag(sk, SOCK_TIMESTAMPING_RAW_HARDWARE)))
__sock_recv_timestamp(msg, sk, skb);
else
sk->sk_stamp = kt;
@@ -2193,8 +2189,7 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
#define FLAGS_TS_OR_DROPS ((1UL << SOCK_RXQ_OVFL) | \
(1UL << SOCK_RCVTSTAMP) | \
(1UL << SOCK_TIMESTAMPING_SOFTWARE) | \
- (1UL << SOCK_TIMESTAMPING_RAW_HARDWARE) | \
- (1UL << SOCK_TIMESTAMPING_SYS_HARDWARE))
+ (1UL << SOCK_TIMESTAMPING_RAW_HARDWARE))
if (sk->sk_flags & FLAGS_TS_OR_DROPS)
__sock_recv_ts_and_drops(msg, sk, skb);
diff --git a/net/core/sock.c b/net/core/sock.c
index ca9b651..134291d 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -862,8 +862,6 @@ set_rcvbuf:
(1UL << SOCK_TIMESTAMPING_RX_SOFTWARE));
sock_valbool_flag(sk, SOCK_TIMESTAMPING_SOFTWARE,
val & SOF_TIMESTAMPING_SOFTWARE);
- sock_valbool_flag(sk, SOCK_TIMESTAMPING_SYS_HARDWARE,
- val & SOF_TIMESTAMPING_SYS_HARDWARE);
sock_valbool_flag(sk, SOCK_TIMESTAMPING_RAW_HARDWARE,
val & SOF_TIMESTAMPING_RAW_HARDWARE);
break;
@@ -1102,8 +1100,6 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
v.val |= SOF_TIMESTAMPING_RX_SOFTWARE;
if (sock_flag(sk, SOCK_TIMESTAMPING_SOFTWARE))
v.val |= SOF_TIMESTAMPING_SOFTWARE;
- if (sock_flag(sk, SOCK_TIMESTAMPING_SYS_HARDWARE))
- v.val |= SOF_TIMESTAMPING_SYS_HARDWARE;
if (sock_flag(sk, SOCK_TIMESTAMPING_RAW_HARDWARE))
v.val |= SOF_TIMESTAMPING_RAW_HARDWARE;
break;
diff --git a/net/socket.c b/net/socket.c
index abf56b2..d8222c0 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -725,14 +725,10 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
if (sock_flag(sk, SOCK_TIMESTAMPING_SOFTWARE) &&
ktime_to_timespec_cond(skb->tstamp, ts + 0))
empty = 0;
- if (shhwtstamps) {
- if (sock_flag(sk, SOCK_TIMESTAMPING_SYS_HARDWARE) &&
- ktime_to_timespec_cond(shhwtstamps->syststamp, ts + 1))
- empty = 0;
- if (sock_flag(sk, SOCK_TIMESTAMPING_RAW_HARDWARE) &&
- ktime_to_timespec_cond(shhwtstamps->hwtstamp, ts + 2))
- empty = 0;
- }
+ if (shhwtstamps &&
+ sock_flag(sk, SOCK_TIMESTAMPING_RAW_HARDWARE) &&
+ ktime_to_timespec_cond(shhwtstamps->hwtstamp, ts + 2))
+ empty = 0;
if (!empty)
put_cmsg(msg, SOL_SOCKET,
SCM_TIMESTAMPING, sizeof(ts), &ts);
--
2.0.0.526.g5318336
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [net-next 0/4] remove deprecated syststamp
2014-07-25 22:01 [net-next 0/4] remove deprecated syststamp Willem de Bruijn
` (3 preceding siblings ...)
2014-07-25 22:01 ` [net-next 4/4] net: " Willem de Bruijn
@ 2014-07-26 7:45 ` Richard Cochran
2014-07-29 18:40 ` David Miller
5 siblings, 0 replies; 7+ messages in thread
From: Richard Cochran @ 2014-07-26 7:45 UTC (permalink / raw)
To: Willem de Bruijn; +Cc: netdev, davem, kreese, ddaney, dborkman, jdmason
On Fri, Jul 25, 2014 at 06:01:28PM -0400, Willem de Bruijn wrote:
> The remaining driver (octeon) does not expose such a standard
> interface as of now. It does have its own PTP library that depends
> on its own shared memory PTP clock interface.
FWIW, that custom interface isn't even part of the kernel. It was nice
of you to take the trouble to find out about it, and it seems that
removing the SYS time stamp will not hurt applications using the
custom interface. They will need a custom kernel in any case. However,
at the end of the day, we really don't have to support random
out-of-tree interfaces.
> This patchset
> 1. reverts the syststamp code in the one driver (octeon)
> 2. reverts an unnecessary zero initialization in another (vxge)
> 3. modifies PF_PACKET to use syststamp is != 0 (because always == 0)
> 4. modifies SCM_TIMESTAMPING in the same way
Thanks for doing this series.
Acked-by: Richard Cochran <richardcochran@gmail.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [net-next 0/4] remove deprecated syststamp
2014-07-25 22:01 [net-next 0/4] remove deprecated syststamp Willem de Bruijn
` (4 preceding siblings ...)
2014-07-26 7:45 ` [net-next 0/4] remove deprecated syststamp Richard Cochran
@ 2014-07-29 18:40 ` David Miller
5 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2014-07-29 18:40 UTC (permalink / raw)
To: willemb; +Cc: netdev, richardcochran, kreese, ddaney, dborkman, jdmason
From: Willem de Bruijn <willemb@google.com>
Date: Fri, 25 Jul 2014 18:01:28 -0400
> The network stack can generate two kinds of hardware timestamps:
> - hwtstamp stores a hw timestamp in device-specific raw format
> - syststamp convers the raw format to system time
>
> The second is deprecated and only implemented by a single device
> driver. The suggested alternative is to communicate hwtstamp +
> directly expose the NIC PTP clock device through ptp_clock_info.
> The remaining driver (octeon) does not expose such a standard
> interface as of now. It does have its own PTP library that depends
> on its own shared memory PTP clock interface.
>
> This patchset
> 1. reverts the syststamp code in the one driver (octeon)
> 2. reverts an unnecessary zero initialization in another (vxge)
> 3. modifies PF_PACKET to use syststamp is != 0 (because always == 0)
> 4. modifies SCM_TIMESTAMPING in the same way
>
> For backwards compatibility, the interfaces are not removed.
> Applications can still request SOF_TIMESTAMPING_SYS_HARDWARE. The
> response field in scm_timestamping also remains. As was the case
> for hardware/drivers that did not implement the feature, the
> setsockopt succeeds, but the response field is always zero.
Series applied, thanks Willem.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-07-29 18:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25 22:01 [net-next 0/4] remove deprecated syststamp Willem de Bruijn
2014-07-25 22:01 ` [net-next 1/4] octeon: remove deprecated syststamp timestamp Willem de Bruijn
2014-07-25 22:01 ` [net-next 2/4] vxge: " Willem de Bruijn
2014-07-25 22:01 ` [net-next 3/4] packet: " Willem de Bruijn
2014-07-25 22:01 ` [net-next 4/4] net: " Willem de Bruijn
2014-07-26 7:45 ` [net-next 0/4] remove deprecated syststamp Richard Cochran
2014-07-29 18:40 ` David Miller
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).