diff options
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_device.h | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hem.c | 76 | ||||
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hem.h | 4 | ||||
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 140 | ||||
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v1.h | 9 |
5 files changed, 157 insertions, 74 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_device.h b/drivers/infiniband/hw/hns/hns_roce_device.h index 15bc229041c7..3058599d0404 100644 --- a/drivers/infiniband/hw/hns/hns_roce_device.h +++ b/drivers/infiniband/hw/hns/hns_roce_device.h | |||
@@ -506,6 +506,8 @@ struct hns_roce_hw { | |||
506 | void (*write_cqc)(struct hns_roce_dev *hr_dev, | 506 | void (*write_cqc)(struct hns_roce_dev *hr_dev, |
507 | struct hns_roce_cq *hr_cq, void *mb_buf, u64 *mtts, | 507 | struct hns_roce_cq *hr_cq, void *mb_buf, u64 *mtts, |
508 | dma_addr_t dma_handle, int nent, u32 vector); | 508 | dma_addr_t dma_handle, int nent, u32 vector); |
509 | int (*clear_hem)(struct hns_roce_dev *hr_dev, | ||
510 | struct hns_roce_hem_table *table, int obj); | ||
509 | int (*query_qp)(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, | 511 | int (*query_qp)(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, |
510 | int qp_attr_mask, struct ib_qp_init_attr *qp_init_attr); | 512 | int qp_attr_mask, struct ib_qp_init_attr *qp_init_attr); |
511 | int (*modify_qp)(struct ib_qp *ibqp, const struct ib_qp_attr *attr, | 513 | int (*modify_qp)(struct ib_qp *ibqp, const struct ib_qp_attr *attr, |
diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c index d53d64362389..250d8f280390 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.c +++ b/drivers/infiniband/hw/hns/hns_roce_hem.c | |||
@@ -36,14 +36,10 @@ | |||
36 | #include "hns_roce_hem.h" | 36 | #include "hns_roce_hem.h" |
37 | #include "hns_roce_common.h" | 37 | #include "hns_roce_common.h" |
38 | 38 | ||
39 | #define HW_SYNC_TIMEOUT_MSECS 500 | ||
40 | #define HW_SYNC_SLEEP_TIME_INTERVAL 20 | ||
41 | |||
42 | #define HNS_ROCE_HEM_ALLOC_SIZE (1 << 17) | 39 | #define HNS_ROCE_HEM_ALLOC_SIZE (1 << 17) |
43 | #define HNS_ROCE_TABLE_CHUNK_SIZE (1 << 17) | 40 | #define HNS_ROCE_TABLE_CHUNK_SIZE (1 << 17) |
44 | 41 | ||
45 | #define DMA_ADDR_T_SHIFT 12 | 42 | #define DMA_ADDR_T_SHIFT 12 |
46 | #define BT_CMD_SYNC_SHIFT 31 | ||
47 | #define BT_BA_SHIFT 32 | 43 | #define BT_BA_SHIFT 32 |
48 | 44 | ||
49 | struct hns_roce_hem *hns_roce_alloc_hem(struct hns_roce_dev *hr_dev, int npages, | 45 | struct hns_roce_hem *hns_roce_alloc_hem(struct hns_roce_dev *hr_dev, int npages, |
@@ -213,74 +209,6 @@ static int hns_roce_set_hem(struct hns_roce_dev *hr_dev, | |||
213 | return ret; | 209 | return ret; |
214 | } | 210 | } |
215 | 211 | ||
216 | static int hns_roce_clear_hem(struct hns_roce_dev *hr_dev, | ||
217 | struct hns_roce_hem_table *table, | ||
218 | unsigned long obj) | ||
219 | { | ||
220 | struct device *dev = &hr_dev->pdev->dev; | ||
221 | unsigned long end = 0; | ||
222 | unsigned long flags; | ||
223 | void __iomem *bt_cmd; | ||
224 | uint32_t bt_cmd_val[2]; | ||
225 | u32 bt_cmd_h_val = 0; | ||
226 | int ret = 0; | ||
227 | |||
228 | switch (table->type) { | ||
229 | case HEM_TYPE_QPC: | ||
230 | roce_set_field(bt_cmd_h_val, ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_M, | ||
231 | ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_S, HEM_TYPE_QPC); | ||
232 | break; | ||
233 | case HEM_TYPE_MTPT: | ||
234 | roce_set_field(bt_cmd_h_val, ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_M, | ||
235 | ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_S, | ||
236 | HEM_TYPE_MTPT); | ||
237 | break; | ||
238 | case HEM_TYPE_CQC: | ||
239 | roce_set_field(bt_cmd_h_val, ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_M, | ||
240 | ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_S, HEM_TYPE_CQC); | ||
241 | break; | ||
242 | case HEM_TYPE_SRQC: | ||
243 | roce_set_field(bt_cmd_h_val, ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_M, | ||
244 | ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_S, | ||
245 | HEM_TYPE_SRQC); | ||
246 | break; | ||
247 | default: | ||
248 | return ret; | ||
249 | } | ||
250 | roce_set_field(bt_cmd_h_val, ROCEE_BT_CMD_H_ROCEE_BT_CMD_IN_MDF_M, | ||
251 | ROCEE_BT_CMD_H_ROCEE_BT_CMD_IN_MDF_S, obj); | ||
252 | roce_set_bit(bt_cmd_h_val, ROCEE_BT_CMD_H_ROCEE_BT_CMD_S, 0); | ||
253 | roce_set_bit(bt_cmd_h_val, ROCEE_BT_CMD_H_ROCEE_BT_CMD_HW_SYNS_S, 1); | ||
254 | roce_set_field(bt_cmd_h_val, ROCEE_BT_CMD_H_ROCEE_BT_CMD_BA_H_M, | ||
255 | ROCEE_BT_CMD_H_ROCEE_BT_CMD_BA_H_S, 0); | ||
256 | |||
257 | spin_lock_irqsave(&hr_dev->bt_cmd_lock, flags); | ||
258 | |||
259 | bt_cmd = hr_dev->reg_base + ROCEE_BT_CMD_H_REG; | ||
260 | |||
261 | end = msecs_to_jiffies(HW_SYNC_TIMEOUT_MSECS) + jiffies; | ||
262 | while (1) { | ||
263 | if (readl(bt_cmd) >> BT_CMD_SYNC_SHIFT) { | ||
264 | if (!(time_before(jiffies, end))) { | ||
265 | dev_err(dev, "Write bt_cmd err,hw_sync is not zero.\n"); | ||
266 | spin_unlock_irqrestore(&hr_dev->bt_cmd_lock, | ||
267 | flags); | ||
268 | return -EBUSY; | ||
269 | } | ||
270 | } else { | ||
271 | break; | ||
272 | } | ||
273 | msleep(HW_SYNC_SLEEP_TIME_INTERVAL); | ||
274 | } | ||
275 | |||
276 | bt_cmd_val[0] = 0; | ||
277 | bt_cmd_val[1] = bt_cmd_h_val; | ||
278 | hns_roce_write64_k(bt_cmd_val, hr_dev->reg_base + ROCEE_BT_CMD_L_REG); | ||
279 | spin_unlock_irqrestore(&hr_dev->bt_cmd_lock, flags); | ||
280 | |||
281 | return ret; | ||
282 | } | ||
283 | |||
284 | int hns_roce_table_get(struct hns_roce_dev *hr_dev, | 212 | int hns_roce_table_get(struct hns_roce_dev *hr_dev, |
285 | struct hns_roce_hem_table *table, unsigned long obj) | 213 | struct hns_roce_hem_table *table, unsigned long obj) |
286 | { | 214 | { |
@@ -333,7 +261,7 @@ void hns_roce_table_put(struct hns_roce_dev *hr_dev, | |||
333 | 261 | ||
334 | if (--table->hem[i]->refcount == 0) { | 262 | if (--table->hem[i]->refcount == 0) { |
335 | /* Clear HEM base address */ | 263 | /* Clear HEM base address */ |
336 | if (hns_roce_clear_hem(hr_dev, table, obj)) | 264 | if (hr_dev->hw->clear_hem(hr_dev, table, obj)) |
337 | dev_warn(dev, "Clear HEM base address failed.\n"); | 265 | dev_warn(dev, "Clear HEM base address failed.\n"); |
338 | 266 | ||
339 | hns_roce_free_hem(hr_dev, table->hem[i]); | 267 | hns_roce_free_hem(hr_dev, table->hem[i]); |
@@ -456,7 +384,7 @@ void hns_roce_cleanup_hem_table(struct hns_roce_dev *hr_dev, | |||
456 | 384 | ||
457 | for (i = 0; i < table->num_hem; ++i) | 385 | for (i = 0; i < table->num_hem; ++i) |
458 | if (table->hem[i]) { | 386 | if (table->hem[i]) { |
459 | if (hns_roce_clear_hem(hr_dev, table, | 387 | if (hr_dev->hw->clear_hem(hr_dev, table, |
460 | i * HNS_ROCE_TABLE_CHUNK_SIZE / table->obj_size)) | 388 | i * HNS_ROCE_TABLE_CHUNK_SIZE / table->obj_size)) |
461 | dev_err(dev, "Clear HEM base address failed.\n"); | 389 | dev_err(dev, "Clear HEM base address failed.\n"); |
462 | 390 | ||
diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.h b/drivers/infiniband/hw/hns/hns_roce_hem.h index ad6617588fba..435748858252 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.h +++ b/drivers/infiniband/hw/hns/hns_roce_hem.h | |||
@@ -34,6 +34,10 @@ | |||
34 | #ifndef _HNS_ROCE_HEM_H | 34 | #ifndef _HNS_ROCE_HEM_H |
35 | #define _HNS_ROCE_HEM_H | 35 | #define _HNS_ROCE_HEM_H |
36 | 36 | ||
37 | #define HW_SYNC_TIMEOUT_MSECS 500 | ||
38 | #define HW_SYNC_SLEEP_TIME_INTERVAL 20 | ||
39 | #define BT_CMD_SYNC_SHIFT 31 | ||
40 | |||
37 | enum { | 41 | enum { |
38 | /* MAP HEM(Hardware Entry Memory) */ | 42 | /* MAP HEM(Hardware Entry Memory) */ |
39 | HEM_TYPE_QPC = 0, | 43 | HEM_TYPE_QPC = 0, |
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c index 48c08627faf1..d767ebebd27e 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c | |||
@@ -786,6 +786,66 @@ static void hns_roce_port_enable(struct hns_roce_dev *hr_dev, int enable_flag) | |||
786 | } | 786 | } |
787 | } | 787 | } |
788 | 788 | ||
789 | static int hns_roce_bt_init(struct hns_roce_dev *hr_dev) | ||
790 | { | ||
791 | struct device *dev = &hr_dev->pdev->dev; | ||
792 | struct hns_roce_v1_priv *priv; | ||
793 | int ret; | ||
794 | |||
795 | priv = (struct hns_roce_v1_priv *)hr_dev->hw->priv; | ||
796 | |||
797 | priv->bt_table.qpc_buf.buf = dma_alloc_coherent(dev, | ||
798 | HNS_ROCE_BT_RSV_BUF_SIZE, &priv->bt_table.qpc_buf.map, | ||
799 | GFP_KERNEL); | ||
800 | if (!priv->bt_table.qpc_buf.buf) | ||
801 | return -ENOMEM; | ||
802 | |||
803 | priv->bt_table.mtpt_buf.buf = dma_alloc_coherent(dev, | ||
804 | HNS_ROCE_BT_RSV_BUF_SIZE, &priv->bt_table.mtpt_buf.map, | ||
805 | GFP_KERNEL); | ||
806 | if (!priv->bt_table.mtpt_buf.buf) { | ||
807 | ret = -ENOMEM; | ||
808 | goto err_failed_alloc_mtpt_buf; | ||
809 | } | ||
810 | |||
811 | priv->bt_table.cqc_buf.buf = dma_alloc_coherent(dev, | ||
812 | HNS_ROCE_BT_RSV_BUF_SIZE, &priv->bt_table.cqc_buf.map, | ||
813 | GFP_KERNEL); | ||
814 | if (!priv->bt_table.cqc_buf.buf) { | ||
815 | ret = -ENOMEM; | ||
816 | goto err_failed_alloc_cqc_buf; | ||
817 | } | ||
818 | |||
819 | return 0; | ||
820 | |||
821 | err_failed_alloc_cqc_buf: | ||
822 | dma_free_coherent(dev, HNS_ROCE_BT_RSV_BUF_SIZE, | ||
823 | priv->bt_table.mtpt_buf.buf, priv->bt_table.mtpt_buf.map); | ||
824 | |||
825 | err_failed_alloc_mtpt_buf: | ||
826 | dma_free_coherent(dev, HNS_ROCE_BT_RSV_BUF_SIZE, | ||
827 | priv->bt_table.qpc_buf.buf, priv->bt_table.qpc_buf.map); | ||
828 | |||
829 | return ret; | ||
830 | } | ||
831 | |||
832 | static void hns_roce_bt_free(struct hns_roce_dev *hr_dev) | ||
833 | { | ||
834 | struct device *dev = &hr_dev->pdev->dev; | ||
835 | struct hns_roce_v1_priv *priv; | ||
836 | |||
837 | priv = (struct hns_roce_v1_priv *)hr_dev->hw->priv; | ||
838 | |||
839 | dma_free_coherent(dev, HNS_ROCE_BT_RSV_BUF_SIZE, | ||
840 | priv->bt_table.cqc_buf.buf, priv->bt_table.cqc_buf.map); | ||
841 | |||
842 | dma_free_coherent(dev, HNS_ROCE_BT_RSV_BUF_SIZE, | ||
843 | priv->bt_table.mtpt_buf.buf, priv->bt_table.mtpt_buf.map); | ||
844 | |||
845 | dma_free_coherent(dev, HNS_ROCE_BT_RSV_BUF_SIZE, | ||
846 | priv->bt_table.qpc_buf.buf, priv->bt_table.qpc_buf.map); | ||
847 | } | ||
848 | |||
789 | /** | 849 | /** |
790 | * hns_roce_v1_reset - reset RoCE | 850 | * hns_roce_v1_reset - reset RoCE |
791 | * @hr_dev: RoCE device struct pointer | 851 | * @hr_dev: RoCE device struct pointer |
@@ -941,8 +1001,18 @@ int hns_roce_v1_init(struct hns_roce_dev *hr_dev) | |||
941 | 1001 | ||
942 | hns_roce_port_enable(hr_dev, HNS_ROCE_PORT_UP); | 1002 | hns_roce_port_enable(hr_dev, HNS_ROCE_PORT_UP); |
943 | 1003 | ||
1004 | ret = hns_roce_bt_init(hr_dev); | ||
1005 | if (ret) { | ||
1006 | dev_err(dev, "bt init failed!\n"); | ||
1007 | goto error_failed_bt_init; | ||
1008 | } | ||
1009 | |||
944 | return 0; | 1010 | return 0; |
945 | 1011 | ||
1012 | error_failed_bt_init: | ||
1013 | hns_roce_port_enable(hr_dev, HNS_ROCE_PORT_DOWN); | ||
1014 | hns_roce_raq_free(hr_dev); | ||
1015 | |||
946 | error_failed_raq_init: | 1016 | error_failed_raq_init: |
947 | hns_roce_db_free(hr_dev); | 1017 | hns_roce_db_free(hr_dev); |
948 | return ret; | 1018 | return ret; |
@@ -950,6 +1020,7 @@ error_failed_raq_init: | |||
950 | 1020 | ||
951 | void hns_roce_v1_exit(struct hns_roce_dev *hr_dev) | 1021 | void hns_roce_v1_exit(struct hns_roce_dev *hr_dev) |
952 | { | 1022 | { |
1023 | hns_roce_bt_free(hr_dev); | ||
953 | hns_roce_port_enable(hr_dev, HNS_ROCE_PORT_DOWN); | 1024 | hns_roce_port_enable(hr_dev, HNS_ROCE_PORT_DOWN); |
954 | hns_roce_raq_free(hr_dev); | 1025 | hns_roce_raq_free(hr_dev); |
955 | hns_roce_db_free(hr_dev); | 1026 | hns_roce_db_free(hr_dev); |
@@ -1596,6 +1667,74 @@ int hns_roce_v1_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc) | |||
1596 | return ret; | 1667 | return ret; |
1597 | } | 1668 | } |
1598 | 1669 | ||
1670 | int hns_roce_v1_clear_hem(struct hns_roce_dev *hr_dev, | ||
1671 | struct hns_roce_hem_table *table, int obj) | ||
1672 | { | ||
1673 | struct device *dev = &hr_dev->pdev->dev; | ||
1674 | struct hns_roce_v1_priv *priv; | ||
1675 | unsigned long end = 0, flags = 0; | ||
1676 | uint32_t bt_cmd_val[2] = {0}; | ||
1677 | void __iomem *bt_cmd; | ||
1678 | u64 bt_ba = 0; | ||
1679 | |||
1680 | priv = (struct hns_roce_v1_priv *)hr_dev->hw->priv; | ||
1681 | |||
1682 | switch (table->type) { | ||
1683 | case HEM_TYPE_QPC: | ||
1684 | roce_set_field(bt_cmd_val[1], ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_M, | ||
1685 | ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_S, HEM_TYPE_QPC); | ||
1686 | bt_ba = priv->bt_table.qpc_buf.map >> 12; | ||
1687 | break; | ||
1688 | case HEM_TYPE_MTPT: | ||
1689 | roce_set_field(bt_cmd_val[1], ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_M, | ||
1690 | ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_S, HEM_TYPE_MTPT); | ||
1691 | bt_ba = priv->bt_table.mtpt_buf.map >> 12; | ||
1692 | break; | ||
1693 | case HEM_TYPE_CQC: | ||
1694 | roce_set_field(bt_cmd_val[1], ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_M, | ||
1695 | ROCEE_BT_CMD_H_ROCEE_BT_CMD_MDF_S, HEM_TYPE_CQC); | ||
1696 | bt_ba = priv->bt_table.cqc_buf.map >> 12; | ||
1697 | break; | ||
1698 | case HEM_TYPE_SRQC: | ||
1699 | dev_dbg(dev, "HEM_TYPE_SRQC not support.\n"); | ||
1700 | return -EINVAL; | ||
1701 | default: | ||
1702 | return 0; | ||
1703 | } | ||
1704 | roce_set_field(bt_cmd_val[1], ROCEE_BT_CMD_H_ROCEE_BT_CMD_IN_MDF_M, | ||
1705 | ROCEE_BT_CMD_H_ROCEE_BT_CMD_IN_MDF_S, obj); | ||
1706 | roce_set_bit(bt_cmd_val[1], ROCEE_BT_CMD_H_ROCEE_BT_CMD_S, 0); | ||
1707 | roce_set_bit(bt_cmd_val[1], ROCEE_BT_CMD_H_ROCEE_BT_CMD_HW_SYNS_S, 1); | ||
1708 | |||
1709 | spin_lock_irqsave(&hr_dev->bt_cmd_lock, flags); | ||
1710 | |||
1711 | bt_cmd = hr_dev->reg_base + ROCEE_BT_CMD_H_REG; | ||
1712 | |||
1713 | end = msecs_to_jiffies(HW_SYNC_TIMEOUT_MSECS) + jiffies; | ||
1714 | while (1) { | ||
1715 | if (readl(bt_cmd) >> BT_CMD_SYNC_SHIFT) { | ||
1716 | if (!(time_before(jiffies, end))) { | ||
1717 | dev_err(dev, "Write bt_cmd err,hw_sync is not zero.\n"); | ||
1718 | spin_unlock_irqrestore(&hr_dev->bt_cmd_lock, | ||
1719 | flags); | ||
1720 | return -EBUSY; | ||
1721 | } | ||
1722 | } else { | ||
1723 | break; | ||
1724 | } | ||
1725 | msleep(HW_SYNC_SLEEP_TIME_INTERVAL); | ||
1726 | } | ||
1727 | |||
1728 | bt_cmd_val[0] = (uint32_t)bt_ba; | ||
1729 | roce_set_field(bt_cmd_val[1], ROCEE_BT_CMD_H_ROCEE_BT_CMD_BA_H_M, | ||
1730 | ROCEE_BT_CMD_H_ROCEE_BT_CMD_BA_H_S, bt_ba >> 32); | ||
1731 | hns_roce_write64_k(bt_cmd_val, hr_dev->reg_base + ROCEE_BT_CMD_L_REG); | ||
1732 | |||
1733 | spin_unlock_irqrestore(&hr_dev->bt_cmd_lock, flags); | ||
1734 | |||
1735 | return 0; | ||
1736 | } | ||
1737 | |||
1599 | static int hns_roce_v1_qp_modify(struct hns_roce_dev *hr_dev, | 1738 | static int hns_roce_v1_qp_modify(struct hns_roce_dev *hr_dev, |
1600 | struct hns_roce_mtt *mtt, | 1739 | struct hns_roce_mtt *mtt, |
1601 | enum hns_roce_qp_state cur_state, | 1740 | enum hns_roce_qp_state cur_state, |
@@ -2766,6 +2905,7 @@ struct hns_roce_hw hns_roce_hw_v1 = { | |||
2766 | .set_mtu = hns_roce_v1_set_mtu, | 2905 | .set_mtu = hns_roce_v1_set_mtu, |
2767 | .write_mtpt = hns_roce_v1_write_mtpt, | 2906 | .write_mtpt = hns_roce_v1_write_mtpt, |
2768 | .write_cqc = hns_roce_v1_write_cqc, | 2907 | .write_cqc = hns_roce_v1_write_cqc, |
2908 | .clear_hem = hns_roce_v1_clear_hem, | ||
2769 | .modify_qp = hns_roce_v1_modify_qp, | 2909 | .modify_qp = hns_roce_v1_modify_qp, |
2770 | .query_qp = hns_roce_v1_query_qp, | 2910 | .query_qp = hns_roce_v1_query_qp, |
2771 | .destroy_qp = hns_roce_v1_destroy_qp, | 2911 | .destroy_qp = hns_roce_v1_destroy_qp, |
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.h b/drivers/infiniband/hw/hns/hns_roce_hw_v1.h index 316b592b1636..539b0a3b92b0 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.h +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.h | |||
@@ -102,6 +102,8 @@ | |||
102 | #define HNS_ROCE_V1_EXT_ODB_ALFUL \ | 102 | #define HNS_ROCE_V1_EXT_ODB_ALFUL \ |
103 | (HNS_ROCE_V1_EXT_ODB_DEPTH - HNS_ROCE_V1_DB_RSVD) | 103 | (HNS_ROCE_V1_EXT_ODB_DEPTH - HNS_ROCE_V1_DB_RSVD) |
104 | 104 | ||
105 | #define HNS_ROCE_BT_RSV_BUF_SIZE (1 << 17) | ||
106 | |||
105 | #define HNS_ROCE_ODB_POLL_MODE 0 | 107 | #define HNS_ROCE_ODB_POLL_MODE 0 |
106 | 108 | ||
107 | #define HNS_ROCE_SDB_NORMAL_MODE 0 | 109 | #define HNS_ROCE_SDB_NORMAL_MODE 0 |
@@ -971,9 +973,16 @@ struct hns_roce_db_table { | |||
971 | struct hns_roce_ext_db *ext_db; | 973 | struct hns_roce_ext_db *ext_db; |
972 | }; | 974 | }; |
973 | 975 | ||
976 | struct hns_roce_bt_table { | ||
977 | struct hns_roce_buf_list qpc_buf; | ||
978 | struct hns_roce_buf_list mtpt_buf; | ||
979 | struct hns_roce_buf_list cqc_buf; | ||
980 | }; | ||
981 | |||
974 | struct hns_roce_v1_priv { | 982 | struct hns_roce_v1_priv { |
975 | struct hns_roce_db_table db_table; | 983 | struct hns_roce_db_table db_table; |
976 | struct hns_roce_raq_table raq_table; | 984 | struct hns_roce_raq_table raq_table; |
985 | struct hns_roce_bt_table bt_table; | ||
977 | }; | 986 | }; |
978 | 987 | ||
979 | int hns_dsaf_roce_reset(struct fwnode_handle *dsaf_fwnode, bool dereset); | 988 | int hns_dsaf_roce_reset(struct fwnode_handle *dsaf_fwnode, bool dereset); |