LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Mugunthan V N <mugunthanvnm@ti.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 3.14 53/98] drivers: net: cpsw: fix multicast flush in dual emac mode
Date: Sun, 25 Jan 2015 10:07:11 -0800	[thread overview]
Message-ID: <20150125180715.161310537@linuxfoundation.org> (raw)
In-Reply-To: <20150125180712.859646324@linuxfoundation.org>

3.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mugunthan V N <mugunthanvnm@ti.com>

commit 25906052d953d3fbdb7e19480b9de5e6bb949f3f upstream.

Since ALE table is a common resource for both the interfaces in Dual EMAC
mode and while bringing up the second interface in cpsw_ndo_set_rx_mode()
all the multicast entries added by the first interface is flushed out and
only second interface multicast addresses are added. Fixing this by
flushing multicast addresses based on dual EMAC port vlans which will not
affect the other emac port multicast addresses.

Fixes: d9ba8f9 (driver: net: ethernet: cpsw: dual emac interface implementation)
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/ethernet/ti/cpsw.c     |   11 +++++++++--
 drivers/net/ethernet/ti/cpsw_ale.c |   10 +++++++++-
 drivers/net/ethernet/ti/cpsw_ale.h |    2 +-
 3 files changed, 19 insertions(+), 4 deletions(-)

--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -596,7 +596,7 @@ static void cpsw_set_promiscious(struct
 
 			/* Clear all mcast from ALE */
 			cpsw_ale_flush_multicast(ale, ALE_ALL_PORTS <<
-						 priv->host_port);
+						 priv->host_port, -1);
 
 			/* Flood All Unicast Packets to Host port */
 			cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1);
@@ -620,6 +620,12 @@ static void cpsw_set_promiscious(struct
 static void cpsw_ndo_set_rx_mode(struct net_device *ndev)
 {
 	struct cpsw_priv *priv = netdev_priv(ndev);
+	int vid;
+
+	if (priv->data.dual_emac)
+		vid = priv->slaves[priv->emac_port].port_vlan;
+	else
+		vid = priv->data.default_vlan;
 
 	if (ndev->flags & IFF_PROMISC) {
 		/* Enable promiscuous mode */
@@ -631,7 +637,8 @@ static void cpsw_ndo_set_rx_mode(struct
 	}
 
 	/* Clear all mcast from ALE */
-	cpsw_ale_flush_multicast(priv->ale, ALE_ALL_PORTS << priv->host_port);
+	cpsw_ale_flush_multicast(priv->ale, ALE_ALL_PORTS << priv->host_port,
+				 vid);
 
 	if (!netdev_mc_empty(ndev)) {
 		struct netdev_hw_addr *ha;
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -236,7 +236,7 @@ static void cpsw_ale_flush_mcast(struct
 		cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE);
 }
 
-int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask)
+int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid)
 {
 	u32 ale_entry[ALE_ENTRY_WORDS];
 	int ret, idx;
@@ -247,6 +247,14 @@ int cpsw_ale_flush_multicast(struct cpsw
 		if (ret != ALE_TYPE_ADDR && ret != ALE_TYPE_VLAN_ADDR)
 			continue;
 
+		/* if vid passed is -1 then remove all multicast entry from
+		 * the table irrespective of vlan id, if a valid vlan id is
+		 * passed then remove only multicast added to that vlan id.
+		 * if vlan id doesn't match then move on to next entry.
+		 */
+		if (vid != -1 && cpsw_ale_get_vlan_id(ale_entry) != vid)
+			continue;
+
 		if (cpsw_ale_get_mcast(ale_entry)) {
 			u8 addr[6];
 
--- a/drivers/net/ethernet/ti/cpsw_ale.h
+++ b/drivers/net/ethernet/ti/cpsw_ale.h
@@ -88,7 +88,7 @@ void cpsw_ale_stop(struct cpsw_ale *ale)
 
 int cpsw_ale_set_ageout(struct cpsw_ale *ale, int ageout);
 int cpsw_ale_flush(struct cpsw_ale *ale, int port_mask);
-int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask);
+int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid);
 int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port,
 		       int flags, u16 vid);
 int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port,



  parent reply	other threads:[~2015-01-25 19:17 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-25 18:06 [PATCH 3.14 00/98] 3.14.30-stable review Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 02/98] netlink: Always copy on mmap TX Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 03/98] netlink: Dont reorder loads/stores before marking mmap netlink frame as available Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 04/98] in6: fix conflict with glibc Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 05/98] tg3: tg3_disable_ints using uninitialized mailbox value to disable interrupts Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 07/98] batman-adv: Unify fragment size calculation Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 08/98] batman-adv: avoid NULL dereferences and fix if check Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 09/98] net: Fix stacked vlan offload features computation Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 10/98] net: Reset secmark when scrubbing packet Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 11/98] tcp: Do not apply TSO segment limit to non-TSO packets Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 12/98] alx: fix alx_poll() Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 13/98] team: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 14/98] enic: fix rx skb checksum Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 15/98] net/core: Handle csum for CHECKSUM_COMPLETE VXLAN forwarding Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 16/98] drm/vmwgfx: Fix fence event code Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 17/98] drm/ttm: Avoid memory allocation from shrinker functions Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 18/98] drm/radeon: fix typo in CI dpm disable Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 19/98] drm/radeon: work around a hw bug in MGCG on CIK Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 21/98] drm/radeon: properly filter DP1.2 4k modes on non-DP1.2 hw Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 22/98] drm/i915: Dont complain about stolen conflicts on gen3 Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 23/98] drm/i915: Only warn the first time we attempt to mmio whilst suspended Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 24/98] drm/nv4c/mc: disable msi Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 27/98] ARC: [nsimosci] move peripherals to match model to FPGA Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 28/98] ARC: switch to generic ENTRY/END assembler annotations Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 29/98] cfg80211: dont WARN about two consecutive Country IE hint Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 30/98] cfg80211: avoid mem leak on driver hint set Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 31/98] cfg80211: Fix 160 MHz channels with 80+80 and 160 MHz drivers Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 32/98] hp_accel: Add support for HP ZBook 15 Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 33/98] tick/powerclamp: Remove tick_nohz_idle abuse Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 34/98] genirq: Prevent proc race against freeing of irq descriptors Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 35/98] iscsi-target: Fail connection on short sendmsg writes Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 36/98] Revert "[SCSI] mpt2sas: Remove phys on topology change." Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 37/98] Revert "[SCSI] mpt3sas: Remove phys on topology change" Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 38/98] scsi: blacklist RSOC for Microsoft iSCSI target devices Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 39/98] clk: samsung: Fix double add of syscore ops after driver rebind Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 40/98] clk: Really fix deadlock with mmap_sem Greg Kroah-Hartman
2015-01-26 12:46   ` Luis Henriques
2015-01-26 22:20     ` Greg Kroah-Hartman
2015-01-25 18:06 ` [PATCH 3.14 41/98] clk: Dont try to use a struct clk* after it could have been freed Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 42/98] parisc: fix out-of-register compiler error in ldcw inline assembler function Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 43/98] storvsc: ring buffer failures may result in I/O freeze Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 44/98] net: ethernet: cpsw: fix hangs with interrupts Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 45/98] video/logo: prevent use of logos after they have been freed Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 46/98] [media] smiapp-pll: Correct clock debug prints Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 48/98] [media] smiapp: Take mutex during PLL update in sensor initialisation Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 49/98] [media] sound: simplify au0828 quirk table Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 50/98] [media] sound: Update au0828 quirks table Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 51/98] [media] uvcvideo: Fix destruction order in uvc_delete() Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 52/98] vfio-pci: Fix the check on pci device type in vfio_pci_probe() Greg Kroah-Hartman
2015-01-25 18:07 ` Greg Kroah-Hartman [this message]
2015-01-25 18:07 ` [PATCH 3.14 54/98] ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 55/98] NFSv4.1: Fix client id trunking on Linux Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 56/98] gpiolib: of: Correct error handling in of_get_named_gpiod_flags Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 57/98] gpio: fix memory and reference leaks in gpiochip_add error path Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 58/98] OHCI: add a quirk for ULi M5237 blocking on reset Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 59/98] usb: dwc3: gadget: Fix TRB preparation during SG Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 60/98] usb: dwc3: gadget: Stop TRB preparation after limit is reached Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 61/98] USB: cp210x: fix ID for production CEL MeshConnect USB Stick Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 62/98] USB: cp210x: add IDs for CEL USB sticks and MeshWorks devices Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 63/98] USB: keyspan: fix null-deref at probe Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 64/98] USB: console: fix uninitialised ldisc semaphore Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 65/98] USB: console: fix potential use after free Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 66/98] USB: EHCI: fix initialization bug in iso_stream_schedule() Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 67/98] usb: musb: stuff leak of struct usb_hcd Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 68/98] can: kvaser_usb: Dont free packets when tight on URBs Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 69/98] can: kvaser_usb: Reset all URB tx contexts upon channel close Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 70/98] can: kvaser_usb: Dont send a RESET_CHIP for non-existing channels Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 72/98] Input: I8042 - add Acer Aspire 7738 to the nomux list Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 73/98] ARM: dts: imx25: Fix the SPI1 clocks Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 74/98] ARM: imx6q: drop unnecessary semicolon Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 75/98] ARM: clk-imx6q: fix video divider for rev T0 1.0 Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 76/98] ARM: omap5/dra7xx: Fix frequency typos Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 77/98] ARM: shmobile: sh73a0 legacy: Set .control_parent for all irqpin instances Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 78/98] decompress_bunzip2: off by one in get_next_block() Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 79/98] um: Skip futex_atomic_cmpxchg_inatomic() test Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 80/98] x86, um: actually mark system call tables readonly Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 81/98] LOCKD: Fix a race when initialising nlmsvc_timeout Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 82/98] tcm_loop: Fixup tag handling Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 83/98] tcm_loop: Fix wrong I_T nexus association Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 84/98] vhost-scsi: Add missing virtio-scsi -> TCM attribute conversion Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 85/98] iscsi,iser-target: Initiate termination only once Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 86/98] iser-target: Fix flush + disconnect completion handling Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 87/98] iser-target: Parallelize CM connection establishment Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 88/98] iser-target: Fix connected_handler + teardown flow race Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 89/98] iser-target: Handle ADDR_CHANGE event for listener cm_id Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 90/98] iser-target: Fix implicit termination of connections Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 91/98] bcache: Make sure to pass GFP_WAIT to mempool_alloc() Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 92/98] KVM: nVMX: Disable unrestricted mode if ept=0 Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 93/98] netfilter: ipset: small potential read beyond the end of buffer Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 94/98] net: prevent of emerging cross-namespace symlinks Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 95/98] net: fix creation adjacent device symlinks Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 96/98] fsnotify: next_i is freed during fsnotify_unmount_inodes Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 97/98] s390/3215: fix hanging console issue Greg Kroah-Hartman
2015-01-25 18:07 ` [PATCH 3.14 98/98] s390/3215: fix tty output containing tabs Greg Kroah-Hartman
2015-01-25 21:37 ` [PATCH 3.14 00/98] 3.14.30-stable review Guenter Roeck
2015-01-26 17:43 ` Shuah Khan

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=20150125180715.161310537@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mugunthanvnm@ti.com \
    --cc=stable@vger.kernel.org \
    --subject='Re: [PATCH 3.14 53/98] drivers: net: cpsw: fix multicast flush in dual emac mode' \
    /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

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).