Skip to content

Commit cf7fc3a

Browse files
committed
Merge branch 'bnxt_en-fixes'
Michael Chan says: ==================== bnxt_en: Bug fixes. A collection of 5 miscellaneous bug fixes covering VF anti-spoof setup issues, devlink MSIX max value, AER, context memory allocation error path, and VLAN acceleration logic. Please queue for -stable. Thanks. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents c3e302e + c72cb30 commit cf7fc3a

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6642,7 +6642,7 @@ static int bnxt_alloc_ctx_pg_tbls(struct bnxt *bp,
66426642
int rc;
66436643

66446644
if (!mem_size)
6645-
return 0;
6645+
return -EINVAL;
66466646

66476647
ctx_pg->nr_pages = DIV_ROUND_UP(mem_size, BNXT_PAGE_SIZE);
66486648
if (ctx_pg->nr_pages > MAX_CTX_TOTAL_PAGES) {
@@ -9780,6 +9780,7 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
97809780
netdev_features_t features)
97819781
{
97829782
struct bnxt *bp = netdev_priv(dev);
9783+
netdev_features_t vlan_features;
97839784

97849785
if ((features & NETIF_F_NTUPLE) && !bnxt_rfs_capable(bp))
97859786
features &= ~NETIF_F_NTUPLE;
@@ -9796,12 +9797,14 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
97969797
/* Both CTAG and STAG VLAN accelaration on the RX side have to be
97979798
* turned on or off together.
97989799
*/
9799-
if ((features & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) !=
9800-
(NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) {
9800+
vlan_features = features & (NETIF_F_HW_VLAN_CTAG_RX |
9801+
NETIF_F_HW_VLAN_STAG_RX);
9802+
if (vlan_features != (NETIF_F_HW_VLAN_CTAG_RX |
9803+
NETIF_F_HW_VLAN_STAG_RX)) {
98019804
if (dev->features & NETIF_F_HW_VLAN_CTAG_RX)
98029805
features &= ~(NETIF_F_HW_VLAN_CTAG_RX |
98039806
NETIF_F_HW_VLAN_STAG_RX);
9804-
else
9807+
else if (vlan_features)
98059808
features |= NETIF_F_HW_VLAN_CTAG_RX |
98069809
NETIF_F_HW_VLAN_STAG_RX;
98079810
}
@@ -12212,12 +12215,15 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
1221212215
bnxt_ulp_start(bp, err);
1221312216
}
1221412217

12215-
if (result != PCI_ERS_RESULT_RECOVERED && netif_running(netdev))
12216-
dev_close(netdev);
12218+
if (result != PCI_ERS_RESULT_RECOVERED) {
12219+
if (netif_running(netdev))
12220+
dev_close(netdev);
12221+
pci_disable_device(pdev);
12222+
}
1221712223

1221812224
rtnl_unlock();
1221912225

12220-
return PCI_ERS_RESULT_RECOVERED;
12226+
return result;
1222112227
}
1222212228

1222312229
/**

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,6 @@ struct bnxt_vf_info {
10661066
#define BNXT_VF_LINK_FORCED 0x4
10671067
#define BNXT_VF_LINK_UP 0x8
10681068
#define BNXT_VF_TRUST 0x10
1069-
u32 func_flags; /* func cfg flags */
10701069
u32 min_tx_rate;
10711070
u32 max_tx_rate;
10721071
void *hwrm_cmd_req_addr;

drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static inline void bnxt_link_bp_to_dl(struct bnxt *bp, struct devlink *dl)
4343
#define BNXT_NVM_CFG_VER_BITS 24
4444
#define BNXT_NVM_CFG_VER_BYTES 4
4545

46-
#define BNXT_MSIX_VEC_MAX 1280
46+
#define BNXT_MSIX_VEC_MAX 512
4747
#define BNXT_MSIX_VEC_MIN_MAX 128
4848

4949
enum bnxt_nvm_dir_type {

drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,10 @@ int bnxt_set_vf_spoofchk(struct net_device *dev, int vf_id, bool setting)
8585
if (old_setting == setting)
8686
return 0;
8787

88-
func_flags = vf->func_flags;
8988
if (setting)
90-
func_flags |= FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE;
89+
func_flags = FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_ENABLE;
9190
else
92-
func_flags |= FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE;
91+
func_flags = FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK_DISABLE;
9392
/*TODO: if the driver supports VLAN filter on guest VLAN,
9493
* the spoof check should also include vlan anti-spoofing
9594
*/
@@ -98,7 +97,6 @@ int bnxt_set_vf_spoofchk(struct net_device *dev, int vf_id, bool setting)
9897
req.flags = cpu_to_le32(func_flags);
9998
rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
10099
if (!rc) {
101-
vf->func_flags = func_flags;
102100
if (setting)
103101
vf->flags |= BNXT_VF_SPOOFCHK;
104102
else
@@ -228,7 +226,6 @@ int bnxt_set_vf_mac(struct net_device *dev, int vf_id, u8 *mac)
228226
memcpy(vf->mac_addr, mac, ETH_ALEN);
229227
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1);
230228
req.fid = cpu_to_le16(vf->fw_fid);
231-
req.flags = cpu_to_le32(vf->func_flags);
232229
req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR);
233230
memcpy(req.dflt_mac_addr, mac, ETH_ALEN);
234231
return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
@@ -266,7 +263,6 @@ int bnxt_set_vf_vlan(struct net_device *dev, int vf_id, u16 vlan_id, u8 qos,
266263

267264
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1);
268265
req.fid = cpu_to_le16(vf->fw_fid);
269-
req.flags = cpu_to_le32(vf->func_flags);
270266
req.dflt_vlan = cpu_to_le16(vlan_tag);
271267
req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_VLAN);
272268
rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
@@ -305,7 +301,6 @@ int bnxt_set_vf_bw(struct net_device *dev, int vf_id, int min_tx_rate,
305301
return 0;
306302
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1);
307303
req.fid = cpu_to_le16(vf->fw_fid);
308-
req.flags = cpu_to_le32(vf->func_flags);
309304
req.enables = cpu_to_le32(FUNC_CFG_REQ_ENABLES_MAX_BW);
310305
req.max_bw = cpu_to_le32(max_tx_rate);
311306
req.enables |= cpu_to_le32(FUNC_CFG_REQ_ENABLES_MIN_BW);
@@ -477,7 +472,6 @@ static void __bnxt_set_vf_params(struct bnxt *bp, int vf_id)
477472
vf = &bp->pf.vf[vf_id];
478473
bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_FUNC_CFG, -1, -1);
479474
req.fid = cpu_to_le16(vf->fw_fid);
480-
req.flags = cpu_to_le32(vf->func_flags);
481475

482476
if (is_valid_ether_addr(vf->mac_addr)) {
483477
req.enables |= cpu_to_le32(FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR);

0 commit comments

Comments
 (0)