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 /include/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 'include/net')
-rw-r--r-- | include/net/bluetooth/hci_core.h | 2 | ||||
-rw-r--r-- | include/net/neighbour.h | 9 | ||||
-rw-r--r-- | include/net/sock.h | 13 |
3 files changed, 17 insertions, 7 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 6d63a47c731b..7f933f302078 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -404,7 +404,7 @@ static inline int hci_recv_frame(struct sk_buff *skb) | |||
404 | bt_cb(skb)->incoming = 1; | 404 | bt_cb(skb)->incoming = 1; |
405 | 405 | ||
406 | /* Time stamp */ | 406 | /* Time stamp */ |
407 | do_gettimeofday(&skb->stamp); | 407 | __net_timestamp(skb); |
408 | 408 | ||
409 | /* Queue frame for rx task */ | 409 | /* Queue frame for rx task */ |
410 | skb_queue_tail(&hdev->rx_q, skb); | 410 | skb_queue_tail(&hdev->rx_q, skb); |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 89809891e5ab..34c07731933d 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -363,7 +363,14 @@ __neigh_lookup_errno(struct neigh_table *tbl, const void *pkey, | |||
363 | return neigh_create(tbl, pkey, dev); | 363 | return neigh_create(tbl, pkey, dev); |
364 | } | 364 | } |
365 | 365 | ||
366 | #define LOCALLY_ENQUEUED -2 | 366 | struct neighbour_cb { |
367 | unsigned long sched_next; | ||
368 | unsigned int flags; | ||
369 | }; | ||
370 | |||
371 | #define LOCALLY_ENQUEUED 0x1 | ||
372 | |||
373 | #define NEIGH_CB(skb) ((struct neighbour_cb *)(skb)->cb) | ||
367 | 374 | ||
368 | #endif | 375 | #endif |
369 | #endif | 376 | #endif |
diff --git a/include/net/sock.h b/include/net/sock.h index 065df67b6422..d59428877078 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1282,16 +1282,19 @@ static inline int sock_intr_errno(long timeo) | |||
1282 | static __inline__ void | 1282 | static __inline__ void |
1283 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | 1283 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) |
1284 | { | 1284 | { |
1285 | struct timeval *stamp = &skb->stamp; | 1285 | struct timeval stamp; |
1286 | |||
1287 | skb_get_timestamp(skb, &stamp); | ||
1286 | if (sock_flag(sk, SOCK_RCVTSTAMP)) { | 1288 | if (sock_flag(sk, SOCK_RCVTSTAMP)) { |
1287 | /* Race occurred between timestamp enabling and packet | 1289 | /* Race occurred between timestamp enabling and packet |
1288 | receiving. Fill in the current time for now. */ | 1290 | receiving. Fill in the current time for now. */ |
1289 | if (stamp->tv_sec == 0) | 1291 | if (stamp.tv_sec == 0) |
1290 | do_gettimeofday(stamp); | 1292 | do_gettimeofday(&stamp); |
1293 | skb_set_timestamp(skb, &stamp); | ||
1291 | put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP, sizeof(struct timeval), | 1294 | put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP, sizeof(struct timeval), |
1292 | stamp); | 1295 | &stamp); |
1293 | } else | 1296 | } else |
1294 | sk->sk_stamp = *stamp; | 1297 | sk->sk_stamp = stamp; |
1295 | } | 1298 | } |
1296 | 1299 | ||
1297 | /** | 1300 | /** |