Commit 20b1bd96 authored by Ram Amrani's avatar Ram Amrani Committed by David S. Miller

qed: output the DPM status and WID count

Output to the RDMA driver whether DPM mode is enabled or disabled in
the HW and if so what is the number of WIDs it supports
Signed-off-by: default avatarRam Amrani <Ram.Amrani@cavium.com>
Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 107392b7
...@@ -526,6 +526,7 @@ struct qed_hwfn { ...@@ -526,6 +526,7 @@ struct qed_hwfn {
struct dbg_tools_data dbg_info; struct dbg_tools_data dbg_info;
/* PWM region specific data */ /* PWM region specific data */
u16 wid_count;
u32 dpi_size; u32 dpi_size;
u32 dpi_count; u32 dpi_count;
......
...@@ -1354,7 +1354,7 @@ qed_hw_init_pf_doorbell_bar(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) ...@@ -1354,7 +1354,7 @@ qed_hw_init_pf_doorbell_bar(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
{ {
u32 pwm_regsize, norm_regsize; u32 pwm_regsize, norm_regsize;
u32 non_pwm_conn, min_addr_reg1; u32 non_pwm_conn, min_addr_reg1;
u32 db_bar_size, n_cpus; u32 db_bar_size, n_cpus = 1;
u32 roce_edpm_mode; u32 roce_edpm_mode;
u32 pf_dems_shift; u32 pf_dems_shift;
int rc = 0; int rc = 0;
...@@ -1415,6 +1415,8 @@ qed_hw_init_pf_doorbell_bar(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) ...@@ -1415,6 +1415,8 @@ qed_hw_init_pf_doorbell_bar(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
qed_rdma_dpm_bar(p_hwfn, p_ptt); qed_rdma_dpm_bar(p_hwfn, p_ptt);
} }
p_hwfn->wid_count = (u16) n_cpus;
DP_INFO(p_hwfn, DP_INFO(p_hwfn,
"doorbell bar: normal_region_size=%d, pwm_region_size=%d, dpi_size=%d, dpi_count=%d, roce_edpm=%s\n", "doorbell bar: normal_region_size=%d, pwm_region_size=%d, dpi_size=%d, dpi_count=%d, roce_edpm=%s\n",
norm_regsize, norm_regsize,
......
...@@ -784,6 +784,7 @@ static int qed_rdma_add_user(void *rdma_cxt, ...@@ -784,6 +784,7 @@ static int qed_rdma_add_user(void *rdma_cxt,
((out_params->dpi) * p_hwfn->dpi_size); ((out_params->dpi) * p_hwfn->dpi_size);
out_params->dpi_size = p_hwfn->dpi_size; out_params->dpi_size = p_hwfn->dpi_size;
out_params->wid_count = p_hwfn->wid_count;
DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "Adding user - done, rc = %d\n", rc); DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "Adding user - done, rc = %d\n", rc);
return rc; return rc;
...@@ -856,9 +857,12 @@ static void qed_rdma_cnq_prod_update(void *rdma_cxt, u8 qz_offset, u16 prod) ...@@ -856,9 +857,12 @@ static void qed_rdma_cnq_prod_update(void *rdma_cxt, u8 qz_offset, u16 prod)
static int qed_fill_rdma_dev_info(struct qed_dev *cdev, static int qed_fill_rdma_dev_info(struct qed_dev *cdev,
struct qed_dev_rdma_info *info) struct qed_dev_rdma_info *info)
{ {
struct qed_hwfn *p_hwfn = QED_LEADING_HWFN(cdev);
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
info->rdma_type = QED_RDMA_TYPE_ROCE; info->rdma_type = QED_RDMA_TYPE_ROCE;
info->user_dpm_enabled = (p_hwfn->db_bar_no_edpm == 0);
qed_fill_dev_info(cdev, &info->common); qed_fill_dev_info(cdev, &info->common);
......
...@@ -240,6 +240,7 @@ struct qed_rdma_add_user_out_params { ...@@ -240,6 +240,7 @@ struct qed_rdma_add_user_out_params {
u64 dpi_addr; u64 dpi_addr;
u64 dpi_phys_addr; u64 dpi_phys_addr;
u32 dpi_size; u32 dpi_size;
u16 wid_count;
}; };
enum roce_mode { enum roce_mode {
...@@ -533,6 +534,7 @@ enum qed_rdma_type { ...@@ -533,6 +534,7 @@ enum qed_rdma_type {
struct qed_dev_rdma_info { struct qed_dev_rdma_info {
struct qed_dev_info common; struct qed_dev_info common;
enum qed_rdma_type rdma_type; enum qed_rdma_type rdma_type;
u8 user_dpm_enabled;
}; };
struct qed_rdma_ops { struct qed_rdma_ops {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment