Skip to content

Commit e02d9c4

Browse files
committed
Merge branch 'bnxt_en-fixes'
Michael Chan says: ==================== bnxt_en: Bug fixes. 3 small bug fix patches. The 1st two are aRFS fixes and the last one fixes a fatal driver load failure on some kernels without PCIe extended config space support enabled. Please also queue these for -stable. Thanks. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 5a9ef19 + d061b24 commit e02d9c4

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

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

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11065,11 +11065,23 @@ static bool bnxt_fltr_match(struct bnxt_ntuple_filter *f1,
1106511065
struct flow_keys *keys1 = &f1->fkeys;
1106611066
struct flow_keys *keys2 = &f2->fkeys;
1106711067

11068-
if (keys1->addrs.v4addrs.src == keys2->addrs.v4addrs.src &&
11069-
keys1->addrs.v4addrs.dst == keys2->addrs.v4addrs.dst &&
11070-
keys1->ports.ports == keys2->ports.ports &&
11071-
keys1->basic.ip_proto == keys2->basic.ip_proto &&
11072-
keys1->basic.n_proto == keys2->basic.n_proto &&
11068+
if (keys1->basic.n_proto != keys2->basic.n_proto ||
11069+
keys1->basic.ip_proto != keys2->basic.ip_proto)
11070+
return false;
11071+
11072+
if (keys1->basic.n_proto == htons(ETH_P_IP)) {
11073+
if (keys1->addrs.v4addrs.src != keys2->addrs.v4addrs.src ||
11074+
keys1->addrs.v4addrs.dst != keys2->addrs.v4addrs.dst)
11075+
return false;
11076+
} else {
11077+
if (memcmp(&keys1->addrs.v6addrs.src, &keys2->addrs.v6addrs.src,
11078+
sizeof(keys1->addrs.v6addrs.src)) ||
11079+
memcmp(&keys1->addrs.v6addrs.dst, &keys2->addrs.v6addrs.dst,
11080+
sizeof(keys1->addrs.v6addrs.dst)))
11081+
return false;
11082+
}
11083+
11084+
if (keys1->ports.ports == keys2->ports.ports &&
1107311085
keys1->control.flags == keys2->control.flags &&
1107411086
ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) &&
1107511087
ether_addr_equal(f1->dst_mac_addr, f2->dst_mac_addr))
@@ -11361,7 +11373,7 @@ int bnxt_get_port_parent_id(struct net_device *dev,
1136111373
return -EOPNOTSUPP;
1136211374

1136311375
/* The PF and it's VF-reps only support the switchdev framework */
11364-
if (!BNXT_PF(bp))
11376+
if (!BNXT_PF(bp) || !(bp->flags & BNXT_FLAG_DSN_VALID))
1136511377
return -EOPNOTSUPP;
1136611378

1136711379
ppid->id_len = sizeof(bp->switch_id);
@@ -11734,6 +11746,7 @@ static int bnxt_pcie_dsn_get(struct bnxt *bp, u8 dsn[])
1173411746
put_unaligned_le32(dw, &dsn[0]);
1173511747
pci_read_config_dword(pdev, pos + 4, &dw);
1173611748
put_unaligned_le32(dw, &dsn[4]);
11749+
bp->flags |= BNXT_FLAG_DSN_VALID;
1173711750
return 0;
1173811751
}
1173911752

@@ -11845,9 +11858,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1184511858

1184611859
if (BNXT_PF(bp)) {
1184711860
/* Read the adapter's DSN to use as the eswitch switch_id */
11848-
rc = bnxt_pcie_dsn_get(bp, bp->switch_id);
11849-
if (rc)
11850-
goto init_err_pci_clean;
11861+
bnxt_pcie_dsn_get(bp, bp->switch_id);
1185111862
}
1185211863

1185311864
/* MTU range: 60 - FW defined max */

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,7 @@ struct bnxt {
15321532
#define BNXT_FLAG_NO_AGG_RINGS 0x20000
15331533
#define BNXT_FLAG_RX_PAGE_MODE 0x40000
15341534
#define BNXT_FLAG_MULTI_HOST 0x100000
1535+
#define BNXT_FLAG_DSN_VALID 0x200000
15351536
#define BNXT_FLAG_DOUBLE_DB 0x400000
15361537
#define BNXT_FLAG_CHIP_NITRO_A0 0x1000000
15371538
#define BNXT_FLAG_DIM 0x2000000
@@ -1936,9 +1937,6 @@ static inline bool bnxt_cfa_hwrm_message(u16 req_type)
19361937
case HWRM_CFA_ENCAP_RECORD_FREE:
19371938
case HWRM_CFA_DECAP_FILTER_ALLOC:
19381939
case HWRM_CFA_DECAP_FILTER_FREE:
1939-
case HWRM_CFA_NTUPLE_FILTER_ALLOC:
1940-
case HWRM_CFA_NTUPLE_FILTER_FREE:
1941-
case HWRM_CFA_NTUPLE_FILTER_CFG:
19421940
case HWRM_CFA_EM_FLOW_ALLOC:
19431941
case HWRM_CFA_EM_FLOW_FREE:
19441942
case HWRM_CFA_EM_FLOW_CFG:

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ static int bnxt_vf_reps_create(struct bnxt *bp)
398398
struct net_device *dev;
399399
int rc, i;
400400

401+
if (!(bp->flags & BNXT_FLAG_DSN_VALID))
402+
return -ENODEV;
403+
401404
bp->vf_reps = kcalloc(num_vfs, sizeof(vf_rep), GFP_KERNEL);
402405
if (!bp->vf_reps)
403406
return -ENOMEM;

0 commit comments

Comments
 (0)