提交 4e3ab47a 编写于 作者: P Pavel Emelyanov 提交者: David S. Miller

[NET]: Make and use skb_get_queue_mapping

Make the helper for getting the field, symmetrical to
the "set" one. Return 0 if CONFIG_NETDEVICES_MULTIQUEUE=n
Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 dfa40911
...@@ -471,7 +471,7 @@ static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -471,7 +471,7 @@ static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
} }
len = max(skb->len, ETH_ZLEN); len = max(skb->len, ETH_ZLEN);
queue = skb->queue_mapping; queue = skb_get_queue_mapping(skb);
#ifdef CONFIG_NETDEVICES_MULTIQUEUE #ifdef CONFIG_NETDEVICES_MULTIQUEUE
netif_stop_subqueue(dev, queue); netif_stop_subqueue(dev, queue);
#else #else
......
...@@ -1769,6 +1769,15 @@ static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping) ...@@ -1769,6 +1769,15 @@ static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
#endif #endif
} }
static inline u16 skb_get_queue_mapping(struct sk_buff *skb)
{
#ifdef CONFIG_NETDEVICES_MULTIQUEUE
return skb->queue_mapping;
#else
return 0;
#endif
}
static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from) static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from)
{ {
#ifdef CONFIG_NETDEVICES_MULTIQUEUE #ifdef CONFIG_NETDEVICES_MULTIQUEUE
......
...@@ -266,7 +266,7 @@ static int teql_master_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -266,7 +266,7 @@ static int teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
int busy; int busy;
int nores; int nores;
int len = skb->len; int len = skb->len;
int subq = skb->queue_mapping; int subq = skb_get_queue_mapping(skb);
struct sk_buff *skb_res = NULL; struct sk_buff *skb_res = NULL;
start = master->slaves; start = master->slaves;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册