All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] skge: fix transmitter flow control
@ 2007-02-23 22:03 Stephen Hemminger
  2007-02-23 22:04 ` [PATCH 2/2] skge: comma consistency Stephen Hemminger
  2007-02-27  9:17 ` [PATCH 1/2] skge: fix transmitter flow control Jeff Garzik
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Hemminger @ 2007-02-23 22:03 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

It looks like the skge driver inherited another bug from the sk98lin code.
If I send from 1000mbit port to a machine on 100mbit port, the switch should
be doing hardware flow control, but no pause frames show up in the statistics.

This is the analog of the recent sky2 fixes. The device needs to listen
for multicast pause frames and then not discard them.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
 drivers/net/skge.c |   43 ++++++++++++++++++++++++++++++++-----------
 drivers/net/skge.h |    3 +--
 2 files changed, 33 insertions(+), 13 deletions(-)

--- sky2-dev.orig/drivers/net/skge.c	2007-02-23 13:17:25.000000000 -0800
+++ sky2-dev/drivers/net/skge.c	2007-02-23 13:53:05.000000000 -0800
@@ -2767,6 +2767,17 @@
 	return err;
 }
 
+static const u8 pause_mc_addr[ETH_ALEN] = { 0x1, 0x80, 0xc2, 0x0, 0x0, 0x1 };
+
+static void genesis_add_filter(u8 filter[8], const u8 *addr)
+{
+	u32 crc, bit;
+
+	crc = ether_crc_le(ETH_ALEN, addr);
+	bit = ~crc & 0x3f;
+	filter[bit/8] |= 1 << (bit%8);
+}
+
 static void genesis_set_multicast(struct net_device *dev)
 {
 	struct skge_port *skge = netdev_priv(dev);
@@ -2788,24 +2799,33 @@
 		memset(filter, 0xff, sizeof(filter));
 	else {
 		memset(filter, 0, sizeof(filter));
-		for (i = 0; list && i < count; i++, list = list->next) {
-			u32 crc, bit;
-			crc = ether_crc_le(ETH_ALEN, list->dmi_addr);
-			bit = ~crc & 0x3f;
-			filter[bit/8] |= 1 << (bit%8);
-		}
+
+		if (skge->flow_status == FLOW_STAT_REM_SEND
+		    || skge->flow_status == FLOW_STAT_SYMMETRIC)
+			genesis_add_filter(filter, pause_mc_addr);
+
+		for (i = 0; list && i < count; i++, list = list->next)
+			genesis_add_filter(filter, list->dmi_addr);
 	}
 
 	xm_write32(hw, port, XM_MODE, mode);
 	xm_outhash(hw, port, XM_HSM, filter);
 }
 
+static void yukon_add_filter(u8 filter[8], const u8 *addr)
+{
+	 u32 bit = ether_crc(ETH_ALEN, addr) & 0x3f;
+	 filter[bit/8] |= 1 << (bit%8);
+}
+
 static void yukon_set_multicast(struct net_device *dev)
 {
 	struct skge_port *skge = netdev_priv(dev);
 	struct skge_hw *hw = skge->hw;
 	int port = skge->port;
 	struct dev_mc_list *list = dev->mc_list;
+	int rx_pause = (skge->flow_status == FLOW_STAT_REM_SEND
+			|| skge->flow_status == FLOW_STAT_SYMMETRIC);
 	u16 reg;
 	u8 filter[8];
 
@@ -2818,16 +2838,17 @@
 		reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
 	else if (dev->flags & IFF_ALLMULTI)	/* all multicast */
 		memset(filter, 0xff, sizeof(filter));
-	else if (dev->mc_count == 0)		/* no multicast */
+	else if (dev->mc_count == 0 && !rx_pause)/* no multicast */
 		reg &= ~GM_RXCR_MCF_ENA;
 	else {
 		int i;
 		reg |= GM_RXCR_MCF_ENA;
 
-		for (i = 0; list && i < dev->mc_count; i++, list = list->next) {
-			u32 bit = ether_crc(ETH_ALEN, list->dmi_addr) & 0x3f;
-			filter[bit/8] |= 1 << (bit%8);
-		}
+		if (rx_pause)
+			yukon_add_filter(filter, pause_mc_addr);
+
+		for (i = 0; list && i < dev->mc_count; i++, list = list->next)
+			yukon_add_filter(filter, list->dmi_addr);
 	}
 
 
--- sky2-dev.orig/drivers/net/skge.h	2007-02-23 13:30:36.000000000 -0800
+++ sky2-dev/drivers/net/skge.h	2007-02-23 13:31:11.000000000 -0800
@@ -1849,8 +1849,7 @@
 			  GMR_FS_JABBER,
 /* Rx GMAC FIFO Flush Mask (default) */
 	RX_FF_FL_DEF_MSK = GMR_FS_CRC_ERR | GMR_FS_RX_FF_OV |GMR_FS_MII_ERR |
-			   GMR_FS_BAD_FC | GMR_FS_GOOD_FC | GMR_FS_UN_SIZE |
-			   GMR_FS_JABBER,
+			   GMR_FS_BAD_FC |  GMR_FS_UN_SIZE | GMR_FS_JABBER,
 };
 
 /*	RX_GMF_CTRL_T	32 bit	Rx GMAC FIFO Control/Test */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] skge: comma consistency
  2007-02-23 22:03 [PATCH 1/2] skge: fix transmitter flow control Stephen Hemminger
@ 2007-02-23 22:04 ` Stephen Hemminger
  2007-02-27  9:17 ` [PATCH 1/2] skge: fix transmitter flow control Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2007-02-23 22:04 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

Use comma's consistently.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
---
 drivers/net/skge.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- sky2-dev.orig/drivers/net/skge.c	2007-02-23 13:53:25.000000000 -0800
+++ sky2-dev/drivers/net/skge.c	2007-02-23 13:53:41.000000000 -0800
@@ -77,13 +77,13 @@
 	{ PCI_DEVICE(PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940B) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T), },
+	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) },	/* DGE-530T */
 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */
 	{ PCI_DEVICE(PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1064) },
-	{ PCI_VENDOR_ID_LINKSYS, 0x1032, PCI_ANY_ID, 0x0015, },
+	{ PCI_VENDOR_ID_LINKSYS, 0x1032, PCI_ANY_ID, 0x0015 },
 	{ 0 }
 };
 MODULE_DEVICE_TABLE(pci, skge_id_table);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] skge: fix transmitter flow control
  2007-02-23 22:03 [PATCH 1/2] skge: fix transmitter flow control Stephen Hemminger
  2007-02-23 22:04 ` [PATCH 2/2] skge: comma consistency Stephen Hemminger
@ 2007-02-27  9:17 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2007-02-27  9:17 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Stephen Hemminger wrote:
> It looks like the skge driver inherited another bug from the sk98lin code.
> If I send from 1000mbit port to a machine on 100mbit port, the switch should
> be doing hardware flow control, but no pause frames show up in the statistics.
> 
> This is the analog of the recent sky2 fixes. The device needs to listen
> for multicast pause frames and then not discard them.
> 
> Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
> 
> ---
>  drivers/net/skge.c |   43 ++++++++++++++++++++++++++++++++-----------
>  drivers/net/skge.h |    3 +--
>  2 files changed, 33 insertions(+), 13 deletions(-)

applied



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-27  9:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-23 22:03 [PATCH 1/2] skge: fix transmitter flow control Stephen Hemminger
2007-02-23 22:04 ` [PATCH 2/2] skge: comma consistency Stephen Hemminger
2007-02-27  9:17 ` [PATCH 1/2] skge: fix transmitter flow control Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.