Skip to content

Commit e15c3c2

Browse files
Amerigo Wangdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4e3828c commit e15c3c2

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb,
398398
sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping));
399399
skb->queue_mapping = qdisc_skb_cb(skb)->slave_dev_queue_mapping;
400400

401-
if (unlikely(netpoll_tx_running(slave_dev)))
401+
if (unlikely(netpoll_tx_running(bond->dev)))
402402
bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb);
403403
else
404404
dev_queue_xmit(skb);

include/linux/if_team.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,6 @@ static inline void team_netpoll_send_skb(struct team_port *port,
9696
}
9797
#endif
9898

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-
11499
struct team_mode_ops {
115100
int (*init)(struct team *team);
116101
void (*exit)(struct team *team);
@@ -200,6 +185,21 @@ struct team {
200185
long mode_priv[TEAM_MODE_PRIV_LONGS];
201186
};
202187

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+
203203
static inline struct hlist_head *team_port_index_hash(struct team *team,
204204
int port_index)
205205
{

net/bridge/br_forward.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void __br_deliver(const struct net_bridge_port *to, struct sk_buff *skb)
6565
{
6666
skb->dev = to->dev;
6767

68-
if (unlikely(netpoll_tx_running(to->dev))) {
68+
if (unlikely(netpoll_tx_running(to->br->dev))) {
6969
if (packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb))
7070
kfree_skb(skb);
7171
else {

0 commit comments

Comments
 (0)