From: Stephen Hemminger <shemminger@linux-foundation.org>
To: David Miller <davem@davemloft.net>, Satyam Sharma <satyam@infradead.org>
Cc: netdev@vger.kernel.org
Subject: [PATCH 04/11] netpoll: alternative implementation of dropping
Date: Sat, 03 Nov 2007 11:43:18 -0700 [thread overview]
Message-ID: <20071103184338.637309632@linux-foundation.org> (raw)
In-Reply-To: 20071103184314.216145305@linux-foundation.org
[-- Attachment #1: netpoll-drop-flag.patch --]
[-- Type: text/plain, Size: 1330 bytes --]
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/net/core/netpoll.c 2007-11-03 09:19:34.000000000 -0700
+++ b/net/core/netpoll.c 2007-11-03 09:33:31.000000000 -0700
@@ -40,7 +40,6 @@ static atomic_t trapped;
#define USEC_PER_POLL 50
#define NETPOLL_RX_ENABLED 1
-#define NETPOLL_RX_DROP 2
#define MAX_SKB_SIZE \
(MAX_UDP_CHUNK + sizeof(struct udphdr) + \
@@ -128,13 +127,11 @@ static int poll_one_napi(struct netpoll_
if (!test_bit(NAPI_STATE_SCHED, &napi->state))
return budget;
- npinfo->rx_flags |= NETPOLL_RX_DROP;
atomic_inc(&trapped);
work = napi->poll(napi, budget);
atomic_dec(&trapped);
- npinfo->rx_flags &= ~NETPOLL_RX_DROP;
return budget - work;
}
@@ -475,7 +472,7 @@ int __netpoll_rx(struct sk_buff *skb)
if (skb->dev->type != ARPHRD_ETHER)
goto out;
- /* check if netpoll clients need ARP */
+ /* if receive ARP during middle of NAPI poll, then queue */
if (skb->protocol == htons(ETH_P_ARP) &&
atomic_read(&trapped)) {
skb_queue_tail(&npi->arp_tx, skb);
@@ -537,6 +534,9 @@ int __netpoll_rx(struct sk_buff *skb)
return 1;
out:
+ /* If packet received while already in poll then just
+ * silently drop.
+ */
if (atomic_read(&trapped)) {
kfree_skb(skb);
return 1;
--
Stephen Hemminger <shemminger@linux-foundation.org>
next prev parent reply other threads:[~2007-11-03 23:36 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-03 18:43 [PATCH 00/11] netpoll cleanups Stephen Hemminger
2007-11-03 18:43 ` [PATCH 01/11] netpoll: use skb_queue_purge Stephen Hemminger
2007-11-20 3:15 ` David Miller
2007-11-03 18:43 ` [PATCH 02/11] netpoll: netpoll_poll cleanup Stephen Hemminger
2007-11-20 3:21 ` David Miller
2007-11-03 18:43 ` [PATCH 03/11] netpoll: no need to store local_mac Stephen Hemminger
2007-11-20 3:23 ` David Miller
2007-11-03 18:43 ` Stephen Hemminger [this message]
2007-11-20 3:25 ` [PATCH 04/11] netpoll: alternative implementation of dropping David Miller
2007-11-03 18:43 ` [PATCH 05/11] netpoll: dont need rx_flags Stephen Hemminger
2007-11-20 3:39 ` David Miller
2007-11-03 18:43 ` [PATCH 06/11] netpoll: remove dev_name for npinfo Stephen Hemminger
2007-11-20 3:47 ` David Miller
2007-11-20 4:07 ` Stephen Hemminger
2007-11-03 18:43 ` [PATCH 07/11] netpoll: get rid of name parameter Stephen Hemminger
2007-11-20 3:49 ` David Miller
2007-11-03 18:43 ` [PATCH 08/11] netpoll: NETPOLL_TRAP configuration change Stephen Hemminger
2007-11-20 3:52 ` David Miller
2007-11-03 18:43 ` [PATCH 09/11] netpoll: ethernet devices only Stephen Hemminger
2007-11-20 3:55 ` David Miller
2007-11-20 4:14 ` Stephen Hemminger
2007-11-03 18:43 ` [PATCH 10/11] netpoll: rx optimization Stephen Hemminger
2007-11-20 4:00 ` David Miller
2007-11-03 18:43 ` [PATCH 11/11] netpoll: rx use RCU Stephen Hemminger
2007-11-20 4:00 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071103184338.637309632@linux-foundation.org \
--to=shemminger@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=satyam@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).