aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/core/netpoll.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index cf6acd3084a4..9e3aea0bd369 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -40,7 +40,6 @@ static atomic_t trapped;
40 40
41#define USEC_PER_POLL 50 41#define USEC_PER_POLL 50
42#define NETPOLL_RX_ENABLED 1 42#define NETPOLL_RX_ENABLED 1
43#define NETPOLL_RX_DROP 2
44 43
45#define MAX_SKB_SIZE \ 44#define MAX_SKB_SIZE \
46 (MAX_UDP_CHUNK + sizeof(struct udphdr) + \ 45 (MAX_UDP_CHUNK + sizeof(struct udphdr) + \
@@ -128,13 +127,11 @@ static int poll_one_napi(struct netpoll_info *npinfo,
128 if (!test_bit(NAPI_STATE_SCHED, &napi->state)) 127 if (!test_bit(NAPI_STATE_SCHED, &napi->state))
129 return budget; 128 return budget;
130 129
131 npinfo->rx_flags |= NETPOLL_RX_DROP;
132 atomic_inc(&trapped); 130 atomic_inc(&trapped);
133 131
134 work = napi->poll(napi, budget); 132 work = napi->poll(napi, budget);
135 133
136 atomic_dec(&trapped); 134 atomic_dec(&trapped);
137 npinfo->rx_flags &= ~NETPOLL_RX_DROP;
138 135
139 return budget - work; 136 return budget - work;
140} 137}
@@ -475,7 +472,7 @@ int __netpoll_rx(struct sk_buff *skb)
475 if (skb->dev->type != ARPHRD_ETHER) 472 if (skb->dev->type != ARPHRD_ETHER)
476 goto out; 473 goto out;
477 474
478 /* check if netpoll clients need ARP */ 475 /* if receive ARP during middle of NAPI poll, then queue */
479 if (skb->protocol == htons(ETH_P_ARP) && 476 if (skb->protocol == htons(ETH_P_ARP) &&
480 atomic_read(&trapped)) { 477 atomic_read(&trapped)) {
481 skb_queue_tail(&npi->arp_tx, skb); 478 skb_queue_tail(&npi->arp_tx, skb);
@@ -537,6 +534,9 @@ int __netpoll_rx(struct sk_buff *skb)
537 return 1; 534 return 1;
538 535
539out: 536out:
537 /* If packet received while already in poll then just
538 * silently drop.
539 */
540 if (atomic_read(&trapped)) { 540 if (atomic_read(&trapped)) {
541 kfree_skb(skb); 541 kfree_skb(skb);
542 return 1; 542 return 1;