Also, make sure to start the actual text at the margin.
=======================================================
+* **Updated Broadcom bnxt driver.**
+
+ Updated the Broadcom bnxt driver with fixes and improvements, including:
+
+ * Added support for Stingray2 device.
+
Removed Items
-------------
#define BROADCOM_DEV_ID_58804 0xd804
#define BROADCOM_DEV_ID_58808 0x16f0
#define BROADCOM_DEV_ID_58802_VF 0xd800
+#define BROADCOM_DEV_ID_58812 0xd812
+#define BROADCOM_DEV_ID_58814 0xd814
+#define BROADCOM_DEV_ID_58818 0xd818
+#define BROADCOM_DEV_ID_58818_VF 0xd82e
#define BROADCOM_DEV_957508_N2100 0x5208
#define IS_BNXT_DEV_957508_N2100(bp) \
};
/* 64-bit doorbell */
+#define DBR_EPOCH_MASK 0x01000000UL
+#define DBR_EPOCH_SFT 24
#define DBR_XID_SFT 32
#define DBR_PATH_L2 (0x1ULL << 56)
+#define DBR_VALID (0x1ULL << 58)
#define DBR_TYPE_SQ (0x0ULL << 60)
#define DBR_TYPE_SRQ (0x2ULL << 60)
#define DBR_TYPE_CQ (0x4ULL << 60)
#define DBR_TYPE_NQ (0xaULL << 60)
#define DBR_TYPE_NQ_ARM (0xbULL << 60)
+#define DB_PF_OFFSET 0x10000
+#define DB_VF_OFFSET 0x4000
+
#define BNXT_RSS_TBL_SIZE_P5 512U
#define BNXT_RSS_ENTRIES_PER_CTX_P5 64
#define BNXT_MAX_RSS_CTXTS_P5 \
struct rte_eth_dev *eth_dev;
struct rte_pci_device *pdev;
void *doorbell_base;
+ int legacy_db_size;
uint32_t flags;
#define BNXT_FLAG_REGISTERED BIT(0)
#define BNXT_TRUFLOW_EN(bp) ((bp)->flags & BNXT_FLAG_TRUFLOW_EN)
#define BNXT_GFID_ENABLED(bp) ((bp)->flags & BNXT_FLAG_GFID_ENABLE)
+ uint16_t chip_num;
+#define CHIP_NUM_58818 0xd818
+#define BNXT_CHIP_SR2(bp) ((bp)->chip_num == CHIP_NUM_58818)
+
uint32_t fw_cap;
#define BNXT_FW_CAP_HOT_RESET BIT(0)
#define BNXT_FW_CAP_IF_CHANGE BIT(1)
};
bool db_64;
uint32_t db_ring_mask;
+ uint32_t db_epoch_mask;
+ uint32_t db_epoch_shift;
};
-#define DB_RING_IDX(db, idx) ((idx) & (db)->db_ring_mask)
+#define DB_EPOCH(db, idx) (((idx) & (db)->db_epoch_mask) << \
+ ((db)->db_epoch_shift))
+#define DB_RING_IDX(db, idx) (((idx) & (db)->db_ring_mask) | \
+ DB_EPOCH(db, idx))
struct bnxt_ring;
struct bnxt_cp_ring_info {
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57508_MF2) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57504_MF2) },
{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57502_MF2) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_58812) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_58814) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_58818) },
+ { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_58818_VF) },
{ .vendor_id = 0, /* sentinel */ },
};
case BROADCOM_DEV_ID_58802_VF:
case BROADCOM_DEV_ID_57500_VF1:
case BROADCOM_DEV_ID_57500_VF2:
+ case BROADCOM_DEV_ID_58818_VF:
/* FALLTHROUGH */
return true;
default:
case BROADCOM_DEV_ID_57502_MF2:
case BROADCOM_DEV_ID_57500_VF1:
case BROADCOM_DEV_ID_57500_VF2:
+ case BROADCOM_DEV_ID_58812:
+ case BROADCOM_DEV_ID_58814:
+ case BROADCOM_DEV_ID_58818:
+ case BROADCOM_DEV_ID_58818_VF:
/* FALLTHROUGH */
return true;
default:
PMD_DRV_LOG(ERR, "Unsupported request length\n");
rc = -EINVAL;
}
+
+ bp->chip_num = rte_le_to_cpu_16(resp->chip_num);
+
bp->max_req_len = rte_le_to_cpu_16(resp->max_req_win_len);
bp->hwrm_max_ext_req_len = rte_le_to_cpu_16(resp->max_ext_req_len);
if (bp->hwrm_max_ext_req_len < HWRM_MAX_REQ_LEN)
break;
}
+ bp->legacy_db_size =
+ rte_le_to_cpu_16(resp->legacy_l2_db_size_kb) * 1024;
+
HWRM_UNLOCK();
return rc;
uint32_t ring_mask)
{
if (BNXT_CHIP_P5(bp)) {
- if (BNXT_PF(bp))
- db->doorbell = (char *)bp->doorbell_base + 0x10000;
- else
- db->doorbell = (char *)bp->doorbell_base + 0x4000;
+ int db_offset = DB_PF_OFFSET;
switch (ring_type) {
case HWRM_RING_ALLOC_INPUT_RING_TYPE_TX:
db->db_key64 = DBR_PATH_L2 | DBR_TYPE_SQ;
db->db_key64 = DBR_PATH_L2;
break;
}
+ if (BNXT_CHIP_SR2(bp)) {
+ db->db_key64 |= DBR_VALID;
+ db_offset = bp->legacy_db_size;
+ } else if (BNXT_VF(bp)) {
+ db_offset = DB_VF_OFFSET;
+ }
+
+ db->doorbell = (char *)bp->doorbell_base + db_offset;
db->db_key64 |= (uint64_t)fid << DBR_XID_SFT;
db->db_64 = true;
} else {
db->db_64 = false;
}
db->db_ring_mask = ring_mask;
+
+ if (BNXT_CHIP_SR2(bp)) {
+ db->db_epoch_mask = db->db_ring_mask + 1;
+ db->db_epoch_shift = DBR_EPOCH_SFT -
+ rte_log2_u32(db->db_epoch_mask);
+ }
}
static int bnxt_alloc_cmpl_ring(struct bnxt *bp, int queue_index,