diff options
author | Patrick McHardy <kaber@trash.net> | 2005-08-14 20:24:31 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 18:58:24 -0400 |
commit | a61bbcf28a8cb0ba56f8193d512f7222e711a294 (patch) | |
tree | 33ae1976ab3b08aac516debb2742d2c6696d5436 /net | |
parent | 25ed891019b84498c83903ecf53df7ce35e9cff6 (diff) |
[NET]: Store skb->timestamp as offset to a base timestamp
Reduces skb size by 8 bytes on 64-bit.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_core.c | 2 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 2 | ||||
-rw-r--r-- | net/bluetooth/hci_sock.c | 8 | ||||
-rw-r--r-- | net/bridge/netfilter/ebt_ulog.c | 2 | ||||
-rw-r--r-- | net/core/dev.c | 28 | ||||
-rw-r--r-- | net/core/neighbour.c | 7 | ||||
-rw-r--r-- | net/core/skbuff.c | 8 | ||||
-rw-r--r-- | net/econet/af_econet.c | 2 | ||||
-rw-r--r-- | net/ipv4/arp.c | 4 | ||||
-rw-r--r-- | net/ipv4/ip_fragment.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_queue.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_ULOG.c | 8 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 10 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 4 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 4 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_queue.c | 4 | ||||
-rw-r--r-- | net/ipv6/reassembly.c | 4 | ||||
-rw-r--r-- | net/ipx/af_ipx.c | 4 | ||||
-rw-r--r-- | net/netfilter/nfnetlink_log.c | 6 | ||||
-rw-r--r-- | net/netfilter/nfnetlink_queue.c | 6 | ||||
-rw-r--r-- | net/packet/af_packet.c | 8 | ||||
-rw-r--r-- | net/sctp/input.c | 4 | ||||
-rw-r--r-- | net/sctp/sm_make_chunk.c | 9 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 11 |
24 files changed, 92 insertions, 61 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 4f9e11b533a..55dc42eac92 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -999,7 +999,7 @@ static int hci_send_frame(struct sk_buff *skb) | |||
999 | 999 | ||
1000 | if (atomic_read(&hdev->promisc)) { | 1000 | if (atomic_read(&hdev->promisc)) { |
1001 | /* Time stamp */ | 1001 | /* Time stamp */ |
1002 | do_gettimeofday(&skb->stamp); | 1002 | __net_timestamp(skb); |
1003 | 1003 | ||
1004 | hci_send_to_sock(hdev, skb); | 1004 | hci_send_to_sock(hdev, skb); |
1005 | } | 1005 | } |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 40b219560bb..d6da0939216 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -1087,7 +1087,7 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data) | |||
1087 | memcpy(ev->data, data, dlen); | 1087 | memcpy(ev->data, data, dlen); |
1088 | 1088 | ||
1089 | bt_cb(skb)->incoming = 1; | 1089 | bt_cb(skb)->incoming = 1; |
1090 | do_gettimeofday(&skb->stamp); | 1090 | __net_timestamp(skb); |
1091 | 1091 | ||
1092 | bt_cb(skb)->pkt_type = HCI_EVENT_PKT; | 1092 | bt_cb(skb)->pkt_type = HCI_EVENT_PKT; |
1093 | skb->dev = (void *) hdev; | 1093 | skb->dev = (void *) hdev; |
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index eed9090d77f..32ef7975a13 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -332,8 +332,12 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_ | |||
332 | put_cmsg(msg, SOL_HCI, HCI_CMSG_DIR, sizeof(incoming), &incoming); | 332 | put_cmsg(msg, SOL_HCI, HCI_CMSG_DIR, sizeof(incoming), &incoming); |
333 | } | 333 | } |
334 | 334 | ||
335 | if (mask & HCI_CMSG_TSTAMP) | 335 | if (mask & HCI_CMSG_TSTAMP) { |
336 | put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(skb->stamp), &skb->stamp); | 336 | struct timeval tv; |
337 | |||
338 | skb_get_timestamp(skb, &tv); | ||
339 | put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(tv), &tv); | ||
340 | } | ||
337 | } | 341 | } |
338 | 342 | ||
339 | static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | 343 | static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock, |
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c index 561d75c8ed5..acb888d3258 100644 --- a/net/bridge/netfilter/ebt_ulog.c +++ b/net/bridge/netfilter/ebt_ulog.c | |||
@@ -162,7 +162,7 @@ static void ebt_ulog(const struct sk_buff *skb, unsigned int hooknr, | |||
162 | pm->version = EBT_ULOG_VERSION; | 162 | pm->version = EBT_ULOG_VERSION; |
163 | do_gettimeofday(&pm->stamp); | 163 | do_gettimeofday(&pm->stamp); |
164 | if (ub->qlen == 1) | 164 | if (ub->qlen == 1) |
165 | ub->skb->stamp = pm->stamp; | 165 | skb_set_timestamp(ub->skb, &pm->stamp); |
166 | pm->data_len = copy_len; | 166 | pm->data_len = copy_len; |
167 | pm->mark = skb->nfmark; | 167 | pm->mark = skb->nfmark; |
168 | pm->hook = hooknr; | 168 | pm->hook = hooknr; |
diff --git a/net/core/dev.c b/net/core/dev.c index 9d153eb1e8c..a3ed53cc4af 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1009,13 +1009,22 @@ void net_disable_timestamp(void) | |||
1009 | atomic_dec(&netstamp_needed); | 1009 | atomic_dec(&netstamp_needed); |
1010 | } | 1010 | } |
1011 | 1011 | ||
1012 | static inline void net_timestamp(struct timeval *stamp) | 1012 | void __net_timestamp(struct sk_buff *skb) |
1013 | { | ||
1014 | struct timeval tv; | ||
1015 | |||
1016 | do_gettimeofday(&tv); | ||
1017 | skb_set_timestamp(skb, &tv); | ||
1018 | } | ||
1019 | EXPORT_SYMBOL(__net_timestamp); | ||
1020 | |||
1021 | static inline void net_timestamp(struct sk_buff *skb) | ||
1013 | { | 1022 | { |
1014 | if (atomic_read(&netstamp_needed)) | 1023 | if (atomic_read(&netstamp_needed)) |
1015 | do_gettimeofday(stamp); | 1024 | __net_timestamp(skb); |
1016 | else { | 1025 | else { |
1017 | stamp->tv_sec = 0; | 1026 | skb->tstamp.off_sec = 0; |
1018 | stamp->tv_usec = 0; | 1027 | skb->tstamp.off_usec = 0; |
1019 | } | 1028 | } |
1020 | } | 1029 | } |
1021 | 1030 | ||
@@ -1027,7 +1036,8 @@ static inline void net_timestamp(struct timeval *stamp) | |||
1027 | void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) | 1036 | void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) |
1028 | { | 1037 | { |
1029 | struct packet_type *ptype; | 1038 | struct packet_type *ptype; |
1030 | net_timestamp(&skb->stamp); | 1039 | |
1040 | net_timestamp(skb); | ||
1031 | 1041 | ||
1032 | rcu_read_lock(); | 1042 | rcu_read_lock(); |
1033 | list_for_each_entry_rcu(ptype, &ptype_all, list) { | 1043 | list_for_each_entry_rcu(ptype, &ptype_all, list) { |
@@ -1379,8 +1389,8 @@ int netif_rx(struct sk_buff *skb) | |||
1379 | if (netpoll_rx(skb)) | 1389 | if (netpoll_rx(skb)) |
1380 | return NET_RX_DROP; | 1390 | return NET_RX_DROP; |
1381 | 1391 | ||
1382 | if (!skb->stamp.tv_sec) | 1392 | if (!skb->tstamp.off_sec) |
1383 | net_timestamp(&skb->stamp); | 1393 | net_timestamp(skb); |
1384 | 1394 | ||
1385 | /* | 1395 | /* |
1386 | * The code is rearranged so that the path is the most | 1396 | * The code is rearranged so that the path is the most |
@@ -1566,8 +1576,8 @@ int netif_receive_skb(struct sk_buff *skb) | |||
1566 | if (skb->dev->poll && netpoll_rx(skb)) | 1576 | if (skb->dev->poll && netpoll_rx(skb)) |
1567 | return NET_RX_DROP; | 1577 | return NET_RX_DROP; |
1568 | 1578 | ||
1569 | if (!skb->stamp.tv_sec) | 1579 | if (!skb->tstamp.off_sec) |
1570 | net_timestamp(&skb->stamp); | 1580 | net_timestamp(skb); |
1571 | 1581 | ||
1572 | if (!skb->input_dev) | 1582 | if (!skb->input_dev) |
1573 | skb->input_dev = skb->dev; | 1583 | skb->input_dev = skb->dev; |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 1beb782ac41..72ee00f7b30 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -1217,7 +1217,7 @@ static void neigh_proxy_process(unsigned long arg) | |||
1217 | 1217 | ||
1218 | while (skb != (struct sk_buff *)&tbl->proxy_queue) { | 1218 | while (skb != (struct sk_buff *)&tbl->proxy_queue) { |
1219 | struct sk_buff *back = skb; | 1219 | struct sk_buff *back = skb; |
1220 | long tdif = back->stamp.tv_usec - now; | 1220 | long tdif = NEIGH_CB(back)->sched_next - now; |
1221 | 1221 | ||
1222 | skb = skb->next; | 1222 | skb = skb->next; |
1223 | if (tdif <= 0) { | 1223 | if (tdif <= 0) { |
@@ -1248,8 +1248,9 @@ void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p, | |||
1248 | kfree_skb(skb); | 1248 | kfree_skb(skb); |
1249 | return; | 1249 | return; |
1250 | } | 1250 | } |
1251 | skb->stamp.tv_sec = LOCALLY_ENQUEUED; | 1251 | |
1252 | skb->stamp.tv_usec = sched_next; | 1252 | NEIGH_CB(skb)->sched_next = sched_next; |
1253 | NEIGH_CB(skb)->flags |= LOCALLY_ENQUEUED; | ||
1253 | 1254 | ||
1254 | spin_lock(&tbl->proxy_queue.lock); | 1255 | spin_lock(&tbl->proxy_queue.lock); |
1255 | if (del_timer(&tbl->proxy_timer)) { | 1256 | if (del_timer(&tbl->proxy_timer)) { |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index ef498cb9f78..39a161dbc16 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -70,6 +70,8 @@ | |||
70 | 70 | ||
71 | static kmem_cache_t *skbuff_head_cache; | 71 | static kmem_cache_t *skbuff_head_cache; |
72 | 72 | ||
73 | struct timeval __read_mostly skb_tv_base; | ||
74 | |||
73 | /* | 75 | /* |
74 | * Keep out-of-line to prevent kernel bloat. | 76 | * Keep out-of-line to prevent kernel bloat. |
75 | * __builtin_return_address is not used because it is not always | 77 | * __builtin_return_address is not used because it is not always |
@@ -331,7 +333,7 @@ struct sk_buff *skb_clone(struct sk_buff *skb, unsigned int __nocast gfp_mask) | |||
331 | 333 | ||
332 | n->next = n->prev = NULL; | 334 | n->next = n->prev = NULL; |
333 | n->sk = NULL; | 335 | n->sk = NULL; |
334 | C(stamp); | 336 | C(tstamp); |
335 | C(dev); | 337 | C(dev); |
336 | C(h); | 338 | C(h); |
337 | C(nh); | 339 | C(nh); |
@@ -408,7 +410,7 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) | |||
408 | memcpy(new->cb, old->cb, sizeof(old->cb)); | 410 | memcpy(new->cb, old->cb, sizeof(old->cb)); |
409 | new->local_df = old->local_df; | 411 | new->local_df = old->local_df; |
410 | new->pkt_type = old->pkt_type; | 412 | new->pkt_type = old->pkt_type; |
411 | new->stamp = old->stamp; | 413 | new->tstamp = old->tstamp; |
412 | new->destructor = NULL; | 414 | new->destructor = NULL; |
413 | #ifdef CONFIG_NETFILTER | 415 | #ifdef CONFIG_NETFILTER |
414 | new->nfmark = old->nfmark; | 416 | new->nfmark = old->nfmark; |
@@ -1645,6 +1647,7 @@ void __init skb_init(void) | |||
1645 | NULL, NULL); | 1647 | NULL, NULL); |
1646 | if (!skbuff_head_cache) | 1648 | if (!skbuff_head_cache) |
1647 | panic("cannot create skbuff cache"); | 1649 | panic("cannot create skbuff cache"); |
1650 | do_gettimeofday(&skb_tv_base); | ||
1648 | } | 1651 | } |
1649 | 1652 | ||
1650 | EXPORT_SYMBOL(___pskb_trim); | 1653 | EXPORT_SYMBOL(___pskb_trim); |
@@ -1678,3 +1681,4 @@ EXPORT_SYMBOL(skb_prepare_seq_read); | |||
1678 | EXPORT_SYMBOL(skb_seq_read); | 1681 | EXPORT_SYMBOL(skb_seq_read); |
1679 | EXPORT_SYMBOL(skb_abort_seq_read); | 1682 | EXPORT_SYMBOL(skb_abort_seq_read); |
1680 | EXPORT_SYMBOL(skb_find_text); | 1683 | EXPORT_SYMBOL(skb_find_text); |
1684 | EXPORT_SYMBOL(skb_tv_base); | ||
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index 8f063990555..4a62093eb34 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c | |||
@@ -159,7 +159,7 @@ static int econet_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
159 | err = memcpy_toiovec(msg->msg_iov, skb->data, copied); | 159 | err = memcpy_toiovec(msg->msg_iov, skb->data, copied); |
160 | if (err) | 160 | if (err) |
161 | goto out_free; | 161 | goto out_free; |
162 | sk->sk_stamp = skb->stamp; | 162 | skb_get_timestamp(skb, &sk->sk_stamp); |
163 | 163 | ||
164 | if (msg->msg_name) | 164 | if (msg->msg_name) |
165 | memcpy(msg->msg_name, skb->cb, msg->msg_namelen); | 165 | memcpy(msg->msg_name, skb->cb, msg->msg_namelen); |
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 6eb9c549d64..8bf312bdea1 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -865,7 +865,7 @@ static int arp_process(struct sk_buff *skb) | |||
865 | if (n) | 865 | if (n) |
866 | neigh_release(n); | 866 | neigh_release(n); |
867 | 867 | ||
868 | if (skb->stamp.tv_sec == LOCALLY_ENQUEUED || | 868 | if (NEIGH_CB(skb)->flags & LOCALLY_ENQUEUED || |
869 | skb->pkt_type == PACKET_HOST || | 869 | skb->pkt_type == PACKET_HOST || |
870 | in_dev->arp_parms->proxy_delay == 0) { | 870 | in_dev->arp_parms->proxy_delay == 0) { |
871 | arp_send(ARPOP_REPLY,ETH_P_ARP,sip,dev,tip,sha,dev->dev_addr,sha); | 871 | arp_send(ARPOP_REPLY,ETH_P_ARP,sip,dev,tip,sha,dev->dev_addr,sha); |
@@ -948,6 +948,8 @@ int arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, | |||
948 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) | 948 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) |
949 | goto out_of_mem; | 949 | goto out_of_mem; |
950 | 950 | ||
951 | memset(NEIGH_CB(skb), 0, sizeof(struct neighbour_cb)); | ||
952 | |||
951 | return NF_HOOK(NF_ARP, NF_ARP_IN, skb, dev, NULL, arp_process); | 953 | return NF_HOOK(NF_ARP, NF_ARP_IN, skb, dev, NULL, arp_process); |
952 | 954 | ||
953 | freeskb: | 955 | freeskb: |
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index 1ac64c0c5b3..9e6e683cc34 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -533,7 +533,7 @@ static void ip_frag_queue(struct ipq *qp, struct sk_buff *skb) | |||
533 | if (skb->dev) | 533 | if (skb->dev) |
534 | qp->iif = skb->dev->ifindex; | 534 | qp->iif = skb->dev->ifindex; |
535 | skb->dev = NULL; | 535 | skb->dev = NULL; |
536 | qp->stamp = skb->stamp; | 536 | skb_get_timestamp(skb, &qp->stamp); |
537 | qp->meat += skb->len; | 537 | qp->meat += skb->len; |
538 | atomic_add(skb->truesize, &ip_frag_mem); | 538 | atomic_add(skb->truesize, &ip_frag_mem); |
539 | if (offset == 0) | 539 | if (offset == 0) |
@@ -615,7 +615,7 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev) | |||
615 | 615 | ||
616 | head->next = NULL; | 616 | head->next = NULL; |
617 | head->dev = dev; | 617 | head->dev = dev; |
618 | head->stamp = qp->stamp; | 618 | skb_set_timestamp(head, &qp->stamp); |
619 | 619 | ||
620 | iph = head->nh.iph; | 620 | iph = head->nh.iph; |
621 | iph->frag_off = 0; | 621 | iph->frag_off = 0; |
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index 1c49833e00a..7f2bcc7198f 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c | |||
@@ -240,8 +240,8 @@ ipq_build_packet_message(struct ipq_queue_entry *entry, int *errp) | |||
240 | 240 | ||
241 | pmsg->packet_id = (unsigned long )entry; | 241 | pmsg->packet_id = (unsigned long )entry; |
242 | pmsg->data_len = data_len; | 242 | pmsg->data_len = data_len; |
243 | pmsg->timestamp_sec = entry->skb->stamp.tv_sec; | 243 | pmsg->timestamp_sec = skb_tv_base.tv_sec + entry->skb->tstamp.off_sec; |
244 | pmsg->timestamp_usec = entry->skb->stamp.tv_usec; | 244 | pmsg->timestamp_usec = skb_tv_base.tv_usec + entry->skb->tstamp.off_usec; |
245 | pmsg->mark = entry->skb->nfmark; | 245 | pmsg->mark = entry->skb->nfmark; |
246 | pmsg->hook = entry->info->hook; | 246 | pmsg->hook = entry->info->hook; |
247 | pmsg->hw_protocol = entry->skb->protocol; | 247 | pmsg->hw_protocol = entry->skb->protocol; |
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index b86f06ec976..1d8ac4595e1 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
@@ -220,13 +220,13 @@ static void ipt_ulog_packet(unsigned int hooknum, | |||
220 | pm = NLMSG_DATA(nlh); | 220 | pm = NLMSG_DATA(nlh); |
221 | 221 | ||
222 | /* We might not have a timestamp, get one */ | 222 | /* We might not have a timestamp, get one */ |
223 | if (skb->stamp.tv_sec == 0) | 223 | if (skb->tstamp.off_sec == 0) |
224 | do_gettimeofday((struct timeval *)&skb->stamp); | 224 | __net_timestamp((struct sk_buff *)skb); |
225 | 225 | ||
226 | /* copy hook, prefix, timestamp, payload, etc. */ | 226 | /* copy hook, prefix, timestamp, payload, etc. */ |
227 | pm->data_len = copy_len; | 227 | pm->data_len = copy_len; |
228 | pm->timestamp_sec = skb->stamp.tv_sec; | 228 | pm->timestamp_sec = skb_tv_base.tv_sec + skb->tstamp.off_sec; |
229 | pm->timestamp_usec = skb->stamp.tv_usec; | 229 | pm->timestamp_usec = skb_tv_base.tv_usec + skb->tstamp.off_usec; |
230 | pm->mark = skb->nfmark; | 230 | pm->mark = skb->nfmark; |
231 | pm->hook = hooknum; | 231 | pm->hook = hooknum; |
232 | if (prefix != NULL) | 232 | if (prefix != NULL) |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index fdd9547fb78..ebb8654e3de 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2097,9 +2097,13 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p, s32 *seq_usrtt | |||
2097 | seq_rtt = -1; | 2097 | seq_rtt = -1; |
2098 | } else if (seq_rtt < 0) | 2098 | } else if (seq_rtt < 0) |
2099 | seq_rtt = now - scb->when; | 2099 | seq_rtt = now - scb->when; |
2100 | if (seq_usrtt) | 2100 | if (seq_usrtt) { |
2101 | *seq_usrtt = (usnow.tv_sec - skb->stamp.tv_sec) * 1000000 | 2101 | struct timeval tv; |
2102 | + (usnow.tv_usec - skb->stamp.tv_usec); | 2102 | |
2103 | skb_get_timestamp(skb, &tv); | ||
2104 | *seq_usrtt = (usnow.tv_sec - tv.tv_sec) * 1000000 | ||
2105 | + (usnow.tv_usec - tv.tv_usec); | ||
2106 | } | ||
2103 | 2107 | ||
2104 | if (sacked & TCPCB_SACKED_ACKED) | 2108 | if (sacked & TCPCB_SACKED_ACKED) |
2105 | tp->sacked_out -= tcp_skb_pcount(skb); | 2109 | tp->sacked_out -= tcp_skb_pcount(skb); |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 267b0fcbfc9..8d92ab562ae 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -282,7 +282,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb) | |||
282 | 282 | ||
283 | /* If congestion control is doing timestamping */ | 283 | /* If congestion control is doing timestamping */ |
284 | if (icsk->icsk_ca_ops->rtt_sample) | 284 | if (icsk->icsk_ca_ops->rtt_sample) |
285 | do_gettimeofday(&skb->stamp); | 285 | __net_timestamp(skb); |
286 | 286 | ||
287 | sysctl_flags = 0; | 287 | sysctl_flags = 0; |
288 | if (tcb->flags & TCPCB_FLAG_SYN) { | 288 | if (tcb->flags & TCPCB_FLAG_SYN) { |
@@ -483,7 +483,7 @@ static int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned | |||
483 | * skbs, which it never sent before. --ANK | 483 | * skbs, which it never sent before. --ANK |
484 | */ | 484 | */ |
485 | TCP_SKB_CB(buff)->when = TCP_SKB_CB(skb)->when; | 485 | TCP_SKB_CB(buff)->when = TCP_SKB_CB(skb)->when; |
486 | buff->stamp = skb->stamp; | 486 | buff->tstamp = skb->tstamp; |
487 | 487 | ||
488 | if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) { | 488 | if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) { |
489 | tp->lost_out -= tcp_skb_pcount(skb); | 489 | tp->lost_out -= tcp_skb_pcount(skb); |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 7ae72d4c9bd..a7eae30f455 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -812,7 +812,7 @@ static void ndisc_recv_ns(struct sk_buff *skb) | |||
812 | if (ipv6_chk_acast_addr(dev, &msg->target) || | 812 | if (ipv6_chk_acast_addr(dev, &msg->target) || |
813 | (idev->cnf.forwarding && | 813 | (idev->cnf.forwarding && |
814 | pneigh_lookup(&nd_tbl, &msg->target, dev, 0))) { | 814 | pneigh_lookup(&nd_tbl, &msg->target, dev, 0))) { |
815 | if (skb->stamp.tv_sec != LOCALLY_ENQUEUED && | 815 | if (!(NEIGH_CB(skb)->flags & LOCALLY_ENQUEUED) && |
816 | skb->pkt_type != PACKET_HOST && | 816 | skb->pkt_type != PACKET_HOST && |
817 | inc != 0 && | 817 | inc != 0 && |
818 | idev->nd_parms->proxy_delay != 0) { | 818 | idev->nd_parms->proxy_delay != 0) { |
@@ -1487,6 +1487,8 @@ int ndisc_rcv(struct sk_buff *skb) | |||
1487 | return 0; | 1487 | return 0; |
1488 | } | 1488 | } |
1489 | 1489 | ||
1490 | memset(NEIGH_CB(skb), 0, sizeof(struct neighbour_cb)); | ||
1491 | |||
1490 | switch (msg->icmph.icmp6_type) { | 1492 | switch (msg->icmph.icmp6_type) { |
1491 | case NDISC_NEIGHBOUR_SOLICITATION: | 1493 | case NDISC_NEIGHBOUR_SOLICITATION: |
1492 | ndisc_recv_ns(skb); | 1494 | ndisc_recv_ns(skb); |
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c index 7ecb91e24a3..446764545b1 100644 --- a/net/ipv6/netfilter/ip6_queue.c +++ b/net/ipv6/netfilter/ip6_queue.c | |||
@@ -238,8 +238,8 @@ ipq_build_packet_message(struct ipq_queue_entry *entry, int *errp) | |||
238 | 238 | ||
239 | pmsg->packet_id = (unsigned long )entry; | 239 | pmsg->packet_id = (unsigned long )entry; |
240 | pmsg->data_len = data_len; | 240 | pmsg->data_len = data_len; |
241 | pmsg->timestamp_sec = entry->skb->stamp.tv_sec; | 241 | pmsg->timestamp_sec = skb_tv_base.tv_sec + entry->skb->tstamp.off_sec; |
242 | pmsg->timestamp_usec = entry->skb->stamp.tv_usec; | 242 | pmsg->timestamp_usec = skb_tv_base.tv_usec + entry->skb->tstamp.off_usec; |
243 | pmsg->mark = entry->skb->nfmark; | 243 | pmsg->mark = entry->skb->nfmark; |
244 | pmsg->hook = entry->info->hook; | 244 | pmsg->hook = entry->info->hook; |
245 | pmsg->hw_protocol = entry->skb->protocol; | 245 | pmsg->hw_protocol = entry->skb->protocol; |
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 59e7c631787..9d9e04344c7 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c | |||
@@ -562,7 +562,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb, | |||
562 | if (skb->dev) | 562 | if (skb->dev) |
563 | fq->iif = skb->dev->ifindex; | 563 | fq->iif = skb->dev->ifindex; |
564 | skb->dev = NULL; | 564 | skb->dev = NULL; |
565 | fq->stamp = skb->stamp; | 565 | skb_get_timestamp(skb, &fq->stamp); |
566 | fq->meat += skb->len; | 566 | fq->meat += skb->len; |
567 | atomic_add(skb->truesize, &ip6_frag_mem); | 567 | atomic_add(skb->truesize, &ip6_frag_mem); |
568 | 568 | ||
@@ -664,7 +664,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in, | |||
664 | 664 | ||
665 | head->next = NULL; | 665 | head->next = NULL; |
666 | head->dev = dev; | 666 | head->dev = dev; |
667 | head->stamp = fq->stamp; | 667 | skb_set_timestamp(head, &fq->stamp); |
668 | head->nh.ipv6h->payload_len = htons(payload_len); | 668 | head->nh.ipv6h->payload_len = htons(payload_len); |
669 | 669 | ||
670 | *skb_in = head; | 670 | *skb_in = head; |
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index 39d5939ccd6..c54f8acc97e 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c | |||
@@ -1796,8 +1796,8 @@ static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1796 | copied); | 1796 | copied); |
1797 | if (rc) | 1797 | if (rc) |
1798 | goto out_free; | 1798 | goto out_free; |
1799 | if (skb->stamp.tv_sec) | 1799 | if (skb->tstamp.off_sec) |
1800 | sk->sk_stamp = skb->stamp; | 1800 | skb_get_timestamp(skb, &sk->sk_stamp) |
1801 | 1801 | ||
1802 | msg->msg_namelen = sizeof(*sipx); | 1802 | msg->msg_namelen = sizeof(*sipx); |
1803 | 1803 | ||
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 464c9fa2934..ff5601ceedc 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -491,11 +491,11 @@ __build_packet_message(struct nfulnl_instance *inst, | |||
491 | NFA_PUT(inst->skb, NFULA_HWADDR, sizeof(phw), &phw); | 491 | NFA_PUT(inst->skb, NFULA_HWADDR, sizeof(phw), &phw); |
492 | } | 492 | } |
493 | 493 | ||
494 | if (skb->stamp.tv_sec) { | 494 | if (skb->tstamp.off_sec) { |
495 | struct nfulnl_msg_packet_timestamp ts; | 495 | struct nfulnl_msg_packet_timestamp ts; |
496 | 496 | ||
497 | ts.sec = cpu_to_be64(skb->stamp.tv_sec); | 497 | ts.sec = cpu_to_be64(skb_tv_base.tv_sec + skb->tstamp.off_sec); |
498 | ts.usec = cpu_to_be64(skb->stamp.tv_usec); | 498 | ts.usec = cpu_to_be64(skb_tv_base.tv_usec + skb->tstamp.off_usec); |
499 | 499 | ||
500 | NFA_PUT(inst->skb, NFULA_TIMESTAMP, sizeof(ts), &ts); | 500 | NFA_PUT(inst->skb, NFULA_TIMESTAMP, sizeof(ts), &ts); |
501 | } | 501 | } |
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 741686ff71d..e3a5285329a 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c | |||
@@ -494,11 +494,11 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue, | |||
494 | NFA_PUT(skb, NFQA_HWADDR, sizeof(phw), &phw); | 494 | NFA_PUT(skb, NFQA_HWADDR, sizeof(phw), &phw); |
495 | } | 495 | } |
496 | 496 | ||
497 | if (entry->skb->stamp.tv_sec) { | 497 | if (entry->skb->tstamp.off_sec) { |
498 | struct nfqnl_msg_packet_timestamp ts; | 498 | struct nfqnl_msg_packet_timestamp ts; |
499 | 499 | ||
500 | ts.sec = htonll(entry->skb->stamp.tv_sec); | 500 | ts.sec = htonll(skb_tv_base.tv_sec + entry->skb->tstamp.off_sec); |
501 | ts.usec = htonll(entry->skb->stamp.tv_usec); | 501 | ts.usec = htonll(skb_tv_base.tv_usec + entry->skb->tstamp.off_usec); |
502 | 502 | ||
503 | NFA_PUT(skb, NFQA_TIMESTAMP, sizeof(ts), &ts); | 503 | NFA_PUT(skb, NFQA_TIMESTAMP, sizeof(ts), &ts); |
504 | } | 504 | } |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index deb5f6f7f85..ba997095f08 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -635,12 +635,12 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe | |||
635 | h->tp_snaplen = snaplen; | 635 | h->tp_snaplen = snaplen; |
636 | h->tp_mac = macoff; | 636 | h->tp_mac = macoff; |
637 | h->tp_net = netoff; | 637 | h->tp_net = netoff; |
638 | if (skb->stamp.tv_sec == 0) { | 638 | if (skb->tstamp.off_sec == 0) { |
639 | do_gettimeofday(&skb->stamp); | 639 | __net_timestamp(skb); |
640 | sock_enable_timestamp(sk); | 640 | sock_enable_timestamp(sk); |
641 | } | 641 | } |
642 | h->tp_sec = skb->stamp.tv_sec; | 642 | h->tp_sec = skb_tv_base.tv_sec + skb->tstamp.off_sec; |
643 | h->tp_usec = skb->stamp.tv_usec; | 643 | h->tp_usec = skb_tv_base.tv_usec + skb->tstamp.off_usec; |
644 | 644 | ||
645 | sll = (struct sockaddr_ll*)((u8*)h + TPACKET_ALIGN(sizeof(*h))); | 645 | sll = (struct sockaddr_ll*)((u8*)h + TPACKET_ALIGN(sizeof(*h))); |
646 | sll->sll_halen = 0; | 646 | sll->sll_halen = 0; |
diff --git a/net/sctp/input.c b/net/sctp/input.c index 742be9171b7..28f32243397 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -236,8 +236,8 @@ int sctp_rcv(struct sk_buff *skb) | |||
236 | } | 236 | } |
237 | 237 | ||
238 | /* SCTP seems to always need a timestamp right now (FIXME) */ | 238 | /* SCTP seems to always need a timestamp right now (FIXME) */ |
239 | if (skb->stamp.tv_sec == 0) { | 239 | if (skb->tstamp.off_sec == 0) { |
240 | do_gettimeofday(&skb->stamp); | 240 | __net_timestamp(skb); |
241 | sock_enable_timestamp(sk); | 241 | sock_enable_timestamp(sk); |
242 | } | 242 | } |
243 | 243 | ||
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 00d32b7c826..3868a8d70cc 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -1362,6 +1362,7 @@ struct sctp_association *sctp_unpack_cookie( | |||
1362 | char *key; | 1362 | char *key; |
1363 | sctp_scope_t scope; | 1363 | sctp_scope_t scope; |
1364 | struct sk_buff *skb = chunk->skb; | 1364 | struct sk_buff *skb = chunk->skb; |
1365 | struct timeval tv; | ||
1365 | 1366 | ||
1366 | headersize = sizeof(sctp_chunkhdr_t) + SCTP_SECRET_SIZE; | 1367 | headersize = sizeof(sctp_chunkhdr_t) + SCTP_SECRET_SIZE; |
1367 | bodysize = ntohs(chunk->chunk_hdr->length) - headersize; | 1368 | bodysize = ntohs(chunk->chunk_hdr->length) - headersize; |
@@ -1434,7 +1435,8 @@ no_hmac: | |||
1434 | * an association, there is no need to check cookie's expiration | 1435 | * an association, there is no need to check cookie's expiration |
1435 | * for init collision case of lost COOKIE ACK. | 1436 | * for init collision case of lost COOKIE ACK. |
1436 | */ | 1437 | */ |
1437 | if (!asoc && tv_lt(bear_cookie->expiration, skb->stamp)) { | 1438 | skb_get_timestamp(skb, &tv); |
1439 | if (!asoc && tv_lt(bear_cookie->expiration, tv)) { | ||
1438 | __u16 len; | 1440 | __u16 len; |
1439 | /* | 1441 | /* |
1440 | * Section 3.3.10.3 Stale Cookie Error (3) | 1442 | * Section 3.3.10.3 Stale Cookie Error (3) |
@@ -1447,10 +1449,9 @@ no_hmac: | |||
1447 | len = ntohs(chunk->chunk_hdr->length); | 1449 | len = ntohs(chunk->chunk_hdr->length); |
1448 | *errp = sctp_make_op_error_space(asoc, chunk, len); | 1450 | *errp = sctp_make_op_error_space(asoc, chunk, len); |
1449 | if (*errp) { | 1451 | if (*errp) { |
1450 | suseconds_t usecs = (skb->stamp.tv_sec - | 1452 | suseconds_t usecs = (tv.tv_sec - |
1451 | bear_cookie->expiration.tv_sec) * 1000000L + | 1453 | bear_cookie->expiration.tv_sec) * 1000000L + |
1452 | skb->stamp.tv_usec - | 1454 | tv.tv_usec - bear_cookie->expiration.tv_usec; |
1453 | bear_cookie->expiration.tv_usec; | ||
1454 | 1455 | ||
1455 | usecs = htonl(usecs); | 1456 | usecs = htonl(usecs); |
1456 | sctp_init_cause(*errp, SCTP_ERROR_STALE_COOKIE, | 1457 | sctp_init_cause(*errp, SCTP_ERROR_STALE_COOKIE, |
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 199d3747bd4..05fe2e73553 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -584,13 +584,16 @@ svc_udp_recvfrom(struct svc_rqst *rqstp) | |||
584 | /* possibly an icmp error */ | 584 | /* possibly an icmp error */ |
585 | dprintk("svc: recvfrom returned error %d\n", -err); | 585 | dprintk("svc: recvfrom returned error %d\n", -err); |
586 | } | 586 | } |
587 | if (skb->stamp.tv_sec == 0) { | 587 | if (skb->tstamp.off_sec == 0) { |
588 | skb->stamp.tv_sec = xtime.tv_sec; | 588 | struct timeval tv; |
589 | skb->stamp.tv_usec = xtime.tv_nsec / NSEC_PER_USEC; | 589 | |
590 | tv.tv_sec = xtime.tv_sec; | ||
591 | tv.tv_usec = xtime.tv_nsec * 1000; | ||
592 | skb_set_timestamp(skb, &tv); | ||
590 | /* Don't enable netstamp, sunrpc doesn't | 593 | /* Don't enable netstamp, sunrpc doesn't |
591 | need that much accuracy */ | 594 | need that much accuracy */ |
592 | } | 595 | } |
593 | svsk->sk_sk->sk_stamp = skb->stamp; | 596 | skb_get_timestamp(skb, &svsk->sk_sk->sk_stamp); |
594 | set_bit(SK_DATA, &svsk->sk_flags); /* there may be more data... */ | 597 | set_bit(SK_DATA, &svsk->sk_flags); /* there may be more data... */ |
595 | 598 | ||
596 | /* | 599 | /* |