aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/sch_generic.h20
-rw-r--r--include/net/xfrm.h2
2 files changed, 17 insertions, 5 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,
313extern void tcf_destroy(struct tcf_proto *tp); 313extern void tcf_destroy(struct tcf_proto *tp);
314extern void tcf_destroy_chain(struct tcf_proto **fl); 314extern void tcf_destroy_chain(struct tcf_proto **fl);
315 315
316/* Reset all TX qdiscs of a device. */ 316/* Reset all TX qdiscs greater then index of a device. */
317static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
318{
319 struct Qdisc *qdisc;
320
321 for (; i < dev->num_tx_queues; i++) {
322 qdisc = netdev_get_tx_queue(dev, i)->qdisc;
323 if (qdisc) {
324 spin_lock_bh(qdisc_lock(qdisc));
325 qdisc_reset(qdisc);
326 spin_unlock_bh(qdisc_lock(qdisc));
327 }
328 }
329}
330
317static inline void qdisc_reset_all_tx(struct net_device *dev) 331static inline void qdisc_reset_all_tx(struct net_device *dev)
318{ 332{
319 unsigned int i; 333 qdisc_reset_all_tx_gt(dev, 0);
320 for (i = 0; i < dev->num_tx_queues; i++)
321 qdisc_reset(netdev_get_tx_queue(dev, i)->qdisc);
322} 334}
323 335
324/* Are all TX queues of the device empty? */ 336/* Are all TX queues of the device empty? */
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)
1586static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m) 1586static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m)
1587{ 1587{
1588 if (attrs[XFRMA_MARK]) 1588 if (attrs[XFRMA_MARK])
1589 memcpy(m, nla_data(attrs[XFRMA_MARK]), sizeof(m)); 1589 memcpy(m, nla_data(attrs[XFRMA_MARK]), sizeof(struct xfrm_mark));
1590 else 1590 else
1591 m->v = m->m = 0; 1591 m->v = m->m = 0;
1592 1592