Subject: Re: [PATCH net-next v2 1/6] be2net: skip multicast promiscuos setting in already set

From: Sergei Shtylyov <[email-masked]>
Date: Mon, 02 Jun 2014 14:51:22 +0400

Hello.

On 02-06-2014 8:44, Sathya Perla wrote:

>>> From: Kalesh AP <[email-masked]>

>>> 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: Kalesh AP <[email-masked]>
>>> Signed-off-by: Sathya Perla <[email-masked]>

>> [...]

>>> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c
>> b/drivers/net/ethernet/emulex/benet/be_main.c
>>> index e1d445d..9116d5e 100644
>>> --- a/drivers/net/ethernet/emulex/benet/be_main.c
>>> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
>> [...]
>>> @@ -1244,15 +1242,22 @@ static void be_set_rx_mode(struct net_device
>> *netdev)
>>>    	}
>>>
>>>    	status = be_cmd_rx_filter(adapter, IFF_MULTICAST, ON);
>>> -
>>> -	/* Set to MCAST promisc mode if setting MULTICAST address fails */
>>> -	if (status) {
>>> -		dev_info(&adapter->pdev->dev,
>>> -			 "Exhausted multicast HW filters.\n");
>>> -		dev_info(&adapter->pdev->dev,
>>> -			 "Disabling HW multicast filtering.\n");
>>> -		be_cmd_rx_filter(adapter, IFF_ALLMULTI, ON);
>>> +	if (!status) {
>>> +		if (adapter->flags & BE_FLAGS_MCAST_PROMISC)
>>> +			adapter->flags &= ~BE_FLAGS_MCAST_PROMISC;

>>      Why not just clear it without prior check?

> Yes, can be done. But, what is wrong with clearing the flag after the check ?

    More code, and not very justified, IMHO.

WBR, Sergei