Re: [PATCH net] bnx2x: allow adding VLANs while interface is down

2016-06-05 Thread David Miller
From: Michal Schmidt 
Date: Fri,  3 Jun 2016 15:32:18 +0200

> Since implementing VLAN filtering in commit 05cc5a39ddb74
> ("bnx2x: add vlan filtering offload") bnx2x refuses to add a VLAN while
> the interface is down:
> 
>   # ip link add link enp3s0f0 enp3s0f0_10 type vlan id 10
>   RTNETLINK answers: Bad address
> 
> and in dmesg (with bnx2x.debug=0x20):
>   bnx2x: [bnx2x_vlan_rx_add_vid:12941(enp3s0f0)]Ignoring VLAN
>   configuration the interface is down
> 
> Other drivers have no problem with this.
> Fix this peculiar behavior in the following way:
>  - Accept requests to add/kill VID regardless of the device state.
>Maintain the requested list of VIDs in the bp->vlan_reg list.
>  - If the device is up, try to configure the VID list into the hardware.
>If we run out of VLAN credits or encounter a failure configuring an
>entry, fall back to accepting all VLANs.
>If we successfully configure all entries from the list, turn the
>fallback off.
>  - Use the same code for reconfiguring VLANs during NIC load.
> 
> Signed-off-by: Michal Schmidt 

Applied, thanks.


RE: [PATCH net] bnx2x: allow adding VLANs while interface is down

2016-06-05 Thread Yuval Mintz
> > Since implementing VLAN filtering in commit 05cc5a39ddb74
> > ("bnx2x: add vlan filtering offload") bnx2x refuses to add a VLAN
> > while the interface is down.
> 
> Hi Michal - thanks; I'll review this one on Sunday.

I'm a bit worried about the fact we're hiding actual issues -
E.g., if for some [unexpected] reason a vlan configuration ramrod would
fail, the only effect it will have is that we'll try [and probably fail] to
change HW into any-vlan mode; We won't propagate the error back to
caller.

Having written that, since we can't really avoid this in some scenarios
 [I.e., if we accept the command while down and configure it later while
up we can't do anything with an error if it occurs], I guess that's the pros
out-weight the cons here.

Thanks.

Acked-by: Yuval Mintz 


RE: [PATCH net] bnx2x: allow adding VLANs while interface is down

2016-06-03 Thread Yuval Mintz
> Since implementing VLAN filtering in commit 05cc5a39ddb74
> ("bnx2x: add vlan filtering offload") bnx2x refuses to add a VLAN while the
> interface is down.

Hi Michal - thanks; I'll review this one on Sunday.