+ netpoll-rework-skb-transmit-queue.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     netpoll: rework skb transmit queue

has been added to the -mm tree.  Its filename is

     netpoll-rework-skb-transmit-queue.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: netpoll: rework skb transmit queue
From: Stephen Hemminger <shemminger@xxxxxxxx>

The original skb management for netpoll was a mess, it had two queue paths and
a callback.  This changes it to have a per-instance transmit queue and use a
tasklet rather than a work queue for the congested case.

Signed-off-by: Stephen Hemminger <shemminger@xxxxxxxx>
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/net/netconsole.c |    1 -
 include/linux/netpoll.h  |    3 ++-
 net/core/netpoll.c       |   14 ++++++++------
 3 files changed, 10 insertions(+), 8 deletions(-)

diff -puN drivers/net/netconsole.c~netpoll-rework-skb-transmit-queue drivers/net/netconsole.c
--- a/drivers/net/netconsole.c~netpoll-rework-skb-transmit-queue
+++ a/drivers/net/netconsole.c
@@ -60,7 +60,6 @@ static struct netpoll np = {
 	.local_port = 6665,
 	.remote_port = 6666,
 	.remote_mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
-	.drop = netpoll_queue,
 };
 static int configured = 0;
 
diff -puN include/linux/netpoll.h~netpoll-rework-skb-transmit-queue include/linux/netpoll.h
--- a/include/linux/netpoll.h~netpoll-rework-skb-transmit-queue
+++ a/include/linux/netpoll.h
@@ -27,11 +27,12 @@ struct netpoll {
 struct netpoll_info {
 	spinlock_t poll_lock;
 	int poll_owner;
-	int tries;
 	int rx_flags;
 	spinlock_t rx_lock;
 	struct netpoll *rx_np; /* netpoll that registered an rx_hook */
 	struct sk_buff_head arp_tx; /* list of arp requests to reply to */
+	struct sk_buff_head tx_q;
+	struct tasklet_struct tx_task;
 };
 
 void netpoll_poll(struct netpoll *np);
diff -puN net/core/netpoll.c~netpoll-rework-skb-transmit-queue net/core/netpoll.c
--- a/net/core/netpoll.c~netpoll-rework-skb-transmit-queue
+++ a/net/core/netpoll.c
@@ -40,10 +40,6 @@ static DEFINE_SPINLOCK(skb_list_lock);
 static int nr_skbs;
 static struct sk_buff *skbs;
 
-static DEFINE_SPINLOCK(queue_lock);
-static int queue_depth;
-static struct sk_buff *queue_head, *queue_tail;
-
 static atomic_t trapped;
 
 #define NETPOLL_RX_ENABLED  1
@@ -205,6 +201,7 @@ static void refill_skbs(void)
 
 static void zap_completion_queue(void)
 {
+	int once = 1, count = 0;
 	unsigned long flags;
 	struct softnet_data *sd = &get_cpu_var(softnet_data);
 
@@ -666,9 +663,10 @@ int netpoll_setup(struct netpoll *np)
 		npinfo->rx_np = NULL;
 		spin_lock_init(&npinfo->poll_lock);
 		npinfo->poll_owner = -1;
-		npinfo->tries = MAX_RETRIES;
 		spin_lock_init(&npinfo->rx_lock);
 		skb_queue_head_init(&npinfo->arp_tx);
+		skb_queue_head_init(&npinfo->tx_q);
+		tasklet_init(&npinfo->tx_task, netpoll_run, (unsigned long) ndev);
 	} else
 		npinfo = ndev->npinfo;
 
@@ -776,6 +774,11 @@ void netpoll_cleanup(struct netpoll *np)
 			npinfo->rx_np = NULL;
 			npinfo->rx_flags &= ~NETPOLL_RX_ENABLED;
 			spin_unlock_irqrestore(&npinfo->rx_lock, flags);
+
+			skb_queue_purge(&npinfo->arp_tx);
+			skb_queue_purge(&npinfo->tx_q);
+
+			tasklet_kill(&npinfo->tx_task);
 		}
 		dev_put(np->dev);
 	}
@@ -803,4 +806,3 @@ EXPORT_SYMBOL(netpoll_setup);
 EXPORT_SYMBOL(netpoll_cleanup);
 EXPORT_SYMBOL(netpoll_send_udp);
 EXPORT_SYMBOL(netpoll_poll);
-EXPORT_SYMBOL(netpoll_queue);
_

Patches currently in -mm which might be from shemminger@xxxxxxxx are

origin.patch
git-netdev-all.patch
bonding-lockdep-annotation.patch
netpoll-retry-memory-leak.patch
netpoll-initialize-skb-for-udp.patch
netpoll-rework-skb-transmit-queue.patch
netpoll-use-skb_buff_head-for-skb-cache.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux