Netdev List
 help / color / mirror / Atom feed
* [PATCH 2.6.12-rc5 6/9] tg3: Add memory test
From: Michael Chan @ 2005-05-26 17:58 UTC (permalink / raw)
  To: davem; +Cc: jgarzik, netdev
In-Reply-To: <1117128795.3744.22.camel@rh4>

[-- Attachment #1: Type: text/plain, Size: 49 bytes --]

Signed-off-by: Michael Chan <mchan@broadcom.com>

[-- Attachment #2: tg3-d6.patch --]
[-- Type: text/x-patch, Size: 1865 bytes --]

diff -Nru d5/drivers/net/tg3.c d6/drivers/net/tg3.c
--- d5/drivers/net/tg3.c	2005-05-25 12:59:24.000000000 -0700
+++ d6/drivers/net/tg3.c	2005-05-25 12:59:31.000000000 -0700
@@ -7520,6 +7520,62 @@
 	return -EIO;
 }
 
+static int tg3_do_mem_test(struct tg3 *tp, u32 offset, u32 len)
+{
+	static u32 test_pattern[] = { 0x00000000, 0xffffffff, 0xaa55a55a };
+	int i;
+	u32 j;
+
+	for (i = 0; i < sizeof(test_pattern)/sizeof(u32); i++) {
+		for (j = 0; j < len; j += 4) {
+			u32 val;
+
+			tg3_write_mem(tp, offset + j, test_pattern[i]);
+			tg3_read_mem(tp, offset + j, &val);
+			if (val != test_pattern[i])
+				return -EIO;
+		}
+	}
+	return 0;
+}
+
+static int tg3_test_memory(struct tg3 *tp)
+{
+	static struct mem_entry {
+		u32 offset;
+		u32 len;
+	} mem_tbl_570x[] = {
+		{ 0x00000000, 0x01000},
+		{ 0x00002000, 0x1c000},
+		{ 0xffffffff, 0x00000}
+	}, mem_tbl_5705[] = {
+		{ 0x00000100, 0x0000c},
+		{ 0x00000200, 0x00008},
+		{ 0x00000b50, 0x00400},
+		{ 0x00004000, 0x00800},
+		{ 0x00006000, 0x01000},
+		{ 0x00008000, 0x02000},
+		{ 0x00010000, 0x0e000},
+		{ 0xffffffff, 0x00000}
+	};
+	struct mem_entry *mem_tbl;
+	int err = 0;
+	int i;
+
+	if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)
+		mem_tbl = mem_tbl_5705;
+	else
+		mem_tbl = mem_tbl_570x;
+
+	for (i = 0; mem_tbl[i].offset != 0xffffffff; i++) {
+		if ((err = tg3_do_mem_test(tp, mem_tbl[i].offset,
+		    mem_tbl[i].len)) != 0)
+			break;
+	}
+	
+	return err;
+}
+
 static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
 			  u64 *data)
 {
@@ -7553,6 +7609,10 @@
 			etest->flags |= ETH_TEST_FL_FAILED;
 			data[2] = 1;
 		}
+		if (tg3_test_memory(tp) != 0) {
+			etest->flags |= ETH_TEST_FL_FAILED;
+			data[3] = 1;
+		}
 
 		tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
 		if (netif_running(dev)) {

^ permalink raw reply

* [PATCH 2.6.12-rc5 5/9] tg3: Add register test
From: Michael Chan @ 2005-05-26 17:58 UTC (permalink / raw)
  To: davem; +Cc: jgarzik, netdev
In-Reply-To: <1117128795.3744.22.camel@rh4>

[-- Attachment #1: Type: text/plain, Size: 49 bytes --]

Signed-off-by: Michael Chan <mchan@broadcom.com>

[-- Attachment #2: tg3-d5.patch --]
[-- Type: text/x-patch, Size: 7840 bytes --]

diff -Nru d4/drivers/net/tg3.c d5/drivers/net/tg3.c
--- d4/drivers/net/tg3.c	2005-05-25 12:59:17.000000000 -0700
+++ d5/drivers/net/tg3.c	2005-05-25 12:59:24.000000000 -0700
@@ -7307,6 +7307,219 @@
 	return -EIO;
 }
 
+/* Only test the commonly used registers */
+static int tg3_test_registers(struct tg3 *tp)
+{
+	int i, is_5705;
+	u32 offset, read_mask, write_mask, val, save_val, read_val;
+	static struct {
+		u16 offset;
+		u16 flags;
+#define TG3_FL_5705	0x1
+#define TG3_FL_NOT_5705	0x2
+#define TG3_FL_NOT_5788	0x4
+		u32 read_mask;
+		u32 write_mask;
+	} reg_tbl[] = {
+		/* MAC Control Registers */
+		{ MAC_MODE, TG3_FL_NOT_5705,
+			0x00000000, 0x00ef6f8c },
+		{ MAC_MODE, TG3_FL_5705,
+			0x00000000, 0x01ef6b8c },
+		{ MAC_STATUS, TG3_FL_NOT_5705,
+			0x03800107, 0x00000000 },
+		{ MAC_STATUS, TG3_FL_5705,
+			0x03800100, 0x00000000 },
+		{ MAC_ADDR_0_HIGH, 0x0000,
+			0x00000000, 0x0000ffff },
+		{ MAC_ADDR_0_LOW, 0x0000,
+		       	0x00000000, 0xffffffff },
+		{ MAC_RX_MTU_SIZE, 0x0000,
+			0x00000000, 0x0000ffff },
+		{ MAC_TX_MODE, 0x0000,
+			0x00000000, 0x00000070 },
+		{ MAC_TX_LENGTHS, 0x0000,
+			0x00000000, 0x00003fff },
+		{ MAC_RX_MODE, TG3_FL_NOT_5705,
+			0x00000000, 0x000007fc },
+		{ MAC_RX_MODE, TG3_FL_5705,
+			0x00000000, 0x000007dc },
+		{ MAC_HASH_REG_0, 0x0000,
+			0x00000000, 0xffffffff },
+		{ MAC_HASH_REG_1, 0x0000,
+			0x00000000, 0xffffffff },
+		{ MAC_HASH_REG_2, 0x0000,
+			0x00000000, 0xffffffff },
+		{ MAC_HASH_REG_3, 0x0000,
+			0x00000000, 0xffffffff },
+
+		/* Receive Data and Receive BD Initiator Control Registers. */
+		{ RCVDBDI_JUMBO_BD+0, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ RCVDBDI_JUMBO_BD+4, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ RCVDBDI_JUMBO_BD+8, TG3_FL_NOT_5705,
+			0x00000000, 0x00000003 },
+		{ RCVDBDI_JUMBO_BD+0xc, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ RCVDBDI_STD_BD+0, 0x0000,
+			0x00000000, 0xffffffff },
+		{ RCVDBDI_STD_BD+4, 0x0000,
+			0x00000000, 0xffffffff },
+		{ RCVDBDI_STD_BD+8, 0x0000,
+			0x00000000, 0xffff0002 },
+		{ RCVDBDI_STD_BD+0xc, 0x0000,
+			0x00000000, 0xffffffff },
+	
+		/* Receive BD Initiator Control Registers. */
+		{ RCVBDI_STD_THRESH, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ RCVBDI_STD_THRESH, TG3_FL_5705,
+			0x00000000, 0x000003ff },
+		{ RCVBDI_JUMBO_THRESH, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+	
+		/* Host Coalescing Control Registers. */
+		{ HOSTCC_MODE, TG3_FL_NOT_5705,
+			0x00000000, 0x00000004 },
+		{ HOSTCC_MODE, TG3_FL_5705,
+			0x00000000, 0x000000f6 },
+		{ HOSTCC_RXCOL_TICKS, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_RXCOL_TICKS, TG3_FL_5705,
+			0x00000000, 0x000003ff },
+		{ HOSTCC_TXCOL_TICKS, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_TXCOL_TICKS, TG3_FL_5705,
+			0x00000000, 0x000003ff },
+		{ HOSTCC_RXMAX_FRAMES, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_RXMAX_FRAMES, TG3_FL_5705 | TG3_FL_NOT_5788,
+			0x00000000, 0x000000ff },
+		{ HOSTCC_TXMAX_FRAMES, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_TXMAX_FRAMES, TG3_FL_5705 | TG3_FL_NOT_5788,
+			0x00000000, 0x000000ff },
+		{ HOSTCC_RXCOAL_TICK_INT, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_TXCOAL_TICK_INT, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_RXCOAL_MAXF_INT, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_RXCOAL_MAXF_INT, TG3_FL_5705 | TG3_FL_NOT_5788,
+			0x00000000, 0x000000ff },
+		{ HOSTCC_TXCOAL_MAXF_INT, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_TXCOAL_MAXF_INT, TG3_FL_5705 | TG3_FL_NOT_5788,
+			0x00000000, 0x000000ff },
+		{ HOSTCC_STAT_COAL_TICKS, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_STATS_BLK_HOST_ADDR, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_STATS_BLK_HOST_ADDR+4, TG3_FL_NOT_5705,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_STATUS_BLK_HOST_ADDR, 0x0000,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_STATUS_BLK_HOST_ADDR+4, 0x0000,
+			0x00000000, 0xffffffff },
+		{ HOSTCC_STATS_BLK_NIC_ADDR, 0x0000,
+			0xffffffff, 0x00000000 },
+		{ HOSTCC_STATUS_BLK_NIC_ADDR, 0x0000,
+			0xffffffff, 0x00000000 },
+
+		/* Buffer Manager Control Registers. */
+		{ BUFMGR_MB_POOL_ADDR, 0x0000,
+			0x00000000, 0x007fff80 },
+		{ BUFMGR_MB_POOL_SIZE, 0x0000,
+			0x00000000, 0x007fffff },
+		{ BUFMGR_MB_RDMA_LOW_WATER, 0x0000,
+			0x00000000, 0x0000003f },
+		{ BUFMGR_MB_MACRX_LOW_WATER, 0x0000,
+			0x00000000, 0x000001ff },
+		{ BUFMGR_MB_HIGH_WATER, 0x0000,
+			0x00000000, 0x000001ff },
+		{ BUFMGR_DMA_DESC_POOL_ADDR, TG3_FL_NOT_5705,
+			0xffffffff, 0x00000000 },
+		{ BUFMGR_DMA_DESC_POOL_SIZE, TG3_FL_NOT_5705,
+			0xffffffff, 0x00000000 },
+	
+		/* Mailbox Registers */
+		{ GRCMBOX_RCVSTD_PROD_IDX+4, 0x0000,
+			0x00000000, 0x000001ff },
+		{ GRCMBOX_RCVJUMBO_PROD_IDX+4, TG3_FL_NOT_5705,
+			0x00000000, 0x000001ff },
+		{ GRCMBOX_RCVRET_CON_IDX_0+4, 0x0000,
+			0x00000000, 0x000007ff },
+		{ GRCMBOX_SNDHOST_PROD_IDX_0+4, 0x0000,
+			0x00000000, 0x000001ff },
+
+		{ 0xffff, 0x0000, 0x00000000, 0x00000000 },
+	};
+
+	if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)
+		is_5705 = 1;
+	else
+		is_5705 = 0;
+
+	for (i = 0; reg_tbl[i].offset != 0xffff; i++) {
+		if (is_5705 && (reg_tbl[i].flags & TG3_FL_NOT_5705))
+			continue;
+
+		if (!is_5705 && (reg_tbl[i].flags & TG3_FL_5705))
+			continue;
+
+		if ((tp->tg3_flags2 & TG3_FLG2_IS_5788) &&
+		    (reg_tbl[i].flags & TG3_FL_NOT_5788))
+			continue;
+
+		offset = (u32) reg_tbl[i].offset;
+		read_mask = reg_tbl[i].read_mask;
+		write_mask = reg_tbl[i].write_mask;
+
+		/* Save the original register content */
+		save_val = tr32(offset);
+
+		/* Determine the read-only value. */
+		read_val = save_val & read_mask;
+
+		/* Write zero to the register, then make sure the read-only bits
+		 * are not changed and the read/write bits are all zeros.
+		 */
+		tw32(offset, 0);
+
+		val = tr32(offset);
+
+		/* Test the read-only and read/write bits. */
+		if (((val & read_mask) != read_val) || (val & write_mask))
+			goto out;
+
+		/* Write ones to all the bits defined by RdMask and WrMask, then
+		 * make sure the read-only bits are not changed and the
+		 * read/write bits are all ones.
+		 */
+		tw32(offset, read_mask | write_mask);
+
+		val = tr32(offset);
+
+		/* Test the read-only bits. */
+		if ((val & read_mask) != read_val)
+			goto out;
+
+		/* Test the read/write bits. */
+		if ((val & write_mask) != write_mask)
+			goto out;
+
+		tw32(offset, save_val);
+	}
+
+	return 0;
+
+out:
+	printk(KERN_ERR PFX "Register test failed at offset %x\n", offset);
+	tw32(offset, save_val);
+	return -EIO;
+}
+
 static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
 			  u64 *data)
 {
@@ -7322,6 +7535,34 @@
 		etest->flags |= ETH_TEST_FL_FAILED;
 		data[1] = 1;
 	}
+	if (etest->flags & ETH_TEST_FL_OFFLINE) {
+		if (netif_running(dev))
+			tg3_netif_stop(tp);
+
+		spin_lock_irq(&tp->lock);
+		spin_lock(&tp->tx_lock);
+
+		tg3_halt(tp, RESET_KIND_SUSPEND, 1);
+		tg3_nvram_lock(tp);
+		tg3_halt_cpu(tp, RX_CPU_BASE);
+		if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+			tg3_halt_cpu(tp, TX_CPU_BASE);
+		tg3_nvram_unlock(tp);
+
+		if (tg3_test_registers(tp) != 0) {
+			etest->flags |= ETH_TEST_FL_FAILED;
+			data[2] = 1;
+		}
+
+		tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
+		if (netif_running(dev)) {
+			tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
+			tg3_init_hw(tp);
+			tg3_netif_start(tp);
+		}
+		spin_unlock(&tp->tx_lock);
+		spin_unlock_irq(&tp->lock);
+	}
 }
 
 static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)

^ permalink raw reply

* [PATCH 2.6.12-rc5 4/9] tg3: Add parameter to tg3_halt
From: Michael Chan @ 2005-05-26 17:58 UTC (permalink / raw)
  To: davem; +Cc: jgarzik, netdev
In-Reply-To: <1117128795.3744.22.camel@rh4>

[-- Attachment #1: Type: text/plain, Size: 263 bytes --]

Add a reset kind parameter to tg3_halt() so that the RESET_KIND_SUSPEND
parameter can be passed to tg3_halt() before doing offline tests.

All other calls to tg3_halt() will use the RESET_KIND_SHUTDOWN
parameter.

Signed-off-by: Michael Chan <mchan@broadcom.com>

[-- Attachment #2: tg3-d4.patch --]
[-- Type: text/x-patch, Size: 3136 bytes --]

diff -Nru d3/drivers/net/tg3.c d4/drivers/net/tg3.c
--- d3/drivers/net/tg3.c	2005-05-25 12:59:09.000000000 -0700
+++ d4/drivers/net/tg3.c	2005-05-25 12:59:17.000000000 -0700
@@ -3083,7 +3083,7 @@
 }
 
 static int tg3_init_hw(struct tg3 *);
-static int tg3_halt(struct tg3 *, int);
+static int tg3_halt(struct tg3 *, int, int);
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
 static void tg3_poll_controller(struct net_device *dev)
@@ -3107,7 +3107,7 @@
 	restart_timer = tp->tg3_flags2 & TG3_FLG2_RESTART_TIMER;
 	tp->tg3_flags2 &= ~TG3_FLG2_RESTART_TIMER;
 
-	tg3_halt(tp, 0);
+	tg3_halt(tp, RESET_KIND_SHUTDOWN, 0);
 	tg3_init_hw(tp);
 
 	tg3_netif_start(tp);
@@ -3453,7 +3453,7 @@
 	spin_lock_irq(&tp->lock);
 	spin_lock(&tp->tx_lock);
 
-	tg3_halt(tp, 1);
+	tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
 
 	tg3_set_mtu(dev, tp, new_mtu);
 
@@ -4144,19 +4144,19 @@
 }
 
 /* tp->lock is held. */
-static int tg3_halt(struct tg3 *tp, int silent)
+static int tg3_halt(struct tg3 *tp, int kind, int silent)
 {
 	int err;
 
 	tg3_stop_fw(tp);
 
-	tg3_write_sig_pre_reset(tp, RESET_KIND_SHUTDOWN);
+	tg3_write_sig_pre_reset(tp, kind);
 
 	tg3_abort_hw(tp, silent);
 	err = tg3_chip_reset(tp);
 
-	tg3_write_sig_legacy(tp, RESET_KIND_SHUTDOWN);
-	tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);
+	tg3_write_sig_legacy(tp, kind);
+	tg3_write_sig_post_reset(tp, kind);
 
 	if (err)
 		return err;
@@ -5997,7 +5997,7 @@
 	spin_lock_irq(&tp->lock);
 	spin_lock(&tp->tx_lock);
 
-	tg3_halt(tp, 1);
+	tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
 	err = tg3_init_hw(tp);
 
 	spin_unlock(&tp->tx_lock);
@@ -6073,7 +6073,7 @@
 
 	err = tg3_init_hw(tp);
 	if (err) {
-		tg3_halt(tp, 1);
+		tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
 		tg3_free_rings(tp);
 	} else {
 		if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)
@@ -6117,7 +6117,7 @@
 				pci_disable_msi(tp->pdev);
 				tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI;
 			}
-			tg3_halt(tp, 1);
+			tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
 			tg3_free_rings(tp);
 			tg3_free_consistent(tp);
 
@@ -6390,7 +6390,7 @@
 
 	tg3_disable_ints(tp);
 
-	tg3_halt(tp, 1);
+	tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
 	tg3_free_rings(tp);
 	tp->tg3_flags &=
 		~(TG3_FLAG_INIT_COMPLETE |
@@ -7110,7 +7110,7 @@
 	tp->tx_pending = ering->tx_pending;
 
 	if (netif_running(dev)) {
-		tg3_halt(tp, 1);
+		tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
 		tg3_init_hw(tp);
 		tg3_netif_start(tp);
 	}
@@ -7153,7 +7153,7 @@
 		tp->tg3_flags &= ~TG3_FLAG_TX_PAUSE;
 
 	if (netif_running(dev)) {
-		tg3_halt(tp, 1);
+		tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
 		tg3_init_hw(tp);
 		tg3_netif_start(tp);
 	}
@@ -9586,7 +9586,7 @@
 	    (tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) {
 		pci_save_state(tp->pdev);
 		tw32(MEMARB_MODE, MEMARB_MODE_ENABLE);
-		tg3_halt(tp, 1);
+		tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
 	}
 
 	err = tg3_test_dma(tp);
@@ -9713,7 +9713,7 @@
 
 	spin_lock_irq(&tp->lock);
 	spin_lock(&tp->tx_lock);
-	tg3_halt(tp, 1);
+	tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
 	spin_unlock(&tp->tx_lock);
 	spin_unlock_irq(&tp->lock);
 

^ permalink raw reply

* [PATCH 2.6.12-rc5 3/9] tg3: Add link test
From: Michael Chan @ 2005-05-26 17:57 UTC (permalink / raw)
  To: davem; +Cc: jgarzik, netdev
In-Reply-To: <1117128795.3744.22.camel@rh4>

[-- Attachment #1: Type: text/plain, Size: 49 bytes --]

Signed-off-by: Michael Chan <mchan@broadcom.com>

[-- Attachment #2: tg3-d3.patch --]
[-- Type: text/x-patch, Size: 1068 bytes --]

diff -Nru d2/drivers/net/tg3.c d3/drivers/net/tg3.c
--- d2/drivers/net/tg3.c	2005-05-25 12:59:00.000000000 -0700
+++ d3/drivers/net/tg3.c	2005-05-25 12:59:09.000000000 -0700
@@ -7281,6 +7281,32 @@
 	return err;
 }
 
+#define TG3_SERDES_TIMEOUT_SEC	2
+#define TG3_COPPER_TIMEOUT_SEC	6
+
+static int tg3_test_link(struct tg3 *tp)
+{
+	int i, max;
+
+	if (!netif_running(tp->dev))
+		return -ENODEV;
+
+	if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
+		max = TG3_SERDES_TIMEOUT_SEC;
+	else
+		max = TG3_COPPER_TIMEOUT_SEC;
+
+	for (i = 0; i < max; i++) {
+		if (netif_carrier_ok(tp->dev))
+			return 0;
+
+		if (msleep_interruptible(1000))
+			break;
+	}
+
+	return -EIO;
+}
+
 static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
 			  u64 *data)
 {
@@ -7292,6 +7318,10 @@
 		etest->flags |= ETH_TEST_FL_FAILED;
 		data[0] = 1;
 	}
+	if (tg3_test_link(tp) != 0) {
+		etest->flags |= ETH_TEST_FL_FAILED;
+		data[1] = 1;
+	}
 }
 
 static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)

^ permalink raw reply

* [PATCH 2.6.12-rc5 2/9] tg3: Add nvram test
From: Michael Chan @ 2005-05-26 17:57 UTC (permalink / raw)
  To: davem; +Cc: jgarzik, netdev
In-Reply-To: <1117128795.3744.22.camel@rh4>

[-- Attachment #1: Type: text/plain, Size: 49 bytes --]

Signed-off-by: Michael Chan <mchan@broadcom.com>

[-- Attachment #2: tg3-d2.patch --]
[-- Type: text/x-patch, Size: 1550 bytes --]

diff -Nru d1/drivers/net/tg3.c d2/drivers/net/tg3.c
--- d1/drivers/net/tg3.c	2005-05-25 12:58:50.000000000 -0700
+++ d2/drivers/net/tg3.c	2005-05-25 12:59:00.000000000 -0700
@@ -7239,9 +7239,59 @@
 	memcpy(tmp_stats, tg3_get_estats(tp), sizeof(tp->estats));
 }
 
+#define NVRAM_TEST_SIZE 0x100
+
+static int tg3_test_nvram(struct tg3 *tp)
+{
+	u32 *buf, csum;
+	int i, j, err = 0;
+
+	buf = kmalloc(NVRAM_TEST_SIZE, GFP_KERNEL);
+	if (buf == NULL)
+		return -ENOMEM;
+
+	for (i = 0, j = 0; i < NVRAM_TEST_SIZE; i += 4, j++) {
+		u32 val;
+
+		if ((err = tg3_nvram_read(tp, i, &val)) != 0)
+			break;
+		buf[j] = cpu_to_le32(val);
+	}
+	if (i < NVRAM_TEST_SIZE)
+		goto out;
+
+	err = -EIO;
+	if (cpu_to_be32(buf[0]) != TG3_EEPROM_MAGIC)
+		goto out;
+
+	/* Bootstrap checksum at offset 0x10 */
+	csum = calc_crc((unsigned char *) buf, 0x10);
+	if(csum != cpu_to_le32(buf[0x10/4]))
+		goto out;
+
+	/* Manufacturing block starts at offset 0x74, checksum at 0xfc */
+	csum = calc_crc((unsigned char *) &buf[0x74/4], 0x88);
+	if (csum != cpu_to_le32(buf[0xfc/4]))
+		 goto out;
+
+	err = 0;
+
+out:
+	kfree(buf);
+	return err;
+}
+
 static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
 			  u64 *data)
 {
+	struct tg3 *tp = netdev_priv(dev);
+
+	memset(data, 0, sizeof(u64) * TG3_NUM_TEST);
+
+	if (tg3_test_nvram(tp) != 0) {
+		etest->flags |= ETH_TEST_FL_FAILED;
+		data[0] = 1;
+	}
 }
 
 static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)

^ permalink raw reply

* [PATCH 2.6.12-rc5 1/9] tg3: Add basic selftest infrastructure
From: Michael Chan @ 2005-05-26 17:56 UTC (permalink / raw)
  To: davem; +Cc: jgarzik, netdev
In-Reply-To: <1117128795.3744.22.camel@rh4>

[-- Attachment #1: Type: text/plain, Size: 49 bytes --]

Signed-off-by: Michael Chan <mchan@broadcom.com>

[-- Attachment #2: tg3-d1.patch --]
[-- Type: text/x-patch, Size: 2107 bytes --]

diff -Nru d0/drivers/net/tg3.c d1/drivers/net/tg3.c
--- d0/drivers/net/tg3.c	2005-05-25 12:57:36.000000000 -0700
+++ d1/drivers/net/tg3.c	2005-05-25 12:58:50.000000000 -0700
@@ -133,6 +133,8 @@
 /* number of ETHTOOL_GSTATS u64's */
 #define TG3_NUM_STATS		(sizeof(struct tg3_ethtool_stats)/sizeof(u64))
 
+#define TG3_NUM_TEST		6
+
 static char version[] __devinitdata =
 	DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
 
@@ -316,6 +318,17 @@
 	{ "nic_tx_threshold_hit" }
 };
 
+static struct {
+	const char string[ETH_GSTRING_LEN];
+} ethtool_test_keys[TG3_NUM_TEST] = {
+	{ "nvram test     (online) " },
+	{ "link test      (online) " },
+	{ "register test  (offline)" },
+	{ "memory test    (offline)" },
+	{ "loopback test  (offline)" },
+	{ "interrupt test (offline)" },
+};
+
 static void tg3_write_indirect_reg32(struct tg3 *tp, u32 off, u32 val)
 {
 	if ((tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) != 0) {
@@ -7199,12 +7212,20 @@
 	return TG3_NUM_STATS;
 }
 
+static int tg3_get_test_count (struct net_device *dev)
+{
+	return TG3_NUM_TEST;
+}
+
 static void tg3_get_strings (struct net_device *dev, u32 stringset, u8 *buf)
 {
 	switch (stringset) {
 	case ETH_SS_STATS:
 		memcpy(buf, &ethtool_stats_keys, sizeof(ethtool_stats_keys));
 		break;
+	case ETH_SS_TEST:
+		memcpy(buf, &ethtool_test_keys, sizeof(ethtool_test_keys));
+		break;
 	default:
 		WARN_ON(1);	/* we need a WARN() */
 		break;
@@ -7218,6 +7239,11 @@
 	memcpy(tmp_stats, tg3_get_estats(tp), sizeof(tp->estats));
 }
 
+static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
+			  u64 *data)
+{
+}
+
 static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
 	struct mii_ioctl_data *data = if_mii(ifr);
@@ -7331,6 +7357,8 @@
 	.get_tso		= ethtool_op_get_tso,
 	.set_tso		= tg3_set_tso,
 #endif
+	.self_test_count	= tg3_get_test_count,
+	.self_test		= tg3_self_test,
 	.get_strings		= tg3_get_strings,
 	.get_stats_count	= tg3_get_stats_count,
 	.get_ethtool_stats	= tg3_get_ethtool_stats,

^ permalink raw reply

* [PATCH 2.6.12-rc5 0/9] tg3: Add ethtool selftest
From: Michael Chan @ 2005-05-26 17:33 UTC (permalink / raw)
  To: davem; +Cc: jgarzik, netdev

I tried to keep these patches reasonably small. The total added size is
about 5K on i386. Patches will follow.

^ permalink raw reply

* Re: getting eth1: Memory squeeze, dropping packet message
From: Jon Mason @ 2005-05-26 16:22 UTC (permalink / raw)
  To: cranium2003; +Cc: net dev
In-Reply-To: <20050526144058.11890.qmail@web33004.mail.mud.yahoo.com>

On Thursday 26 May 2005 09:40 am, cranium2003 wrote:
> Hello,
>        While transmitting packets through linux Router
> host from one network to another Redhat linux 9 kernel
> 2.4.20-8 caught kernel oops following there are 2
> statements which are
> __alloc_pages: 0 order allocation failed (gfp =
> 0x20/1)
> eth1: Memory squeeze, dropping packet
> What this means? 

The driver was trying to alloc a rx skb and couldn't.  The incoming packet was 
dropped.  Assuming that the error logged is the only problem you saw, this 
isn't a driver or kernel bug.  It means you were out of free kernel memory. 

You can see if you have any processes consuming lots of memory.

Thanks,
Jon

^ permalink raw reply

* RE: Fw: [Bugme-new] [Bug 4628] New: Test server hang while running rhr (network) test on RHEL4 with kernel 2.6.12-rc1-mm4
From: Jian Jun He @ 2005-05-26 16:09 UTC (permalink / raw)
  To: Venkatesan, Ganesh
  Cc: Andrew Morton, anton, Dang En Ren, ganesh.venkatesan, herbert,
	Brandeburg, Jesse, jgarzik, Jia Sen Wang, Ronciak, John,
	Lei CDL Wang, linuxppc64-dev, netdev
In-Reply-To: <468F3FDA28AA87429AD807992E22D07E056B8C25@orsmsx408>


[-- Attachment #1.1: Type: text/plain, Size: 6462 bytes --]


hello Ganesh,

This is the detail information about the problem.I will verify the defect
on 2.6.12-rc5 with mm1 patch.
Thank you for your attention.

---------------------------------------
Distribution:
RHEL4 with kernel 2.6.12-rc1-mm4

Hardware Environment:
IBM OpenPower( CHRP IBM,9124-720 )

Software Environment:
RHEL4
RHR: rhr2-rhel4-1.0-14a.noarch.rpm

Problem Description:
The test server hang while running rhr (network) test on RHEL4 with kernel
2.6.12-rc1-mm4.

Steps to reproduce:
1. Download kernel 2.6.12-rc1 and 2.6.12-rc1-mm4 patch from kernel.org,
then
build the kernel on OpenPower 720
2. Download rhr2-rhel4-1.0-14a.noarch.rpm from rhn.redhat.com and install
it on
the test machine.
3. Configure and run the rhr test via invoking redhat-ready.

Additional information:
Here is the backtrace from xmon.

3:mon> e
cpu 0x3: Vector: 700 (Program Check) at [c00000000ffe7920]
    pc: c00000000029632c: .__kfree_skb+0x188/0x240
    lr: c000000000296328: .__kfree_skb+0x184/0x240
    sp: c00000000ffe7ba0
   msr: 8000000000029032
  current = 0xc000000107f94040
  paca    = 0xc000000000431c00
    pid   = 0, comm = swapper
kernel BUG in __kfree_skb at net/core/skbuff.c:282!

3:mon> t
[c00000000ffe7c40] d0000000000ebac4 .e100_rx_clean_list+0xa0/0x144 [e100]
[c00000000ffe7ce0] d0000000000ed6dc .e100_tx_timeout+0x7c/0xb0 [e100]
[c00000000ffe7d70] c0000000002b87bc .dev_watchdog+0xc8/0x154
[c00000000ffe7e00] c00000000006d6b4 .run_timer_softirq+0x180/0x298
[c00000000ffe7ed0] c0000000000667d8 .__do_softirq+0xdc/0x1b8
[c00000000ffe7f90] c000000000014bf0 .call_do_softirq+0x14/0x24
[c000000086b43860] c0000000000102c4 .do_softirq+0x98/0xac
[c000000086b438f0] c0000000000669cc .irq_exit+0x70/0x8c
[c000000086b43970] c000000000011fb8 .timer_interrupt+0x398/0x47c
[c000000086b43a90] c00000000000a2b4 decrementer_common+0xb4/0x100
--- Exception: 901 (Decrementer) at c000000000010554
.dedicated_idle+0x114/0x280
[c000000086b43e80] c0000000000108c8 .cpu_idle+0x3c/0x54
[c000000086b43f00] c00000000003cc8c .start_secondary+0x108/0x148
[c000000086b43f90] c00000000000bd84 .enable_64b_mode+0x0/0x28

Best Regards!

Jian Jun He

CSDL, Beijing
Email: hejianj@cn.ibm.com



                                                                       
             "Venkatesan,                                              
             Ganesh"                                                   
             <ganesh.venkatesa                                          To
             n@intel.com>              "Andrew Morton" <akpm@osdl.org>,
                                       Jian Jun He/China/Contr/IBM@IBMCN,
             2005-05-26 21:00          "Ronciak, John"                 
                                       <john.ronciak@intel.com>,       
                                       "Brandeburg, Jesse"             
                                       <jesse.brandeburg@intel.com>    
                                                                        cc
                                       <ganesh.venkatesan@gmail.com>,  
                                       <anton@samba.org>,              
                                       <herbert@gondor.apana.org.au>,  
                                       <jgarzik@pobox.com>,            
                                       <linuxppc64-dev@lists.linuxppc.org.
                                       sgi.com>, <netdev@oss.sgi.com>, 
                                       Dang En Ren/China/IBM@IBMCN, Jia
                                       Sen Wang/China/IBM@IBMCN, Lei CDL
                                       Wang/China/Contr/IBM@IBMCN      
                                                                   Subject
                                       RE: Fw: [Bugme-new] [Bug 4628] New:
                                       Test server hang while running rhr
                                       (network) test on RHEL4 with kernel
                                       2.6.12-rc1-mm4                  
                                                                       
                                                                       
                                                                       
                                                                       
                                                                       
                                                                       




Jian:

We need more information on the test you run to get this hang. We have
not seen a hang similar to the one you describe. We have a p-series
machine in our lab and all we need is details on the test to run.

Thanks,
Ganesh.

>-----Original Message-----
>From: Andrew Morton [mailto:akpm@osdl.org]
>Sent: Thursday, May 26, 2005 12:38 AM
>To: Jian Jun He; Ronciak, John; Venkatesan, Ganesh; Brandeburg, Jesse
>Cc: ganesh.venkatesan@gmail.com; anton@samba.org;
>herbert@gondor.apana.org.au; jgarzik@pobox.com; linuxppc64-
>dev@lists.linuxppc.org.sgi.com; netdev@oss.sgi.com; rende@cn.ibm.com;
>wangjs@cn.ibm.com; cdlwangl@cn.ibm.com
>Subject: Re: Fw: [Bugme-new] [Bug 4628] New: Test server hang while
running
>rhr (network) test on RHEL4 with kernel 2.6.12-rc1-mm4
>
>Jian Jun He <hejianj@cn.ibm.com> wrote:
>>
>> I download e100-3.4.8 and installed in the test machine (both client
and
>>  server). But the server still hang while running rhr (network) test.
:(
>
>e100 is one of those drivers which we'd rather like to have working
>properly.
>
>Can we please confirm that a) this bug is not fixed in 2.6.12-rc5 and
b)
>nobody has seen a patch which fixes it?
>
>
>
>For reference:
>
>Herbert Xu <herbert@gondor.apana.org.au> wrote:
>>
>> Andrew Morton <akpm@osdl.org> wrote:
>> >
>> > Might be a bug in the e100 driver, might not be.
>> >
>> > I assume this is the
>> >
>> >        BUG_ON(skb->list != NULL);
>>
>> It certainly is a bug in e100.
>>
>> e100_tx_timeout -> e100_down -> e100_rx_clean_list
>>
>> is racing against
>>
>> e100_poll -> e100_rx_clean -> e100_rx_indicate
>>
>> e100_rx_clean/e100_rx_indicate takes an skb off the RX ring and
>> while it's being processed e100_rx_clean_list comes along and
>> frees it.
>>
>> >From a quick check similar problems may exist in other drivers that
>> have lockless ->poll() functions with RX rings.

[-- Attachment #1.2: Type: text/html, Size: 8059 bytes --]

[-- Attachment #2: graycol.gif --]
[-- Type: image/gif, Size: 105 bytes --]

[-- Attachment #3: pic30027.gif --]
[-- Type: image/gif, Size: 1255 bytes --]

[-- Attachment #4: ecblank.gif --]
[-- Type: image/gif, Size: 45 bytes --]

^ permalink raw reply

* getting eth1: Memory squeeze, dropping packet message
From: cranium2003 @ 2005-05-26 14:40 UTC (permalink / raw)
  To: net dev

Hello,
       While transmitting packets through linux Router
host from one network to another Redhat linux 9 kernel
2.4.20-8 caught kernel oops following there are 2
statements which are
__alloc_pages: 0 order allocation failed (gfp =
0x20/1)
eth1: Memory squeeze, dropping packet
What this means? where is the wrong thing in kenrel?
How to solve this problem?
regards,
cranium.



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new Resources site
http://smallbusiness.yahoo.com/resources/

^ permalink raw reply

* [PATCH 2.6] fix deadlock with ip_queue and tcp local input path
From: Harald Welte @ 2005-05-26 14:24 UTC (permalink / raw)
  To: Netfilter Development Mailinglist; +Cc: Linux Netdev List


[-- Attachment #1.1: Type: text/plain, Size: 1636 bytes --]

Hi!

When we have ip_queue being used from LOCAL_IN, then we end up with a
situation where the verdicts coming back from userspace traverse the TCP
input path from syscall context.  While this seems to work most of the
time, there's an ungly deadlock:

syscall context is interrupted by the timer interrupt.  When the timer
interrupt leaves, the timer softirq get's scheduled and calls
tcp_delack_timer() and alike.  They themselves do bh_lock_sock(sk),
which is already held from somewhere else[1] -> boom.

The patch below adds an additional queue for ip_queue verdicts.  They
come up from userspace, are appended to a queue which is then processed
by a tasklet.  The tasklet itself runs in softirq context, so when timer
hardirq leaves, no tcp_delack_timer() will be executed until
nf_reinject() has finished.

Dave: Please don't apply yet, I want to receive feedback from the
netfilter developers first.  I'm just Cc'ing netdev in case somebody
wants an intermediate fix to fix the problem.

[1] i didn't actually find from where that lock was held.  In any case,
it didn't seem nice to traverse the IP input codepath from syscall
context.  There might be a number of places which just assume to run in
softirq.

Comments welcome!

-- 
- Harald Welte <laforge@netfilter.org>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #1.2: 2.6.12-rc5-ip_queue-local-reinject-smp-deadlock-fix.patch --]
[-- Type: text/plain, Size: 10651 bytes --]

Fix ip_queue when used from LOCAL_IN hook.  Without this patch, packets are
nf_reinject()ed from syscall context.   Syscall context will be interupted
from timer interrupt, and timer interrupt will call TCP timer code such as
tcp_delack_timer(), which in turn tries to bh_lock_sock() and deadlocks at that
point.

Thanks to Holger Eitzenberger <heitzenberger@astaro.com> and 
Stephan Scholz <sscholz@astaro.com> for providing me with backtraces.

Signed-off-by: Harald Welte <laforge@netfilter.org>


Index: linux-2.6.12-rc5/net/ipv4/netfilter/ip_queue.c
===================================================================
--- linux-2.6.12-rc5.orig/net/ipv4/netfilter/ip_queue.c	2005-05-26 15:50:01.000000000 +0200
+++ linux-2.6.12-rc5/net/ipv4/netfilter/ip_queue.c	2005-05-26 16:09:08.000000000 +0200
@@ -3,6 +3,8 @@
  * communicating with userspace via netlink.
  *
  * (C) 2000-2002 James Morris <jmorris@intercode.com.au>
+ * (C) 2003-2004 Netfilter Core Team <coreteam@netfilter.org>
+ * (C) 2005 Harald Welte <laforge@netfilter.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -17,6 +19,9 @@
  * 2005-01-10: Added /proc counter for dropped packets; fixed so
  *             packets aren't delivered to user space if they're going 
  *             to be dropped. 
+ * 2005-05-25: Issue verdict from tasklet context, not from syscall (netlink
+ *             sendmsg) to avoid deadlocks in TCP input path with timer
+ *             softirq.
  *
  */
 #include <linux/module.h>
@@ -40,6 +45,7 @@
 #define IPQ_PROC_FS_NAME "ip_queue"
 #define NET_IPQ_QMAX 2088
 #define NET_IPQ_QMAX_NAME "ip_queue_maxlen"
+#define	IPQ_VERDICT_BATCH 10
 
 struct ipq_rt_info {
 	__u8 tos;
@@ -52,6 +58,16 @@
 	struct nf_info *info;
 	struct sk_buff *skb;
 	struct ipq_rt_info rt_info;
+
+	/* only used in verdict_queue */
+	int verdict;
+};
+
+struct ipq_queue {
+	struct list_head list;
+	unsigned int total;
+	unsigned int dropped;
+	unsigned int user_dropped;
 };
 
 typedef int (*ipq_cmpfn)(struct ipq_queue_entry *, unsigned long);
@@ -61,14 +77,16 @@
 static DEFINE_RWLOCK(queue_lock);
 static int peer_pid;
 static unsigned int copy_range;
-static unsigned int queue_total;
-static unsigned int queue_dropped = 0;
-static unsigned int queue_user_dropped = 0;
 static struct sock *ipqnl;
-static LIST_HEAD(queue_list);
 static DECLARE_MUTEX(ipqnl_sem);
 
-static void
+static struct ipq_queue pkt_queue;	/* queue of packets to userspace */
+static struct ipq_queue verdict_queue;	/* queue of verdicst from userspace */
+
+static void ipq_verdict_task(unsigned long arg);
+static DECLARE_TASKLET(ipq_verdict_tasklet, ipq_verdict_task, 0);
+
+static inline void
 ipq_issue_verdict(struct ipq_queue_entry *entry, int verdict)
 {
 	nf_reinject(entry->skb, entry->info, verdict);
@@ -76,10 +94,10 @@
 }
 
 static inline void
-__ipq_enqueue_entry(struct ipq_queue_entry *entry)
+__ipq_enqueue_entry(struct ipq_queue *queue, struct ipq_queue_entry *entry)
 {
-       list_add(&entry->list, &queue_list);
-       queue_total++;
+       list_add(&entry->list, &queue->list);
+       queue->total++;
 }
 
 /*
@@ -87,11 +105,11 @@
  * entry if cmpfn is NULL.
  */
 static inline struct ipq_queue_entry *
-__ipq_find_entry(ipq_cmpfn cmpfn, unsigned long data)
+__ipq_find_entry(struct ipq_queue *queue, ipq_cmpfn cmpfn, unsigned long data)
 {
 	struct list_head *p;
 
-	list_for_each_prev(p, &queue_list) {
+	list_for_each_prev(p, &queue->list) {
 		struct ipq_queue_entry *entry = (struct ipq_queue_entry *)p;
 		
 		if (!cmpfn || cmpfn(entry, data))
@@ -101,33 +119,49 @@
 }
 
 static inline void
-__ipq_dequeue_entry(struct ipq_queue_entry *entry)
+__ipq_dequeue_entry(struct ipq_queue *queue, struct ipq_queue_entry *entry)
 {
 	list_del(&entry->list);
-	queue_total--;
+	queue->total--;
 }
 
 static inline struct ipq_queue_entry *
-__ipq_find_dequeue_entry(ipq_cmpfn cmpfn, unsigned long data)
+__ipq_find_dequeue_entry(struct ipq_queue *queue, ipq_cmpfn cmpfn, 
+			 unsigned long data)
 {
 	struct ipq_queue_entry *entry;
 
-	entry = __ipq_find_entry(cmpfn, data);
+	entry = __ipq_find_entry(queue, cmpfn, data);
 	if (entry == NULL)
 		return NULL;
 
-	__ipq_dequeue_entry(entry);
+	__ipq_dequeue_entry(queue, entry);
 	return entry;
 }
 
+static void
+ipq_enqueue_verdict(struct ipq_queue_entry *entry, int verdict)
+{
+	entry->verdict = verdict;
+
+	write_lock_bh(&queue_lock);
+	if (verdict_queue.total >= queue_maxlen) {
+		verdict_queue.dropped++;
+		write_unlock_bh(&queue_lock);
+	}
+	__ipq_enqueue_entry(&verdict_queue, entry);
+	write_unlock_bh(&queue_lock);
+
+	tasklet_schedule(&ipq_verdict_tasklet);
+}
 
 static inline void
 __ipq_flush(int verdict)
 {
 	struct ipq_queue_entry *entry;
 	
-	while ((entry = __ipq_find_dequeue_entry(NULL, 0)))
-		ipq_issue_verdict(entry, verdict);
+	while ((entry = __ipq_find_dequeue_entry(&pkt_queue, NULL, 0)))
+		ipq_enqueue_verdict(entry, verdict);
 }
 
 static inline int
@@ -166,12 +200,13 @@
 }
 
 static struct ipq_queue_entry *
-ipq_find_dequeue_entry(ipq_cmpfn cmpfn, unsigned long data)
+ipq_find_dequeue_entry(struct ipq_queue *queue, ipq_cmpfn cmpfn, 
+		       unsigned long data)
 {
 	struct ipq_queue_entry *entry;
 	
 	write_lock_bh(&queue_lock);
-	entry = __ipq_find_dequeue_entry(cmpfn, data);
+	entry = __ipq_find_dequeue_entry(queue, cmpfn, data);
 	write_unlock_bh(&queue_lock);
 	return entry;
 }
@@ -182,6 +217,7 @@
 	write_lock_bh(&queue_lock);
 	__ipq_flush(verdict);
 	write_unlock_bh(&queue_lock);
+
 }
 
 static struct sk_buff *
@@ -306,24 +342,24 @@
 	if (!peer_pid)
 		goto err_out_free_nskb; 
 
-	if (queue_total >= queue_maxlen) {
-                queue_dropped++;
+	if (pkt_queue.total >= queue_maxlen) {
+                pkt_queue.dropped++;
 		status = -ENOSPC;
 		if (net_ratelimit())
 		          printk (KERN_WARNING "ip_queue: full at %d entries, "
-				  "dropping packets(s). Dropped: %d\n", queue_total,
-				  queue_dropped);
+				  "dropping packets(s). Dropped: %d\n", 
+				  pkt_queue.total, pkt_queue.dropped);
 		goto err_out_free_nskb;
 	}
 
  	/* netlink_unicast will either free the nskb or attach it to a socket */ 
 	status = netlink_unicast(ipqnl, nskb, peer_pid, MSG_DONTWAIT);
 	if (status < 0) {
-	        queue_user_dropped++;
+	        pkt_queue.user_dropped++;
 		goto err_out_unlock;
 	}
 
-	__ipq_enqueue_entry(entry);
+	__ipq_enqueue_entry(&pkt_queue, entry);
 
 	write_unlock_bh(&queue_lock);
 	return status;
@@ -406,7 +442,7 @@
 	if (vmsg->value > NF_MAX_VERDICT)
 		return -EINVAL;
 
-	entry = ipq_find_dequeue_entry(id_cmp, vmsg->id);
+	entry = ipq_find_dequeue_entry(&pkt_queue, id_cmp, vmsg->id);
 	if (entry == NULL)
 		return -ENOENT;
 	else {
@@ -416,7 +452,11 @@
 			if (ipq_mangle_ipv4(vmsg, entry) < 0)
 				verdict = NF_DROP;
 		
-		ipq_issue_verdict(entry, verdict);
+		/* instead of issuing the verdict herer from syscall
+		 * context, we enqueue the verdict to the verdict_queue,
+		 * which is later processed by softirq context */
+		ipq_enqueue_verdict(entry, verdict);
+
 		return 0;
 	}
 }
@@ -479,8 +519,9 @@
 {
 	struct ipq_queue_entry *entry;
 	
-	while ((entry = ipq_find_dequeue_entry(dev_cmp, ifindex)) != NULL)
-		ipq_issue_verdict(entry, NF_DROP);
+	while ((entry = ipq_find_dequeue_entry(&pkt_queue,
+						dev_cmp, ifindex)) != NULL)
+		ipq_enqueue_verdict(entry, NF_DROP);
 }
 
 #define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err)); return; } while (0)
@@ -630,6 +671,29 @@
 	{ .ctl_name = 0 }
 };
 
+/* This tasklet feeds queued verdicts through the network stack.  Since it runs
+ * in tasklet softirq context, this makes the TCP local input path happy -HW */
+static void
+ipq_verdict_task(unsigned long arg)
+{
+	struct ipq_queue_entry *entry;
+	unsigned int num = 0;
+
+	/* we want to stall other processing for too long. */
+	for (num = 0; num < IPQ_VERDICT_BATCH; num++) {
+		entry = ipq_find_dequeue_entry(&verdict_queue, NULL, 0);
+		if (!entry) {
+			break;
+		}
+		ipq_issue_verdict(entry, entry->verdict);
+	}
+
+	if (verdict_queue.total) {
+		/* more work to be done, schedule us again */
+		tasklet_schedule(&ipq_verdict_tasklet);
+	}
+}
+
 #ifdef CONFIG_PROC_FS
 static int
 ipq_get_info(char *buffer, char **start, off_t offset, int length)
@@ -639,20 +703,24 @@
 	read_lock_bh(&queue_lock);
 	
 	len = sprintf(buffer,
-	              "Peer PID          : %d\n"
-	              "Copy mode         : %hu\n"
-	              "Copy range        : %u\n"
-	              "Queue length      : %u\n"
-	              "Queue max. length : %u\n"
-		      "Queue dropped     : %u\n"
-		      "Netlink dropped   : %u\n",
+	              "Peer PID              : %d\n"
+	              "Copy mode             : %hu\n"
+	              "Copy range            : %u\n"
+	              "Queue length          : %u\n"
+	              "Queue max. length     : %u\n"
+		      "Queue dropped         : %u\n"
+		      "Netlink dropped       : %u\n"
+		      "Verdict queue len     : %u\n"
+		      "Verdict queue dropped : %u\n",
 	              peer_pid,
 	              copy_mode,
 	              copy_range,
-	              queue_total,
+	              pkt_queue.total,
 	              queue_maxlen,
-		      queue_dropped,
-		      queue_user_dropped);
+		      pkt_queue.dropped,
+		      pkt_queue.user_dropped,
+		      verdict_queue.total,
+		      verdict_queue.dropped);
 
 	read_unlock_bh(&queue_lock);
 	
@@ -675,6 +743,16 @@
 	if (!init)
 		goto cleanup;
 
+	INIT_LIST_HEAD(&pkt_queue.list);
+	pkt_queue.total = 0;
+	pkt_queue.dropped = 0;
+	pkt_queue.user_dropped = 0;
+
+	INIT_LIST_HEAD(&verdict_queue.list);
+	verdict_queue.total = 0;
+	verdict_queue.dropped = 0;
+	verdict_queue.user_dropped = 0;
+
 	netlink_register_notifier(&ipq_nl_notifier);
 	ipqnl = netlink_kernel_create(NETLINK_FIREWALL, ipq_rcv_sk);
 	if (ipqnl == NULL) {
@@ -704,6 +782,14 @@
 	nf_unregister_queue_handler(PF_INET);
 	synchronize_net();
 	ipq_flush(NF_DROP);
+
+	while (verdict_queue.total != 0) {
+		printk(KERN_INFO "ip_queue: verdict queue not empty while "
+			"module unload, scheduling\n");
+		tasklet_schedule(&ipq_verdict_tasklet);
+		schedule();
+	}
+	tasklet_disable(&ipq_verdict_tasklet);
 	
 cleanup_sysctl:
 	unregister_sysctl_table(ipq_sysctl_header);

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* RE: Fw: [Bugme-new] [Bug 4628] New: Test server hang while running rhr (network) test on RHEL4 with kernel 2.6.12-rc1-mm4
From: Venkatesan, Ganesh @ 2005-05-26 13:00 UTC (permalink / raw)
  To: Andrew Morton, Jian Jun He, Ronciak, John, Brandeburg, Jesse
  Cc: ganesh.venkatesan, anton, herbert, jgarzik, linuxppc64-dev,
	netdev, rende, wangjs, cdlwangl

Jian:

We need more information on the test you run to get this hang. We have
not seen a hang similar to the one you describe. We have a p-series
machine in our lab and all we need is details on the test to run.

Thanks,
Ganesh.

>-----Original Message-----
>From: Andrew Morton [mailto:akpm@osdl.org]
>Sent: Thursday, May 26, 2005 12:38 AM
>To: Jian Jun He; Ronciak, John; Venkatesan, Ganesh; Brandeburg, Jesse
>Cc: ganesh.venkatesan@gmail.com; anton@samba.org;
>herbert@gondor.apana.org.au; jgarzik@pobox.com; linuxppc64-
>dev@lists.linuxppc.org.sgi.com; netdev@oss.sgi.com; rende@cn.ibm.com;
>wangjs@cn.ibm.com; cdlwangl@cn.ibm.com
>Subject: Re: Fw: [Bugme-new] [Bug 4628] New: Test server hang while
running
>rhr (network) test on RHEL4 with kernel 2.6.12-rc1-mm4
>
>Jian Jun He <hejianj@cn.ibm.com> wrote:
>>
>> I download e100-3.4.8 and installed in the test machine (both client
and
>>  server). But the server still hang while running rhr (network) test.
:(
>
>e100 is one of those drivers which we'd rather like to have working
>properly.
>
>Can we please confirm that a) this bug is not fixed in 2.6.12-rc5 and
b)
>nobody has seen a patch which fixes it?
>
>
>
>For reference:
>
>Herbert Xu <herbert@gondor.apana.org.au> wrote:
>>
>> Andrew Morton <akpm@osdl.org> wrote:
>> >
>> > Might be a bug in the e100 driver, might not be.
>> >
>> > I assume this is the
>> >
>> >        BUG_ON(skb->list != NULL);
>>
>> It certainly is a bug in e100.
>>
>> e100_tx_timeout -> e100_down -> e100_rx_clean_list
>>
>> is racing against
>>
>> e100_poll -> e100_rx_clean -> e100_rx_indicate
>>
>> e100_rx_clean/e100_rx_indicate takes an skb off the RX ring and
>> while it's being processed e100_rx_clean_list comes along and
>> frees it.
>>
>> >From a quick check similar problems may exist in other drivers that
>> have lockless ->poll() functions with RX rings.

^ permalink raw reply

* Re: Fw: [Bugme-new] [Bug 4628] New: Test server hang while running rhr (network) test on RHEL4 with kernel 2.6.12-rc1-mm4
From: Jeff Garzik @ 2005-05-26  7:53 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Jian Jun He, john.ronciak, ganesh.venkatesan, jesse.brandeburg,
	ganesh.venkatesan, anton, herbert, linuxppc64-dev, netdev, rende,
	wangjs, cdlwangl
In-Reply-To: <20050526003828.213ad052.akpm@osdl.org>

Andrew Morton wrote:
> Jian Jun He <hejianj@cn.ibm.com> wrote:
> 
>>I download e100-3.4.8 and installed in the test machine (both client and
>> server). But the server still hang while running rhr (network) test. :(
> 
> 
> e100 is one of those drivers which we'd rather like to have working properly.
> 
> Can we please confirm that a) this bug is not fixed in 2.6.12-rc5 and b)
> nobody has seen a patch which fixes it?

2.6.12-rc5-git1 should have an e100 update in it, too...

^ permalink raw reply

* Re: Fw: [Bugme-new] [Bug 4628] New: Test server hang while running rhr (network) test on RHEL4 with kernel 2.6.12-rc1-mm4
From: Andrew Morton @ 2005-05-26  7:38 UTC (permalink / raw)
  To: Jian Jun He, john.ronciak, ganesh.venkatesan, jesse.brandeburg
  Cc: ganesh.venkatesan, anton, herbert, jgarzik, linuxppc64-dev,
	netdev, rende, wangjs, cdlwangl
In-Reply-To: <OFB1F7DBFD.6A6514AD-ON48257004.0038A154-48257004.0038E08A@cn.ibm.com>

Jian Jun He <hejianj@cn.ibm.com> wrote:
>
> I download e100-3.4.8 and installed in the test machine (both client and
>  server). But the server still hang while running rhr (network) test. :(

e100 is one of those drivers which we'd rather like to have working properly.

Can we please confirm that a) this bug is not fixed in 2.6.12-rc5 and b)
nobody has seen a patch which fixes it?



For reference:

Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> Andrew Morton <akpm@osdl.org> wrote:
> > 
> > Might be a bug in the e100 driver, might not be.
> > 
> > I assume this is the
> > 
> >        BUG_ON(skb->list != NULL);
> 
> It certainly is a bug in e100.
> 
> e100_tx_timeout -> e100_down -> e100_rx_clean_list
> 
> is racing against
> 
> e100_poll -> e100_rx_clean -> e100_rx_indicate
> 
> e100_rx_clean/e100_rx_indicate takes an skb off the RX ring and
> while it's being processed e100_rx_clean_list comes along and
> frees it.
> 
> >From a quick check similar problems may exist in other drivers that
> have lockless ->poll() functions with RX rings.

^ permalink raw reply

* Re: [PATCH] [BRIDGE]
From: Catalin(ux aka Dino) BOIE @ 2005-05-26  6:36 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, davem
In-Reply-To: <20050525144633.3a6f253e@dxpl.pdx.osdl.net>

On Wed, 25 May 2005, Stephen Hemminger wrote:

> Here is the revised version, it deals with checksum mixtures better and
> ignores stuff until bridge is up.

This patch missing the case when we have HW_CSUM (for example) on the 
bridge device, and a new device that has no HW_CSUM is added.
The fix is to call br_features_recompute(br) also in br_add_if().

Thanks.

> Index: bridge/net/bridge/br_private.h
> ===================================================================
> --- bridge.orig/net/bridge/br_private.h
> +++ bridge/net/bridge/br_private.h
> @@ -174,6 +174,7 @@ extern int br_add_if(struct net_bridge *
> extern int br_del_if(struct net_bridge *br,
> 	      struct net_device *dev);
> extern int br_min_mtu(const struct net_bridge *br);
> +extern void br_features_recompute(struct net_bridge *br);
>
> /* br_input.c */
> extern int br_handle_frame_finish(struct sk_buff *skb);
> Index: bridge/net/bridge/br_notify.c
> ===================================================================
> --- bridge.orig/net/bridge/br_notify.c
> +++ bridge/net/bridge/br_notify.c
> @@ -65,6 +65,15 @@ static int br_device_event(struct notifi
> 		}
> 		break;
>
> +	case NETDEV_FEAT_CHANGE:
> +		if (br->dev->flags & IFF_UP)
> +			br_features_recompute(br);
> +
> +		/* could do recursive feature change notification
> +		 * but who would care??
> +		 */
> +		break;
> +
> 	case NETDEV_DOWN:
> 		if (br->dev->flags & IFF_UP)
> 			br_stp_disable_port(p);
> Index: bridge/net/bridge/br_device.c
> ===================================================================
> --- bridge.orig/net/bridge/br_device.c
> +++ bridge/net/bridge/br_device.c
> @@ -21,10 +21,7 @@
>
> static struct net_device_stats *br_dev_get_stats(struct net_device *dev)
> {
> -	struct net_bridge *br;
> -
> -	br = dev->priv;
> -
> +	struct net_bridge *br = netdev_priv(dev);
> 	return &br->statistics;
> }
>
> @@ -54,9 +51,11 @@ int br_dev_xmit(struct sk_buff *skb, str
>
> static int br_dev_open(struct net_device *dev)
> {
> -	netif_start_queue(dev);
> +	struct net_bridge *br = netdev_priv(dev);
>
> -	br_stp_enable_bridge(dev->priv);
> +	br_features_recompute(br);
> +	netif_start_queue(dev);
> +	br_stp_enable_bridge(br);
>
> 	return 0;
> }
> @@ -67,7 +66,7 @@ static void br_dev_set_multicast_list(st
>
> static int br_dev_stop(struct net_device *dev)
> {
> -	br_stp_disable_bridge(dev->priv);
> +	br_stp_disable_bridge(netdev_priv(dev));
>
> 	netif_stop_queue(dev);
>
> @@ -76,7 +75,7 @@ static int br_dev_stop(struct net_device
>
> static int br_change_mtu(struct net_device *dev, int new_mtu)
> {
> -	if ((new_mtu < 68) || new_mtu > br_min_mtu(dev->priv))
> +	if (new_mtu < 68 || new_mtu > br_min_mtu(netdev_priv(dev)))
> 		return -EINVAL;
>
> 	dev->mtu = new_mtu;
> Index: bridge/net/bridge/br_if.c
> ===================================================================
> --- bridge.orig/net/bridge/br_if.c
> +++ bridge/net/bridge/br_if.c
> @@ -314,6 +314,28 @@ int br_min_mtu(const struct net_bridge *
> 	return mtu;
> }
>
> +/*
> + * Recomputes features using slave's features
> + */
> +void br_features_recompute(struct net_bridge *br)
> +{
> +	struct net_bridge_port *p;
> +	unsigned long features, checksum;
> +
> +	features = NETIF_F_SG | NETIF_F_FRAGLIST
> +		| NETIF_F_HIGHDMA | NETIF_F_TSO;
> +	checksum = NETIF_F_IP_CSUM;	/* least commmon subset */
> +
> +	list_for_each_entry(p, &br->port_list, list) {
> +		if (!(p->dev->features
> +		      & (NETIF_F_IP_CSUM|NETIF_F_NO_CSUM|NETIF_F_HW_CSUM)))
> +			checksum = 0;
> +		features &= p->dev->features;
> +	}
> +
> +	br->dev->features = features | checksum | NETIF_F_LLTX;
> +}
> +
> /* called with RTNL */
> int br_add_if(struct net_bridge *br, struct net_device *dev)
> {
> @@ -368,6 +390,7 @@ int br_del_if(struct net_bridge *br, str
>
> 	spin_lock_bh(&br->lock);
> 	br_stp_recalculate_bridge_id(br);
> +	br_features_recompute(br);
> 	spin_unlock_bh(&br->lock);
>
> 	return 0;
>

---
Catalin(ux aka Dino) BOIE
catab at deuroconsult.ro
http://kernel.umbrella.ro/

^ permalink raw reply

* Re: [PATCH] netem update for 2.4
From: David S. Miller @ 2005-05-26  6:15 UTC (permalink / raw)
  To: shemminger; +Cc: netem, netdev
In-Reply-To: <20050525135920.659f3a00@dxpl.pdx.osdl.net>

From: Stephen Hemminger <shemminger@osdl.org>
Date: Wed, 25 May 2005 13:59:20 -0700

> This includes the netem changes for 2.6 retargeted for 2.4
> It covers:
> 	* make duplication reinsert from root to fix qlen issues
> 	* just use embedded qdisc for queueing to avoid qlen issues
> 	* probabilistic reordering support

Let's keep 2.4.x to pure bug fixes, so the new reordering
support should be omitted.  Thanks.

^ permalink raw reply

* Re: [PATCH] dummy: improve performance
From: Catalin(ux aka Dino) BOIE @ 2005-05-26  6:03 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev
In-Reply-To: <20050525.151149.08323692.davem@davemloft.net>

On Wed, 25 May 2005, David S. Miller wrote:

> From: "Catalin(ux aka Dino) BOIE" <util@deuroconsult.ro>
> Date: Fri, 20 May 2005 13:11:24 +0300 (EEST)
>
>> I tested the speed and seems very low (both old version and the new one).
>> Something like 37Mbits/s. It is normal?
>> I can easily get 80Mbit/s on the same machine on ethernet.
>
> How are you receiving packets on the dummy device for
> performance testing?  This device is a transmit blackhole
> and receives no packets :-)

I only test the output part. I measure how time it takes to send an amount 
of data (icmp or udp).

> I really don't see a real need for your patch, dummy device
> performance cannot be claimed to be important at all.

Of course it's not very important.
But if someone is using it, why not at full speed?

Thanks.

---
Catalin(ux aka Dino) BOIE
catab at deuroconsult.ro
http://kernel.umbrella.ro/

^ permalink raw reply

* Re: [PATCH] [BRIDGE]
From: Catalin(ux aka Dino) BOIE @ 2005-05-26  5:49 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, davem
In-Reply-To: <20050525091427.35621a21@dxpl.pdx.osdl.net>

On Wed, 25 May 2005, Stephen Hemminger wrote:

> On Tue, 24 May 2005 10:29:25 +0300 (EEST)
> "Catalin(ux aka Dino) BOIE" <util@deuroconsult.ro> wrote:
>
>> Hello!
>>
>> This patch set bridge device features using the common features of all
>> slaves. Also, it reacts to features change using ethtool on the slaves.
>>
>> This patch depends on NETDEV_FEAT_CHANGE.patch.
>>
>
> I will add it to the next set of patches for bridging. Hold off until
> 2.6.13

Thanks, Stephen!

P.S. This patch needs NETDEV_FEAT_CHANGE.patch. Do you include both?

---
Catalin(ux aka Dino) BOIE
catab at deuroconsult.ro
http://kernel.umbrella.ro/

^ permalink raw reply

* Re: [PATCH 2/2][NET] rename struct tcp_listen_opt to struct listen_sock
From: David S. Miller @ 2005-05-26  5:33 UTC (permalink / raw)
  To: imcdnzl; +Cc: acme, netdev
In-Reply-To: <cbec11ac0505251652657a2dc1@mail.gmail.com>

From: Ian McDonald <imcdnzl@gmail.com>
Date: Thu, 26 May 2005 11:52:00 +1200

> Maybe I am looking at the wrong place but when I look at:
> http://kernel.org/git/?p=linux/kernel/git/acme/net-2.6.13.git;a=summary
> 
> it shows non-network related patches in there as well. Is this intentional?

It shows activity in the tree it is derived from, so yes
it's normal.

^ permalink raw reply

* [doc][git] playing with git, and netdev/libata-dev trees
From: Jeff Garzik @ 2005-05-26  5:26 UTC (permalink / raw)
  To: Linux Kernel, Netdev, linux-ide@vger.kernel.org
  Cc: Andrew Morton, Git Mailing List


Hopefully, this email can quick-start some people on git.

One of the things Linus's new 'git' tool allows me to do is make public 
the 50+ repositories that were previously only available on my local 
workstation.  This should make it a lot easier for developers to see 
precisely what I have merged, and makes generating follow-up patches a 
whole lot easier.

When I merge a patch for drivers/net/forcedeth.c, I merge it into a 
brand new 'forcedeth' repository, a peer to the 40+ other such 
repository.  Under BitKeeper, I made these repositories available merged 
together into one big "netdev-2.6" repository because it was too time 
consuming to make the individual 50+ trees publicly available.  With 
git, developers have direct access to the individual trees.

I thought I would write up a quick guide describing how to mess around 
with the netdev and libata-dev trees, and with git in general.


1) installing git

git requires bootstrapping, since you must have git installed in order 
to check out git.git (git repo), and linux-2.6.git (kernel repo).  I 
have put together a bootstrap tarball of today's git repository.

Download tarball from:
http://www.kernel.org/pub/linux/kernel/people/jgarzik/git-20050526.tar.bz2

tarball build-deps:  zlib, libcurl

install tarball:  unpack && make && sudo make prefix=/usr/local install

jgarzik helper scripts, not in official git distribution:
http://www.kernel.org/pub/linux/kernel/people/jgarzik/git-switch-tree
http://www.kernel.org/pub/linux/kernel/people/jgarzik/git-new-branch
http://www.kernel.org/pub/linux/kernel/people/jgarzik/git-changes-script

After reading the rest of this document, come back and update your copy 
of git to the latest:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/git.git


2) download a linux kernel tree for the very first time

mkdir -p linux-2.6/.git
cd linux-2.6
rsync -a --delete --verbose --stats --progress \ 
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/ 
\          <- word-wrapped backslash; sigh
    .git/


3) download latest changes to on-disk local tree

cd linux-2.6
git-pull-script \
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git


4) check out files from the git repository into the working directory

cd linux-2.6
git-read-tree -m HEAD && git-checkout-cache -q -f -u -a


5) check in your own modifications (e.g. apply a patch)

# go to repo
cd linux-2.6

# make some modifications
patch -sp1 < /tmp/my.patch
diffstat -p1 < /tmp/my.patch

# NOTE: add '--add' and/or '--remove' if files were added or removed
git-update-cache <list of all files changed>

# commit changes
GIT_AUTHOR_NAME="John Doe"		\
    GIT_AUTHOR_EMAIL="jdoe@foo.com"	\
    GIT_COMMITTER_NAME="Jeff Garzik"	\
    GIT_COMMITTER_EMAIL="jgarzik@pobox.com"	\
    git-commit-tree `git-write-tree`	\
    -p $(cat .git/HEAD )			\
    < changelog.txt			\
    > .git/HEAD


6) List all changes in working dir, in diff format.

git-diff-cache -p HEAD


7) List all changesets (i.e. show each cset's description text) in local 
tree that are not present in remote tree.

cd my-kernel-tree-2.6
git-changes-script -L ../linux-2.6 | less


8) List all changesets:

git-whatchanged


9) apply all patches in a Berkeley mbox-format file

First, download and add to your PATH Linus's git tools:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/git-tools.git

cd my-kernel-tree-2.6
dotest /path/to/mbox  # yes, Linus has no taste in naming useful scripts


10) don't forget to download tags from time to time.

git-pull-script only downloads sha1-indexed object data, and the 
requested remote head.  This misses updates to the .git/refs/tags/ and 
.git/refs/heads directories.  It is advisable to update your kernel .git 
directories periodically with a full rsync command, to make sure you got 
everything:

cd linux-2.6
rsync -a --delete --verbose --stats --progress \ 
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/ 
\          <- word-wrapped backslash; sigh
    .git/


11) [jg-specific] list all branches found in netdev-2.6 or libata-dev trees.

Download
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
	or
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev.git


cd netdev-2.6
ls .git/refs/heads/

{ these are the current netdev-2.6 branches }
> 8139cp       forcedeth    master     qeth           smc91x         we18
> 8139too-iomap  for-linus    natsemi      r8169      smc91x-eeprom  wifi
> airo           hdlc         ns83820      register-netdev  starfire
> atmel          ieee80211    orinoco      remove-drivers   tlan
> chelsio        iff-running  orinoco-hch  sis900           veth
> dm9000         janitor      ppp          skge             viro



12) [jg-specific] make desired branch current in working directory

git-switch-tree $branch


13) [jg-specific] create a new branch, and make it current

git-new-branch $branch


14) [jg-specific] examine which branch is current

ls -l .git/HEAD


15) undo all local modifications (same as checkout):

git-read-tree -m HEAD && git-checkout-cache -q -f -u -a




^ permalink raw reply

* Re: non-fatal oops with EIP at skb_release_data, available for debugging
From: Andrew Morton @ 2005-05-26  5:00 UTC (permalink / raw)
  To: Alessandro Suardi; +Cc: netdev
In-Reply-To: <5a4c581d05040615306f12ebde@mail.gmail.com>

Alessandro Suardi <alessandro.suardi@gmail.com> wrote:
>
> Quoting my post of over a month ago, hit another
>  non-fatal oops this time with 2.6.12-rc1-bk2...

Has this bug been sighted in more recent kernels?

> [17330.816664] Adding 232932k swap on /dev/hdb4.  Priority:-2 extents:1
> [42120.713332] UDP: bad checksum. From 84.188.199.xxx:57483 to
> 192.168.1.7:10600  ulen 27
> [56984.872784] UDP: bad checksum. From 216.155.90.xxx:11417 to
> 192.168.1.7:10600  ulen 28
> [383152.586711] scsi: unknown opcode 0x01
> [630539.047761] UDP: short packet: From 4.46.101.xxx:5431 58/27 to
> 192.168.1.7:1 0600
> [681405.777002] ------------[ cut here ]------------
> [681405.777337] kernel BUG at include/linux/mm.h:343!
> [681405.777642] invalid operand: 0000 [#1]
> [681405.777885] PREEMPT
> [681405.778041] Modules linked in: parport_pc parport 8139too floppy
> [681405.778488] CPU:    0
> [681405.778491] EIP:    0060:[<c02dcd23>]    Not tainted VLI
> [681405.778494] EFLAGS: 00210256   (2.6.12-rc1-bk2)
> [681405.779293] EIP is at skb_release_data+0xa3/0xb0
> [681405.779593] eax: 00000000   ebx: 00000002   ecx: ceb1af80   edx: c10eeb40
> [681405.780027] esi: c30785c0   edi: c30785c0   ebp: ccd95d28   esp: ccd95d20
> [681405.780458] ds: 007b   es: 007b   ss: 0068
> [681405.780723] Process metacity (pid: 2190, threadinfo=ccd94000 task=cb501a40)
> [681405.781164] Stack: c30785c0 00000020 ccd95d34 c02dcd3b cec7a6c0
> ccd95d54 c02 dcdb7 ccd95f3c
> [681405.781807]        00001620 c30785c0 506c6f85 c30785c0 506c6f85
> ccd95da8 c03 0100a 00000000
> [681405.782448]        c02dc46f caf7d420 ccd95d80 00000001 caf7d46c
> ccd94000 000 00001 00000000
> [681405.783088] Call Trace:
> [681405.783258]  [<c010303a>] show_stack+0x7a/0x90
> [681405.783574]  [<c01031bd>] show_registers+0x14d/0x1c0
> [681405.783915]  [<c01033b4>] die+0xe4/0x170
> [681405.784192]  [<c01037e3>] do_invalid_op+0xa3/0xb0
> [681405.784517]  [<c0102cbf>] error_code+0x2b/0x30
> [681405.785009]  [<c02dcd3b>] kfree_skbmem+0xb/0x20
> [681405.785494]  [<c02dcdb7>] __kfree_skb+0x67/0xf0
> [681405.785978]  [<c030100a>] tcp_recvmsg+0x5fa/0x720
> [681405.786477]  [<c02dc836>] sock_common_recvmsg+0x46/0x60
> [681405.787004]  [<c02d90ed>] sock_recvmsg+0xbd/0xf0
> [681405.787493]  [<c02d9443>] sock_readv_writev+0x83/0x90
> [681405.788009]  [<c02d948b>] sock_readv+0x3b/0x50
> [681405.788487]  [<c0150cb5>] do_readv_writev+0x205/0x230
> [681405.789004]  [<c0150d1d>] vfs_readv+0x3d/0x50
> [681405.789476]  [<c0150dcd>] sys_readv+0x3d/0xa0
> [681405.789947]  [<c0102abb>] sysenter_past_esp+0x54/0x75
> [681405.790461] Code: 8b 86 98 00 00 00 5e c9 e9 7b e9 e5 ff 89 d0 e8
> 44 f7 e5 f f eb d6 89 f0 e8 fb fe ff ff 5b 8b 86 98 00 00 00 5e c9 e9
> 5d e9 e5 ff <0f> 0b 5 7 01 32 ed 35 c0 eb ac 8d 76 00 55 89 e5 53 89
> c3 e8 45
> [681405.857278]  <7>UDP: short packet: From 213.23.1.xxx:11236 2814/33
> to 192.168. 1.7:10600
> 
> 
> On Mar 4, 2005 10:48 PM, Alessandro Suardi <alessandro.suardi@gmail.com> wrote:
> > This is my K7-800, 256MB RAM machine running as
> >  ed2k/bittorrent 24/7 box... metacity died, but the
> >  windows are still alive (and working) so if someone
> >  wants to get more info about it, just ping me...
> > 
> > [root@donkey ~]# cat /proc/version
> > Linux version 2.6.11-rc3-bk8 (asuardi@donkey) (gcc version 3.4.2
> > 20041017 (Red Hat 3.4.2-6.fc3)) #1 Sat Feb 12 00:01:28 CET 2005
> > [root@donkey ~]# lsmod
> > Module                  Size  Used by
> > loop                   15368  -
> > nls_iso8859_1           3840  -
> > parport_pc             29444  -
> > parport                24704  -
> > 8139too                24896  -
> > floppy                 57392  -
> > 
> > From the dmesg ring:
> > 
> > kernel BUG at include/linux/mm.h:343!
> > invalid operand: 0000 [#1]
> > PREEMPT
> > Modules linked in: loop nls_iso8859_1 parport_pc parport 8139too floppy
> > CPU:    0
> > EIP:    0060:[<c02da6a2>]    Not tainted VLI
> > EFLAGS: 00210256   (2.6.11-rc3-bk8)
> > EIP is at skb_release_data+0x92/0xa0
> > eax: 00000000   ebx: 00000000   ecx: cca36f80   edx: c11a97c0
> > esi: c4205f20   edi: c4205f20   ebp: cd149dcc   esp: cd149dc4
> > ds: 007b   es: 007b   ss: 0068
> > Process metacity (pid: 2109, threadinfo=cd148000 task=ce8935d0)
> > Stack: c4205f20 00000000 cd149dd8 c02da6bb c6e9a0c0 cd149df8 c02da737 c5134250
> >        00000000 c4205f20 c5134250 c4205f20 c5134250 cd149e4c c02feba6 00000000
> >        00000040 cc68c454 00000000 00000001 cc68c444 cd148000 00000001 00000000
> > Call Trace:
> >  [<c0102b2a>] show_stack+0x7a/0x90
> >  [<c0102cad>] show_registers+0x14d/0x1c0
> >  [<c0102ea4>] die+0xe4/0x180
> >  [<c01032e3>] do_invalid_op+0xa3/0xb0
> >  [<c01027a7>] error_code+0x2b/0x30
> >  [<c02da6bb>] kfree_skbmem+0xb/0x20
> >  [<c02da737>] __kfree_skb+0x67/0xf0
> >  [<c02feba6>] tcp_recvmsg+0x5f6/0x710
> >  [<c02da1e6>] sock_common_recvmsg+0x46/0x60
> >  [<c02d6bbe>] sock_aio_read+0xee/0x100
> >  [<c014e427>] do_sync_read+0x97/0xf0
> >  [<c014e511>] vfs_read+0x91/0x120
> >  [<c014e7ed>] sys_read+0x3d/0x70
> >  [<c01025a9>] sysenter_past_esp+0x52/0x75
> > Code: c9 e9 03 e5 e5 ff 8d 76 00 5b 5e c9 c3 89 d0 e8 c5 f2 e5 ff eb
> > cf 89 f0 e8 0c ff ff ff 5b 8b 86 98 00 00 00 5e c9 e9 de e4 e5 ff <0f>
> > 0b 57 01 ab c5 35 c0 eb a5 8d 74 26 00 55 89 e5 53 89 c3 e8
>  
> --alessandro
> 
>  "I want to know if it's you I don't trust
>   'cause I damn sure don't trust myself"
> 
>     (Bruce Springsteen, "Brilliant Disguise")
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply

* Re: [0/5] Improvements to the ieee80211 layer
From: Zhu Yi @ 2005-05-26  3:36 UTC (permalink / raw)
  To: Jiri Benc; +Cc: NetDev, jbohac
In-Reply-To: <20050525132055.469f10d7@griffin.suse.cz>

On Wed, 2005-05-25 at 13:20 +0200, Jiri Benc wrote:
> On Wed, 25 May 2005 14:55:16 +0800, Zhu Yi wrote:
> > Do you just clean up current ieee80211 code to still do 802.11 <-> 802.3
> > conversion inside the driver or you plan to handle real 802.11 frames in
> > the stack like this?
> > http://oss.sgi.com/archives/netdev/2005-03/msg01405.html
> 
> We are trying to handle real 802.11 frames. Have you made any progress
> in your work since posting that patch? If so, could you please post it
> to netdev (or to us)?

No much progress since that. I planned to add a new type SOCK_80211 to
PF_PACKET domain, so that user space can send packets through the 80211
stack but don't need to build 802.11 headers themselves. This can be
used by programs like wpa_supplicant. Do you know some better way to do
this?

Thanks,
-yi

^ permalink raw reply

* Re: [PATCH 2/2][NET] rename struct tcp_listen_opt to struct listen_sock
From: Arnaldo Carvalho de Melo @ 2005-05-26  1:26 UTC (permalink / raw)
  To: Ian McDonald; +Cc: David S. Miller, netdev
In-Reply-To: <cbec11ac0505251652657a2dc1@mail.gmail.com>

On 5/25/05, Ian McDonald <imcdnzl@gmail.com> wrote:
> David/Arnaldo,
> 
> 
> On 26/05/05, David S. Miller <davem@davemloft.net> wrote:
> > From: acme@ghostprotocols.net (Arnaldo Carvalho de Melo)
> > Date: Mon, 23 May 2005 22:17:58 -0300
> >
> > > rsync://rsync.kernel.org/pub/scm/linux/kernel/git/acme/net-2.6.13.git
> >
> > Both changes look good, pulled.  It should show up on kernel.org
> > in a little bit.
> >
> >
> Maybe I am looking at the wrong place but when I look at:
> http://kernel.org/git/?p=linux/kernel/git/acme/net-2.6.13.git;a=summary
> 
> it shows non-network related patches in there as well. Is this intentional?

Its because I cloned David's tree that cloned Linus tree that... i.e.
that summary
is of the last changesets, not necessarily mine or commited by me.

^ permalink raw reply

* Re: [PATCH 2/2][NET] rename struct tcp_listen_opt to struct listen_sock
From: Ian McDonald @ 2005-05-25 23:52 UTC (permalink / raw)
  To: David S. Miller; +Cc: acme, netdev
In-Reply-To: <20050525.163716.88475834.davem@davemloft.net>

David/Arnaldo,


On 26/05/05, David S. Miller <davem@davemloft.net> wrote:
> From: acme@ghostprotocols.net (Arnaldo Carvalho de Melo)
> Date: Mon, 23 May 2005 22:17:58 -0300
> 
> > rsync://rsync.kernel.org/pub/scm/linux/kernel/git/acme/net-2.6.13.git
> 
> Both changes look good, pulled.  It should show up on kernel.org
> in a little bit.
> 
> 
Maybe I am looking at the wrong place but when I look at:
http://kernel.org/git/?p=linux/kernel/git/acme/net-2.6.13.git;a=summary

it shows non-network related patches in there as well. Is this intentional?

Ian

^ permalink raw reply

* Re: [PATCH] net/802/tr.c: s/struct rif_cache_s/struct rif_cache/
From: David S. Miller @ 2005-05-25 23:43 UTC (permalink / raw)
  To: adobriyan; +Cc: netdev
In-Reply-To: <200505242148.03588.adobriyan@gmail.com>

From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Tue, 24 May 2005 21:48:03 +0400

> "_s" suffix is certainly of hungarian origin.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

Applied, thanks.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox