linux-stable/drivers/net/ethernet/broadcom/bnx2x
Michal Schmidt a02cc9d3cc bnx2x: allow adding VLANs while interface is down
Since implementing VLAN filtering in commit 05cc5a39dd
("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 <mschmidt@redhat.com>
Acked-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-06-05 23:11:39 -04:00
..
bnx2x.h bnx2x: Add Geneve inner-RSS support 2016-02-16 20:12:16 -05:00
bnx2x_cmn.c bnx2x: don't wait for Tx completion on recovery 2016-03-16 19:23:35 -04:00
bnx2x_cmn.h net: rework setup_tc ndo op to consume general tc operand 2016-02-17 09:47:35 -05:00
bnx2x_dcb.c bnx2x: extend DCBx support 2016-02-16 20:12:16 -05:00
bnx2x_dcb.h bnx2x: Rebrand from 'broadcom' into 'qlogic' 2015-07-22 10:47:26 -07:00
bnx2x_dump.h bnx2x: Rebrand from 'broadcom' into 'qlogic' 2015-07-22 10:47:26 -07:00
bnx2x_ethtool.c bnx2x: Warn about grc timeouts in register dump 2016-02-16 20:12:16 -05:00
bnx2x_fw_defs.h bnx2x: Rebrand from 'broadcom' into 'qlogic' 2015-07-22 10:47:26 -07:00
bnx2x_fw_file_hdr.h bnx2x: Rebrand from 'broadcom' into 'qlogic' 2015-07-22 10:47:26 -07:00
bnx2x_hsi.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
bnx2x_init.h bnx2x: Rebrand from 'broadcom' into 'qlogic' 2015-07-22 10:47:26 -07:00
bnx2x_init_ops.h bnx2x: Rebrand from 'broadcom' into 'qlogic' 2015-07-22 10:47:26 -07:00
bnx2x_link.c bnx2x: Fix 84833 phy command handler 2016-02-21 22:50:55 -05:00
bnx2x_link.h bnx2x: Rebrand from 'broadcom' into 'qlogic' 2015-07-22 10:47:26 -07:00
bnx2x_main.c bnx2x: allow adding VLANs while interface is down 2016-06-05 23:11:39 -04:00
bnx2x_mfw_req.h bnx2x: Rebrand from 'broadcom' into 'qlogic' 2015-07-22 10:47:26 -07:00
bnx2x_reg.h bnx2x: Fix 84833 phy command handler 2016-02-21 22:50:55 -05:00
bnx2x_sp.c bnx2x: byte swap rss_key to comply to Toeplitz specs 2015-09-24 14:34:49 -07:00
bnx2x_sp.h bnx2x: add vlan filtering offload 2015-07-29 23:24:45 -07:00
bnx2x_sriov.c bnx2x: define fields of struct cfc_del_event_data as little-endian 2016-03-02 13:31:56 -05:00
bnx2x_sriov.h bnx2x: Fix compilation when CONFIG_BNX2X_SRIOV is not set 2015-07-30 09:52:18 -07:00
bnx2x_stats.c bnx2x: Rebrand from 'broadcom' into 'qlogic' 2015-07-22 10:47:26 -07:00
bnx2x_stats.h bnx2x: Rebrand from 'broadcom' into 'qlogic' 2015-07-22 10:47:26 -07:00
bnx2x_vfpf.c bnx2x: fix receive of VF->PF mailbox messages by the PF on big-endian 2016-03-02 13:31:56 -05:00
bnx2x_vfpf.h bnx2x: add vlan filtering offload 2015-07-29 23:24:45 -07:00
Makefile