diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-09-26 20:33:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-28 00:30:42 -0400 |
commit | 290b895e0ba4552dfcfc4bd35759c192345b934a (patch) | |
tree | 439ffccea9fa87b28b6af2a06e562cc5a0c01f80 /include/net/dst.h | |
parent | af5ef241133b602a77b682009f112e7c3f7604e5 (diff) |
tunnels: prepare percpu accounting
Tunnels are going to use percpu for their accounting.
They are going to use a new tstats field in net_device.
skb_tunnel_rx() is changed to be a wrapper around __skb_tunnel_rx()
IPTUNNEL_XMIT() is changed to be a wrapper around __IPTUNNEL_XMIT()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dst.h')
-rw-r--r-- | include/net/dst.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/include/net/dst.h b/include/net/dst.h index 02386505033d..aa53fbc34b2b 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -228,23 +228,37 @@ static inline void skb_dst_force(struct sk_buff *skb) | |||
228 | 228 | ||
229 | 229 | ||
230 | /** | 230 | /** |
231 | * __skb_tunnel_rx - prepare skb for rx reinsert | ||
232 | * @skb: buffer | ||
233 | * @dev: tunnel device | ||
234 | * | ||
235 | * After decapsulation, packet is going to re-enter (netif_rx()) our stack, | ||
236 | * so make some cleanups. (no accounting done) | ||
237 | */ | ||
238 | static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) | ||
239 | { | ||
240 | skb->dev = dev; | ||
241 | skb->rxhash = 0; | ||
242 | skb_set_queue_mapping(skb, 0); | ||
243 | skb_dst_drop(skb); | ||
244 | nf_reset(skb); | ||
245 | } | ||
246 | |||
247 | /** | ||
231 | * skb_tunnel_rx - prepare skb for rx reinsert | 248 | * skb_tunnel_rx - prepare skb for rx reinsert |
232 | * @skb: buffer | 249 | * @skb: buffer |
233 | * @dev: tunnel device | 250 | * @dev: tunnel device |
234 | * | 251 | * |
235 | * After decapsulation, packet is going to re-enter (netif_rx()) our stack, | 252 | * After decapsulation, packet is going to re-enter (netif_rx()) our stack, |
236 | * so make some cleanups, and perform accounting. | 253 | * so make some cleanups, and perform accounting. |
254 | * Note: this accounting is not SMP safe. | ||
237 | */ | 255 | */ |
238 | static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) | 256 | static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) |
239 | { | 257 | { |
240 | skb->dev = dev; | ||
241 | /* TODO : stats should be SMP safe */ | 258 | /* TODO : stats should be SMP safe */ |
242 | dev->stats.rx_packets++; | 259 | dev->stats.rx_packets++; |
243 | dev->stats.rx_bytes += skb->len; | 260 | dev->stats.rx_bytes += skb->len; |
244 | skb->rxhash = 0; | 261 | __skb_tunnel_rx(skb, dev); |
245 | skb_set_queue_mapping(skb, 0); | ||
246 | skb_dst_drop(skb); | ||
247 | nf_reset(skb); | ||
248 | } | 262 | } |
249 | 263 | ||
250 | /* Children define the path of the packet through the | 264 | /* Children define the path of the packet through the |