RE: [PATCH 2.6.24 1/1]S2io: Support for add/delete/store/restore ethernet addresses

Previous thread: [PATCH 2.6.24 1/1]S2io: Fixed memory leak by freeing MSI-X local entry memories when vector allocation fails by Sreenivasa Honnur on Wednesday, November 14, 2007 - 2:29 am. (5 messages)

Next thread: Fix net-2.6.25 compiler error by Patrick McHardy on Wednesday, November 14, 2007 - 2:52 am. (2 messages)
From: Sreenivasa Honnur
Date: Wednesday, November 14, 2007 - 2:30 am

- Support to add/delete/store/restore 64 and 128 Ethernet addresses for Xframe I and Xframe II respectively.

- (Resubmit third time)

Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
---
diff -Nurp org/drivers/net/s2io.c patch1/drivers/net/s2io.c
--- org/drivers/net/s2io.c	2007-11-13 00:22:13.000000000 +0530
+++ patch1/drivers/net/s2io.c	2007-11-13 03:31:29.000000000 +0530
@@ -84,7 +84,7 @@
 #include "s2io.h"
 #include "s2io-regs.h"
 
-#define DRV_VERSION "2.0.26.6"
+#define DRV_VERSION "2.0.26.7"
 
 /* S2io Driver name & version. */
 static char s2io_driver_name[] = "Neterion";
@@ -3365,6 +3365,9 @@ static void s2io_reset(struct s2io_nic *
 	/* Set swapper to enable I/O register access */
 	s2io_set_swapper(sp);
 
+	/* restore mac_addr entries */
+	do_s2io_restore_unicast_mc(sp);
+
 	/* Restore the MSIX table entries from local variables */
 	restore_xmsi_data(sp);
 
@@ -3423,9 +3426,6 @@ static void s2io_reset(struct s2io_nic *
 		writeq(val64, &bar0->pcc_err_reg);
 	}
 
-	/* restore the previously assigned mac address */
-	do_s2io_prog_unicast(sp->dev, (u8 *)&sp->def_mac_addr[0].mac_addr);
-
 	sp->device_enabled_once = FALSE;
 }
 
@@ -3913,8 +3913,19 @@ hw_init_failed:
 static int s2io_close(struct net_device *dev)
 {
 	struct s2io_nic *sp = dev->priv;
+	struct config_param *config = &sp->config;
+	u64 tmp64;
+	int offset;
 
 	netif_stop_queue(dev);
+
+	/* delete all populated mac entries */
+	for (offset = 1; offset < config->max_mc_addr; offset++) {
+		tmp64 = do_s2io_read_unicast_mc(sp, offset);
+		if (tmp64 != S2IO_DISABLE_MAC_ENTRY)
+			do_s2io_delete_unicast_mc(sp, tmp64);
+	}
+
 	napi_disable(&sp->napi);
 	/* Reset card, kill tasklet and free Tx and Rx buffers. */
 	s2io_card_down(sp);
@@ -4716,8 +4727,9 @@ static void s2io_set_multicast(struct ne
 	struct XENA_dev_config __iomem *bar0 = sp->bar0;
 	u64 val64 = 0, multi_mac = 0x010203040506ULL, mask =
 	    0xfeffffffffffULL;
-	u64 dis_addr = 0xffffffffffffULL, mac_addr ...
From: David Miller
Date: Wednesday, November 14, 2007 - 2:43 am

From: Sreenivasa Honnur <Sreenivasa.Honnur@neterion.com>

No, this is a feature patch, so I'm not going to queue this
up for 2.6.24, that is not appropriate at all.

Instead I've added this patch to netdev-2.6 which will
schedule it for the 2.6.25 merge window.

I had to remove the DRV_VERSION part of your changes as
a result.

Thanks.
-

From: Ramkrishna Vepa
Date: Wednesday, November 14, 2007 - 9:47 am

Scheduling for the 2.6.25 merge window is fine. Curious - why did you
have to remove the driver version? We use it to keep track of our
changes submitted.

Thanks,
-

From: David Miller
Date: Wednesday, November 14, 2007 - 1:03 pm

From: "Ramkrishna Vepa" <Ramkrishna.Vepa@neterion.com>

Because it conflicted with the driver version bump you did
for the MSI-X leak bug fix.
-

From: Ramkrishna Vepa
Date: Wednesday, November 14, 2007 - 1:57 pm

> > Scheduling for the 2.6.25 merge window is fine. Curious - why did

[Ram] The version numbers are different for the 2 patches. Was the MSI-X
leak bug fix applied prior to resubmission (we had swapped the version
numbers on the patches for resubmission).

[PATCH 2.6.24 1/1]S2io: Fixed memory leak by freeing MSI-X local entry
memories when vector allocation fails 
+#define DRV_VERSION "2.0.26.6"

[PATCH 2.6.24 1/1]S2io: Support for add/delete/store/restore ethernet
addresses 
+#define DRV_VERSION "2.0.26.7"

Ram
-

From: David Miller
Date: Wednesday, November 14, 2007 - 3:55 pm

From: "Ramkrishna Vepa" <Ramkrishna.Vepa@neterion.com>

I applied only the leak fix to the stable branch, and only
the ethernet address support patch to the 2.6.25 development
tree.

The bug fix will show up later when the 2.6.25 development
tree gets rebased to upstream (which will have the leak
fix by then).

This is how I do things, and that's why changing the DRV_VERSION
to 2.0.26.7 made no sense.

Therefore it makes the most sense to bump driver version numbers
only when things are entirely self contained.


-

From: Ramkrishna Vepa
Date: Wednesday, November 14, 2007 - 4:08 pm

Got it. Thanks,


-

From: Jeff Garzik
Date: Friday, November 23, 2007 - 8:03 pm

patch does not apply to linux upstream (2.6.24-rc) nor netdev-2.6#upstream


-

Previous thread: [PATCH 2.6.24 1/1]S2io: Fixed memory leak by freeing MSI-X local entry memories when vector allocation fails by Sreenivasa Honnur on Wednesday, November 14, 2007 - 2:29 am. (5 messages)

Next thread: Fix net-2.6.25 compiler error by Patrick McHardy on Wednesday, November 14, 2007 - 2:52 am. (2 messages)