From 3839fa67890ef1ecd398bbb97708c666d6c35790 Mon Sep 17 00:00:00 2001 From: wangdi Date: Thu, 9 Oct 2003 15:06:46 +0000 Subject: [PATCH] update dump_netdev --- .../patches/dump_netdev_over_netpoll.patch | 63 +++++++++++----------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/lustre/kernel_patches/patches/dump_netdev_over_netpoll.patch b/lustre/kernel_patches/patches/dump_netdev_over_netpoll.patch index 453e086..b93e2f9 100644 --- a/lustre/kernel_patches/patches/dump_netdev_over_netpoll.patch +++ b/lustre/kernel_patches/patches/dump_netdev_over_netpoll.patch @@ -1,7 +1,7 @@ -Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c +Index: linux-2.6.0-test6/drivers/dump/dump_netdev.c =================================================================== ---- linux-2.6.0-test5.orig/drivers/dump/dump_netdev.c 2003-09-27 21:53:32.000000000 +0800 -+++ linux-2.6.0-test5/drivers/dump/dump_netdev.c 2003-09-30 22:26:22.709337152 +0800 +--- linux-2.6.0-test6.orig/drivers/dump/dump_netdev.c 2003-10-07 16:08:57.000000000 +0800 ++++ linux-2.6.0-test6/drivers/dump/dump_netdev.c 2003-10-09 17:36:18.000000000 +0800 @@ -14,6 +14,7 @@ * * Copyright (C) 2001 Ingo Molnar @@ -43,7 +43,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c static u64 dump_magic; #define MAX_UDP_CHUNK 1460 -@@ -64,300 +55,26 @@ +@@ -64,300 +55,28 @@ #define MAX_SKB_SIZE \ (MAX_UDP_CHUNK + sizeof(struct udphdr) + \ sizeof(struct iphdr) + sizeof(struct ethhdr)) @@ -283,16 +283,17 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c - struct udphdr *uh; - __u32 len, saddr, daddr, ulen; req_t *__req; -+ -+ __req = (req_t *)msg; - +- - /* - * First check if were are dumping or doing startup handshake, if - * not quickly return. - */ -- if (!netdump_in_progress) ++ + if (!netdump_in_progress) - return NET_RX_SUCCESS; -- ++ goto out; ++ __req = (req_t *)msg; + - if (skb->dev->type != ARPHRD_ETHER) - goto out; - @@ -358,7 +359,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c if ((ntohl(__req->command) != COMM_GET_MAGIC) && (ntohl(__req->command) != COMM_HELLO) && (ntohl(__req->command) != COMM_START_WRITE_NETDUMP_ACK) && -@@ -372,11 +89,27 @@ +@@ -372,11 +91,27 @@ req.nr = ntohl(__req->nr); new_req = 1; out: @@ -388,7 +389,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c { int i; -@@ -392,7 +125,7 @@ +@@ -392,7 +127,7 @@ unsigned int offset = i*1024; reply.code = REPLY_MEM; reply.info = offset; @@ -397,7 +398,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c } } static void dump_do_sysrq(int key) -@@ -400,9 +133,16 @@ +@@ -400,9 +135,16 @@ struct pt_regs regs; get_current_regs(®s); @@ -415,7 +416,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c /* * This function waits for the client to acknowledge the receipt * of the netdump startup reply, with the possibility of packets -@@ -433,24 +173,27 @@ +@@ -433,24 +175,27 @@ /* send 300 handshake packets before declaring failure */ for (i = 0; i < 300; i++) { @@ -449,7 +450,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c /* * check if the new request is of the expected type, * if so, return, else try sending the handshaking -@@ -504,10 +247,12 @@ +@@ -504,10 +249,12 @@ repeatCounter = 0; total_loop = 0; while (1) { @@ -465,7 +466,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c if (!new_req) { repeatCounter++; -@@ -532,13 +277,15 @@ +@@ -532,13 +279,15 @@ repeatCounter = 0; counter = 0; total_loop = 0; @@ -482,7 +483,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c break; case COMM_EXIT: -@@ -549,10 +296,11 @@ +@@ -549,10 +298,11 @@ case COMM_HELLO: sprintf(tmp, "Hello, this is netdump version " "0.%02d\n", NETCONSOLE_VERSION); @@ -495,7 +496,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c break; case COMM_GET_PAGE_SIZE: -@@ -560,7 +308,7 @@ +@@ -560,7 +310,7 @@ reply.code = REPLY_PAGE_SIZE; reply.nr = req.nr; reply.info = PAGE_SIZE; @@ -504,7 +505,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c break; case COMM_GET_NR_PAGES: -@@ -569,15 +317,14 @@ +@@ -569,15 +319,14 @@ reply.info = num_physpages; reply.info = page_counter; sprintf(tmp, "Number of pages: %ld\n", num_physpages); @@ -522,7 +523,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c break; case COMM_SYSRQ: dump_do_sysrq(req.from); -@@ -585,7 +332,7 @@ +@@ -585,7 +334,7 @@ reply.nr = req.nr; reply.info = req.from; sprintf(tmp, "SYSRQ command %d \n", req.from); @@ -531,7 +532,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c break; default: reply.code = REPLY_ERROR; -@@ -593,7 +340,7 @@ +@@ -593,7 +342,7 @@ reply.info = req.command; sprintf(tmp, "Got unknown command code %d!\n", req.command); @@ -540,7 +541,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c break; } } -@@ -605,45 +352,45 @@ +@@ -605,45 +354,45 @@ static int dump_validate_config(void) { @@ -601,7 +602,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c printk("(Broadcast)"); printk("\n"); return 0; -@@ -659,31 +406,24 @@ +@@ -659,31 +408,24 @@ dump_net_open(struct dump_dev *net_dev, unsigned long arg) { int retval = 0; @@ -638,7 +639,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c if ((retval = dump_validate_config()) < 0) goto err2; -@@ -694,7 +434,7 @@ +@@ -694,7 +436,7 @@ err2: in_dev_put(dump_in_dev); err1: @@ -647,7 +648,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c return retval; } -@@ -707,8 +447,8 @@ +@@ -707,8 +449,8 @@ { if (dump_in_dev) in_dev_put(dump_in_dev); @@ -658,7 +659,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c return 0; } -@@ -720,7 +460,6 @@ +@@ -720,7 +462,6 @@ dump_net_silence(struct dump_dev *net_dev) { local_irq_save(flags_global); @@ -666,7 +667,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c startup_handshake = 1; net_dev->curr_offset = 0; printk("Dumping to network device %s on CPU %d ...\n", device_name, -@@ -740,7 +479,7 @@ +@@ -740,7 +481,7 @@ reply_t reply; char tmp[200]; @@ -675,7 +676,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c return (0); sprintf(tmp, "NETDUMP end.\n"); -@@ -748,11 +487,10 @@ +@@ -748,11 +489,10 @@ reply.code = REPLY_END_NETDUMP; reply.nr = 0; reply.info = 0; @@ -688,7 +689,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c startup_handshake = 0; return 0; } -@@ -809,18 +547,19 @@ +@@ -809,18 +549,19 @@ static int dump_net_ioctl(struct dump_dev *net_dev, unsigned int cmd, unsigned long arg) { @@ -712,7 +713,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c break; case DIOGTARGETIP: case DIOGTARGETPORT: -@@ -830,6 +569,7 @@ +@@ -830,6 +571,7 @@ default: return -EINVAL; } @@ -720,7 +721,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c return 0; } -@@ -851,17 +591,28 @@ +@@ -851,17 +593,28 @@ .curr_offset = 0 }; @@ -750,7 +751,7 @@ Index: linux-2.6.0-test5/drivers/dump/dump_netdev.c get_random_bytes(&dump_magic, sizeof(dump_magic)); return 0; } -@@ -870,6 +621,7 @@ +@@ -870,6 +623,7 @@ dump_netdev_cleanup(void) { dump_unregister_device(&default_dump_netdev); -- 1.8.3.1