Subject: [PATCH net 2/2] be2net: Reset multicast promiscuous mode when its enabled

From: Ajit Khaparde <[email-masked]>
Date: Fri, 2 May 2014 14:43:36 -0500

Currently we are resetting the multicast promiscuous mode everytime
we send a multicast list to the FW. It is unnecessary.
With this fix we disable multicast promiscuous mode only when enabled.

Signed-off-by: Ajit Khaparde <[email-masked]>
---
 drivers/net/ethernet/emulex/benet/be_cmds.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index d1ec15a..78888ab 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -1858,9 +1858,11 @@ int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value)
 		/* Reset mcast promisc mode if already set by setting mask
 		 * and not setting flags field
 		 */
-		req->if_flags_mask |=
-			cpu_to_le32(BE_IF_FLAGS_MCAST_PROMISCUOUS &
-				    be_if_cap_flags(adapter));
+		if (adapter->flags & BE_FLAGS_MCAST_PROMISC)
+			req->if_flags_mask |=
+				cpu_to_le32(BE_IF_FLAGS_MCAST_PROMISCUOUS &
+					    be_if_cap_flags(adapter));
+
 		req->mcast_num = cpu_to_le32(netdev_mc_count(adapter->netdev));
 		netdev_for_each_mc_addr(ha, adapter->netdev)
 			memcpy(req->mcast_mac[i++].byte, ha->addr, ETH_ALEN);
-- 
1.8.3.2