From: Stephen Hemminger <shemminger@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH 1/2] sky2: multicast pause frame receive
Date: Mon, 16 Oct 2006 13:50:03 -0700 [thread overview]
Message-ID: <20061016135003.5698e718@freekitty> (raw)
In-Reply-To: <20061011212311.715010657@osdl.org>
When using flow control, the PHY needs to accept multicast pause frames.
Without this fix, these frames were getting discarded by the PHY before
doing any flow control.
This maybe related to http://bugzilla.kernel.org/show_bug.cgi?id=6839
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
---
drivers/net/sky2.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
--- sky2.orig/drivers/net/sky2.c 2006-10-16 08:38:24.000000000 -0700
+++ sky2/drivers/net/sky2.c 2006-10-16 09:48:28.000000000 -0700
@@ -2850,6 +2850,14 @@
return 0;
}
+static void inline sky2_add_filter(u8 filter[8], const u8 *addr)
+{
+ u32 bit;
+
+ bit = ether_crc(ETH_ALEN, addr) & 63;
+ filter[bit >> 3] |= 1 << (bit & 7);
+}
+
static void sky2_set_multicast(struct net_device *dev)
{
struct sky2_port *sky2 = netdev_priv(dev);
@@ -2858,7 +2866,10 @@
struct dev_mc_list *list = dev->mc_list;
u16 reg;
u8 filter[8];
+ int rx_pause;
+ static const u8 pause_mc_addr[ETH_ALEN] = { 0x1, 0x80, 0xc2, 0x0, 0x0, 0x1 };
+ rx_pause = (sky2->flow_status == FC_RX || sky2->flow_status == FC_BOTH);
memset(filter, 0, sizeof(filter));
reg = gma_read16(hw, port, GM_RX_CTRL);
@@ -2866,18 +2877,19 @@
if (dev->flags & IFF_PROMISC) /* promiscuous */
reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA);
- else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > 16) /* all multicast */
+ else if (dev->flags & IFF_ALLMULTI)
memset(filter, 0xff, sizeof(filter));
- else if (dev->mc_count == 0) /* no multicast */
+ else if (dev->mc_count == 0 && !rx_pause)
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)
+ sky2_add_filter(filter, pause_mc_addr);
+
+ for (i = 0; list && i < dev->mc_count; i++, list = list->next)
+ sky2_add_filter(filter, list->dmi_addr);
}
gma_write16(hw, port, GM_MC_ADDR_H1,
next prev parent reply other threads:[~2006-10-16 22:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-11 21:22 [PATCH 00/10] sky2: version 1.9 patches Stephen Hemminger
2006-10-11 21:22 ` [PATCH 01/10] sky2: MSI test is only a warning Stephen Hemminger
2006-10-11 21:22 ` [PATCH 02/10] sky2: turn of workaround timer Stephen Hemminger
2006-10-11 21:22 ` [PATCH 03/10] sky2: phy irq on shutdown Stephen Hemminger
2006-10-11 21:22 ` [PATCH 04/10] sky2: fiber pause bits Stephen Hemminger
2006-10-11 21:22 ` [PATCH 05/10] sky2: advertising register 16 bits Stephen Hemminger
2006-10-11 21:22 ` [PATCH 06/10] sky2: use duplex result bits Stephen Hemminger
2006-10-11 21:22 ` [PATCH 07/10] sky2: dont reset PHY twice Stephen Hemminger
2006-10-11 21:22 ` [PATCH 08/10] sky2: flow control setting fixes Stephen Hemminger
2006-10-11 21:22 ` [PATCH 09/10] sky2: no message on rx fifo overflow Stephen Hemminger
2006-10-11 21:22 ` [PATCH 10/10] sky2: version 1.9 Stephen Hemminger
2006-10-16 20:50 ` Stephen Hemminger [this message]
2006-10-16 20:52 ` [PATCH 2/2] sky2: don't process pause frames in recveiver Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061016135003.5698e718@freekitty \
--to=shemminger@osdl.org \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox