Commit a0794885 authored by Kalesh AP's avatar Kalesh AP Committed by David S. Miller

be2net: skip multicast promiscuos setting in already set

Set mc-promisc (multicast promiscuous) mode on an interface, only if it is
*not already* in that mode.

Also removed logs that report interface being set to multicast
promiscous mode. In an earlier comment on the netdev list such log messages
were deemed unnecessary as this behaviour is common across most of the
ethernet drivers.
Signed-off-by: default avatarKalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4d1cdf1d
...@@ -374,6 +374,7 @@ enum vf_state { ...@@ -374,6 +374,7 @@ enum vf_state {
#define BE_FLAGS_LINK_STATUS_INIT 1 #define BE_FLAGS_LINK_STATUS_INIT 1
#define BE_FLAGS_WORKER_SCHEDULED (1 << 3) #define BE_FLAGS_WORKER_SCHEDULED (1 << 3)
#define BE_FLAGS_VLAN_PROMISC (1 << 4) #define BE_FLAGS_VLAN_PROMISC (1 << 4)
#define BE_FLAGS_MCAST_PROMISC (1 << 5)
#define BE_FLAGS_NAPI_ENABLED (1 << 9) #define BE_FLAGS_NAPI_ENABLED (1 << 9)
#define BE_FLAGS_QNQ_ASYNC_EVT_RCVD (1 << 11) #define BE_FLAGS_QNQ_ASYNC_EVT_RCVD (1 << 11)
#define BE_FLAGS_VXLAN_OFFLOADS (1 << 12) #define BE_FLAGS_VXLAN_OFFLOADS (1 << 12)
......
...@@ -1190,7 +1190,7 @@ static int be_vlan_rem_vid(struct net_device *netdev, __be16 proto, u16 vid) ...@@ -1190,7 +1190,7 @@ static int be_vlan_rem_vid(struct net_device *netdev, __be16 proto, u16 vid)
static void be_clear_promisc(struct be_adapter *adapter) static void be_clear_promisc(struct be_adapter *adapter)
{ {
adapter->promiscuous = false; adapter->promiscuous = false;
adapter->flags &= ~BE_FLAGS_VLAN_PROMISC; adapter->flags &= ~(BE_FLAGS_VLAN_PROMISC | BE_FLAGS_MCAST_PROMISC);
be_cmd_rx_filter(adapter, IFF_PROMISC, OFF); be_cmd_rx_filter(adapter, IFF_PROMISC, OFF);
} }
...@@ -1215,10 +1215,8 @@ static void be_set_rx_mode(struct net_device *netdev) ...@@ -1215,10 +1215,8 @@ static void be_set_rx_mode(struct net_device *netdev)
/* Enable multicast promisc if num configured exceeds what we support */ /* Enable multicast promisc if num configured exceeds what we support */
if (netdev->flags & IFF_ALLMULTI || if (netdev->flags & IFF_ALLMULTI ||
netdev_mc_count(netdev) > be_max_mc(adapter)) { netdev_mc_count(netdev) > be_max_mc(adapter))
be_cmd_rx_filter(adapter, IFF_ALLMULTI, ON); goto set_mcast_promisc;
goto done;
}
if (netdev_uc_count(netdev) != adapter->uc_macs) { if (netdev_uc_count(netdev) != adapter->uc_macs) {
struct netdev_hw_addr *ha; struct netdev_hw_addr *ha;
...@@ -1244,15 +1242,22 @@ static void be_set_rx_mode(struct net_device *netdev) ...@@ -1244,15 +1242,22 @@ static void be_set_rx_mode(struct net_device *netdev)
} }
status = be_cmd_rx_filter(adapter, IFF_MULTICAST, ON); status = be_cmd_rx_filter(adapter, IFF_MULTICAST, ON);
if (!status) {
/* Set to MCAST promisc mode if setting MULTICAST address fails */ if (adapter->flags & BE_FLAGS_MCAST_PROMISC)
if (status) { adapter->flags &= ~BE_FLAGS_MCAST_PROMISC;
dev_info(&adapter->pdev->dev, goto done;
"Exhausted multicast HW filters.\n");
dev_info(&adapter->pdev->dev,
"Disabling HW multicast filtering.\n");
be_cmd_rx_filter(adapter, IFF_ALLMULTI, ON);
} }
set_mcast_promisc:
if (adapter->flags & BE_FLAGS_MCAST_PROMISC)
return;
/* Set to MCAST promisc mode if setting MULTICAST address fails
* or if num configured exceeds what we support
*/
status = be_cmd_rx_filter(adapter, IFF_ALLMULTI, ON);
if (!status)
adapter->flags |= BE_FLAGS_MCAST_PROMISC;
done: done:
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment