diff options
author | Amerigo Wang <amwang@redhat.com> | 2012-08-09 21:24:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-14 17:33:32 -0400 |
commit | e15c3c2294605f09f9b336b2f3b97086ab4b8145 (patch) | |
tree | 913bd57b5fa899687c779530d0576a3ca8100732 /include | |
parent | 4e3828c4bfd90b00a951cad7c8da27d1966beefe (diff) |
netpoll: check netpoll tx status on the right device
Although this doesn't matter actually, because netpoll_tx_running()
doesn't use the parameter, the code will be more readable.
For team_dev_queue_xmit() we have to move it down to avoid
compile errors.
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/if_team.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index 6960fc1841a7..aa2e167e1ef4 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
@@ -96,21 +96,6 @@ static inline void team_netpoll_send_skb(struct team_port *port, | |||
96 | } | 96 | } |
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | static inline int team_dev_queue_xmit(struct team *team, struct team_port *port, | ||
100 | struct sk_buff *skb) | ||
101 | { | ||
102 | BUILD_BUG_ON(sizeof(skb->queue_mapping) != | ||
103 | sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping)); | ||
104 | skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping); | ||
105 | |||
106 | skb->dev = port->dev; | ||
107 | if (unlikely(netpoll_tx_running(port->dev))) { | ||
108 | team_netpoll_send_skb(port, skb); | ||
109 | return 0; | ||
110 | } | ||
111 | return dev_queue_xmit(skb); | ||
112 | } | ||
113 | |||
114 | struct team_mode_ops { | 99 | struct team_mode_ops { |
115 | int (*init)(struct team *team); | 100 | int (*init)(struct team *team); |
116 | void (*exit)(struct team *team); | 101 | void (*exit)(struct team *team); |
@@ -200,6 +185,21 @@ struct team { | |||
200 | long mode_priv[TEAM_MODE_PRIV_LONGS]; | 185 | long mode_priv[TEAM_MODE_PRIV_LONGS]; |
201 | }; | 186 | }; |
202 | 187 | ||
188 | static inline int team_dev_queue_xmit(struct team *team, struct team_port *port, | ||
189 | struct sk_buff *skb) | ||
190 | { | ||
191 | BUILD_BUG_ON(sizeof(skb->queue_mapping) != | ||
192 | sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping)); | ||
193 | skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping); | ||
194 | |||
195 | skb->dev = port->dev; | ||
196 | if (unlikely(netpoll_tx_running(team->dev))) { | ||
197 | team_netpoll_send_skb(port, skb); | ||
198 | return 0; | ||
199 | } | ||
200 | return dev_queue_xmit(skb); | ||
201 | } | ||
202 | |||
203 | static inline struct hlist_head *team_port_index_hash(struct team *team, | 203 | static inline struct hlist_head *team_port_index_hash(struct team *team, |
204 | int port_index) | 204 | int port_index) |
205 | { | 205 | { |