Skip to content

Commit 5de4a47

Browse files
Stephen HemmingerDavid S. Miller
authored andcommitted
netpoll queue cleanup
The beast had a long and not very happy history. At one point, a friend (netdump) had asked that he open up a little. Well, the friend was long gone now, and the beast had this dangling piece hanging (netpoll_queue). It wasn't hard to stitch the netpoll_queue back in where it belonged and make everything tidy. Signed-off-by: Stephen Hemminger <[email protected]>
1 parent 2bdfe0b commit 5de4a47

File tree

3 files changed

+5
-23
lines changed

3 files changed

+5
-23
lines changed

drivers/net/netconsole.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ static struct netpoll np = {
6060
.local_port = 6665,
6161
.remote_port = 6666,
6262
.remote_mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
63-
.drop = netpoll_queue,
6463
};
6564
static int configured = 0;
6665

include/linux/netpoll.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct netpoll {
1818
struct net_device *dev;
1919
char dev_name[16], *name;
2020
void (*rx_hook)(struct netpoll *, int, char *, int);
21-
void (*drop)(struct sk_buff *skb);
21+
2222
u32 local_ip, remote_ip;
2323
u16 local_port, remote_port;
2424
unsigned char local_mac[6], remote_mac[6];
@@ -44,7 +44,7 @@ int netpoll_trap(void);
4444
void netpoll_set_trap(int trap);
4545
void netpoll_cleanup(struct netpoll *np);
4646
int __netpoll_rx(struct sk_buff *skb);
47-
void netpoll_queue(struct sk_buff *skb);
47+
4848

4949
#ifdef CONFIG_NETPOLL
5050
static inline int netpoll_rx(struct sk_buff *skb)

net/core/netpoll.c

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,6 @@ static void queue_process(void *p)
7777
}
7878
}
7979

80-
void netpoll_queue(struct sk_buff *skb)
81-
{
82-
struct net_device *dev = skb->dev;
83-
struct netpoll_info *npinfo = dev->npinfo;
84-
85-
if (!npinfo)
86-
kfree_skb(skb);
87-
else {
88-
skb_queue_tail(&npinfo->txq, skb);
89-
schedule_work(&npinfo->tx_work);
90-
}
91-
}
92-
9380
static int checksum_udp(struct sk_buff *skb, struct udphdr *uh,
9481
unsigned short ulen, u32 saddr, u32 daddr)
9582
{
@@ -256,7 +243,7 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
256243
}
257244

258245
/* don't get messages out of order, and no recursion */
259-
if ( !(np->drop == netpoll_queue && skb_queue_len(&npinfo->txq))
246+
if ( skb_queue_len(&npinfo->txq) == 0
260247
&& npinfo->poll_owner != smp_processor_id()
261248
&& netif_tx_trylock(dev)) {
262249

@@ -277,11 +264,8 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
277264
}
278265

279266
if (status != NETDEV_TX_OK) {
280-
/* requeue for later */
281-
if (np->drop)
282-
np->drop(skb);
283-
else
284-
__kfree_skb(skb);
267+
skb_queue_tail(&npinfo->txq, skb);
268+
schedule_work(&npinfo->tx_work);
285269
}
286270
}
287271

@@ -809,4 +793,3 @@ EXPORT_SYMBOL(netpoll_setup);
809793
EXPORT_SYMBOL(netpoll_cleanup);
810794
EXPORT_SYMBOL(netpoll_send_udp);
811795
EXPORT_SYMBOL(netpoll_poll);
812-
EXPORT_SYMBOL(netpoll_queue);

0 commit comments

Comments
 (0)