From: George McCollister <george.mccollister@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, mugunthanvnm@ti.com, balbi@ti.com,
lsorense@csclub.uwaterloo.ca, tony@atomide.com,
mpa@pengutronix.de, jhovold@gmail.com, george.cherian@ti.com,
tklauser@distanz.ch,
George McCollister <george.mccollister@gmail.com>
Subject: [PATCH net] drivers: net: cpsw: Set SECURE for dual_emac ucast
Date: Thu, 26 Feb 2015 15:19:30 -0600 [thread overview]
Message-ID: <1424985570-19193-1-git-send-email-george.mccollister@gmail.com> (raw)
Prior to this patch, sending a packet with the source MAC address of one
of the CPSW interfaces to one of the CPSW slave ports while it's configured in
dual_emac mode would update the port_num field of the VLAN/Unicast Address
Table Entry. This would cause it to discard all incoming traffic addressed to
that MAC address, essentially rendering the port useless until the ALE table is
cleared (by starting and stopping the interface or rebooting.)
For example, if eth0 has a MAC address of 90:59:af:8f:43:e9 it will have
an ALE table entry:
00 00 00 00 59 90 02 30 e9 43 8f af
(VLAN Addr vlan_id=2 unicast type=0 port_num=0 addr=90:59:af:8f:43:e9)
If you configure another device with the same MAC address and connect it
to the first CPSW slave port and send some traffic the ALE table entry
becomes:
04 00 00 00 59 90 02 30 e9 43 8f af
(VLAN Addr vlan_id=2 unicast type=0 port_num=1 addr=90:59:af:8f:43:e9)
>From this point forward all incoming traffic addressed to
90:59:af:8f:43:e9 will be dropped.
Setting the SECURE bit for the VLAN/Unicast address table entry for each
interface's MAC address corrects the problem.
Signed-off-by: George McCollister <george.mccollister@gmail.com>
---
drivers/net/ethernet/ti/cpsw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 7d8dd0d..49b0336 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1103,7 +1103,7 @@ static inline void cpsw_add_dual_emac_def_ale_entries(
cpsw_ale_add_mcast(priv->ale, priv->ndev->broadcast,
port_mask, ALE_VLAN, slave->port_vlan, 0);
cpsw_ale_add_ucast(priv->ale, priv->mac_addr,
- priv->host_port, ALE_VLAN, slave->port_vlan);
+ priv->host_port, ALE_VLAN | ALE_SECURE, slave->port_vlan);
}
static void soft_reset_slave(struct cpsw_slave *slave)
--
2.2.2
next reply other threads:[~2015-02-26 21:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-26 21:19 George McCollister [this message]
2015-02-28 19:49 ` [PATCH net] drivers: net: cpsw: Set SECURE for dual_emac ucast David Miller
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=1424985570-19193-1-git-send-email-george.mccollister@gmail.com \
--to=george.mccollister@gmail.com \
--cc=balbi@ti.com \
--cc=davem@davemloft.net \
--cc=george.cherian@ti.com \
--cc=jhovold@gmail.com \
--cc=lsorense@csclub.uwaterloo.ca \
--cc=mpa@pengutronix.de \
--cc=mugunthanvnm@ti.com \
--cc=netdev@vger.kernel.org \
--cc=tklauser@distanz.ch \
--cc=tony@atomide.com \
/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;
as well as URLs for NNTP newsgroup(s).