diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-07-21 21:43:03 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-07-21 21:43:06 +0200 |
commit | 9dcdbf7a33d9018ac5d45debcf261be648bdd56a (patch) | |
tree | bbcc1a018f11ff76cd7ce174ef3ffe2c02da07ee /include/net | |
parent | cc5edb0eb9ce892b530e34a5d110382483587942 (diff) | |
parent | cd5b8f8755a89a57fc8c408d284b8b613f090345 (diff) | |
download | talos-op-linux-9dcdbf7a33d9018ac5d45debcf261be648bdd56a.tar.gz talos-op-linux-9dcdbf7a33d9018ac5d45debcf261be648bdd56a.zip |
Merge branch 'linus' into perf/core
Merge reason: Pick up the latest perf fixes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sch_generic.h | 20 | ||||
-rw-r--r-- | include/net/sock.h | 7 | ||||
-rw-r--r-- | include/net/xfrm.h | 2 |
3 files changed, 18 insertions, 11 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 03ca5d826757..433604bb3fe8 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -313,12 +313,24 @@ extern void qdisc_calculate_pkt_len(struct sk_buff *skb, extern void tcf_destroy(struct tcf_proto *tp); extern void tcf_destroy_chain(struct tcf_proto **fl); -/* Reset all TX qdiscs of a device. */ +/* Reset all TX qdiscs greater then index of a device. */ +static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i) +{ + struct Qdisc *qdisc; + + for (; i < dev->num_tx_queues; i++) { + qdisc = netdev_get_tx_queue(dev, i)->qdisc; + if (qdisc) { + spin_lock_bh(qdisc_lock(qdisc)); + qdisc_reset(qdisc); + spin_unlock_bh(qdisc_lock(qdisc)); + } + } +} + static inline void qdisc_reset_all_tx(struct net_device *dev) { - unsigned int i; - for (i = 0; i < dev->num_tx_queues; i++) - qdisc_reset(netdev_get_tx_queue(dev, i)->qdisc); + qdisc_reset_all_tx_gt(dev, 0); } /* Are all TX queues of the device empty? */ diff --git a/include/net/sock.h b/include/net/sock.h index 731150d52799..0a691ea7654a 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -1224,12 +1224,7 @@ static inline void sk_tx_queue_clear(struct sock *sk) static inline int sk_tx_queue_get(const struct sock *sk) { - return sk->sk_tx_queue_mapping; -} - -static inline bool sk_tx_queue_recorded(const struct sock *sk) -{ - return (sk && sk->sk_tx_queue_mapping >= 0); + return sk ? sk->sk_tx_queue_mapping : -1; } static inline void sk_set_socket(struct sock *sk, struct socket *sock) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 1913af67c43d..fc8f36dd0f5c 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -1586,7 +1586,7 @@ static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb) static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m) { if (attrs[XFRMA_MARK]) - memcpy(m, nla_data(attrs[XFRMA_MARK]), sizeof(m)); + memcpy(m, nla_data(attrs[XFRMA_MARK]), sizeof(struct xfrm_mark)); else m->v = m->m = 0; |