diff options
author | Willem de Bruijn <willemb@google.com> | 2014-08-05 04:11:46 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-06 01:35:54 +0200 |
commit | b9f40e21ef4298650ab33e35740fa85bd57706d5 (patch) | |
tree | 1d1904c9f89dc77eae767a8a8895698d644cff1a /net/socket.c | |
parent | net-timestamp: extend SCM_TIMESTAMPING ancillary data struct (diff) | |
download | linux-b9f40e21ef4298650ab33e35740fa85bd57706d5.tar.xz linux-b9f40e21ef4298650ab33e35740fa85bd57706d5.zip |
net-timestamp: move timestamp flags out of sk_flags
sk_flags is reaching its limit. New timestamping options will not fit.
Move all of them into a new field sk->sk_tsflags.
Added benefit is that this removes boilerplate code to convert between
SOF_TIMESTAMPING_.. and SOCK_TIMESTAMPING_.. in getsockopt/setsockopt.
SOCK_TIMESTAMPING_RX_SOFTWARE is also used to toggle the receive
timestamp logic (netstamp_needed). That can be simplified and this
last key removed, but will leave that for a separate patch.
Signed-off-by: Willem de Bruijn <willemb@google.com>
----
The u16 in sock can be moved into a 16-bit hole below sk_gso_max_segs,
though that scatters tstamp fields throughout the struct.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/socket.c b/net/socket.c index dc0cc5d95ee5..255d9b802723 100644 --- a/net/socket.c +++ b/net/socket.c @@ -613,9 +613,9 @@ EXPORT_SYMBOL(sock_release); void sock_tx_timestamp(struct sock *sk, __u8 *tx_flags) { *tx_flags = 0; - if (sock_flag(sk, SOCK_TIMESTAMPING_TX_HARDWARE)) + if (sk->sk_tsflags & SOF_TIMESTAMPING_TX_HARDWARE) *tx_flags |= SKBTX_HW_TSTAMP; - if (sock_flag(sk, SOCK_TIMESTAMPING_TX_SOFTWARE)) + if (sk->sk_tsflags & SOF_TIMESTAMPING_TX_SOFTWARE) *tx_flags |= SKBTX_SW_TSTAMP; if (sock_flag(sk, SOCK_WIFI_STATUS)) *tx_flags |= SKBTX_WIFI_STATUS; @@ -723,12 +723,12 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk, } memset(&tss, 0, sizeof(tss)); - if ((sock_flag(sk, SOCK_TIMESTAMPING_SOFTWARE) || + if ((sk->sk_tsflags & SOF_TIMESTAMPING_SOFTWARE || skb_shinfo(skb)->tx_flags & SKBTX_ANY_SW_TSTAMP) && ktime_to_timespec_cond(skb->tstamp, tss.ts + 0)) empty = 0; if (shhwtstamps && - sock_flag(sk, SOCK_TIMESTAMPING_RAW_HARDWARE) && + (sk->sk_tsflags & SOF_TIMESTAMPING_RAW_HARDWARE) && ktime_to_timespec_cond(shhwtstamps->hwtstamp, tss.ts + 2)) empty = 0; if (!empty) |