提交 160e37c7 编写于 作者: C Chiqijun 提交者: Yang Yingliang

net/hinic: Add dfx information

driver inclusion
category: bugfix
bugzilla: 4472

-----------------------------------------------------------------------

1. Print mod/cmd and aeq information after message timeout.
2. Use sdk_xxx to replace pr_xxx
3. Print msix interrupt status after tx timeout
Signed-off-by: NChiqijun <chiqijun@huawei.com>
Reviewed-by: NZengweiliang <zengweiliang.zengweiliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 2bc0b8a8
...@@ -148,7 +148,8 @@ static void parse_sf_en_cap(struct service_cap *cap, ...@@ -148,7 +148,8 @@ static void parse_sf_en_cap(struct service_cap *cap,
} }
} }
static void parse_pub_res_cap(struct service_cap *cap, static void parse_pub_res_cap(struct hinic_hwdev *hwdev,
struct service_cap *cap,
struct hinic_dev_cap *dev_cap, struct hinic_dev_cap *dev_cap,
enum func_type type) enum func_type type)
{ {
...@@ -212,31 +213,32 @@ static void parse_pub_res_cap(struct service_cap *cap, ...@@ -212,31 +213,32 @@ static void parse_pub_res_cap(struct service_cap *cap,
if (cap->net_port_mode == CFG_NET_MODE_FC) if (cap->net_port_mode == CFG_NET_MODE_FC)
cap->max_vf = 0; cap->max_vf = 0;
pr_info("Get public resource capbility, svc_cap_en: 0x%x\n", sdk_info(hwdev->dev_hdl, "Get public resource capbility, svc_cap_en: 0x%x\n",
dev_cap->svc_cap_en); dev_cap->svc_cap_en);
pr_info("Host_id=0x%x, ep_id=0x%x, max_cos_id=0x%x, cos_bitmap=0x%x, er_id=0x%x, port_id=0x%x\n", sdk_info(hwdev->dev_hdl, "Host_id=0x%x, ep_id=0x%x, max_cos_id=0x%x, cos_bitmap=0x%x, er_id=0x%x, port_id=0x%x\n",
cap->host_id, cap->ep_id, cap->host_id, cap->ep_id,
cap->max_cos_id, cap->cos_valid_bitmap, cap->max_cos_id, cap->cos_valid_bitmap,
cap->er_id, cap->port_id); cap->er_id, cap->port_id);
pr_info("Host_total_function=0x%x, host_oq_id_mask_val=0x%x, net_port_mode=0x%x, max_vf=0x%x\n", sdk_info(hwdev->dev_hdl, "Host_total_function=0x%x, host_oq_id_mask_val=0x%x, net_port_mode=0x%x, max_vf=0x%x\n",
cap->host_total_function, cap->host_oq_id_mask_val, cap->host_total_function, cap->host_oq_id_mask_val,
cap->net_port_mode, cap->max_vf); cap->net_port_mode, cap->max_vf);
pr_info("Pf_num=0x%x, pf_id_start=0x%x, vf_num=0x%x, vf_id_start=0x%x\n", sdk_info(hwdev->dev_hdl, "Pf_num=0x%x, pf_id_start=0x%x, vf_num=0x%x, vf_id_start=0x%x\n",
cap->pf_num, cap->pf_id_start, cap->pf_num, cap->pf_id_start,
cap->vf_num, cap->vf_id_start); cap->vf_num, cap->vf_id_start);
/* Check parameters from firmware */ /* Check parameters from firmware */
if (cap->max_sqs > HINIC_CFG_MAX_QP || if (cap->max_sqs > HINIC_CFG_MAX_QP ||
cap->max_rqs > HINIC_CFG_MAX_QP) { cap->max_rqs > HINIC_CFG_MAX_QP) {
pr_info("Number of qp exceed limit[1-%d]: sq: %d, rq: %d\n", sdk_info(hwdev->dev_hdl, "Number of qp exceed limit[1-%d]: sq: %d, rq: %d\n",
HINIC_CFG_MAX_QP, cap->max_sqs, cap->max_rqs); HINIC_CFG_MAX_QP, cap->max_sqs, cap->max_rqs);
cap->max_sqs = HINIC_CFG_MAX_QP; cap->max_sqs = HINIC_CFG_MAX_QP;
cap->max_rqs = HINIC_CFG_MAX_QP; cap->max_rqs = HINIC_CFG_MAX_QP;
} }
} }
static void parse_dynamic_share_res_cap(struct service_cap *cap, static void parse_dynamic_share_res_cap(struct hinic_hwdev *hwdev,
struct service_cap *cap,
struct hinic_dev_cap *dev_cap, struct hinic_dev_cap *dev_cap,
enum func_type type) enum func_type type)
{ {
...@@ -254,15 +256,14 @@ static void parse_dynamic_share_res_cap(struct service_cap *cap, ...@@ -254,15 +256,14 @@ static void parse_dynamic_share_res_cap(struct service_cap *cap,
shared_cap->host_srqs = dev_cap->host_srq_num; shared_cap->host_srqs = dev_cap->host_srq_num;
shared_cap->host_mpts = dev_cap->host_mpt_num; shared_cap->host_mpts = dev_cap->host_mpt_num;
pr_info("Dynamic share resource capbility, host_pctxs=0x%x, host_cctxs=0x%x, host_scqs=0x%x, host_srqs=0x%x, host_mpts=0x%x\n", sdk_info(hwdev->dev_hdl, "Dynamic share resource capbility, host_pctxs=0x%x, host_cctxs=0x%x, host_scqs=0x%x, host_srqs=0x%x, host_mpts=0x%x\n",
shared_cap->host_pctxs, shared_cap->host_pctxs, shared_cap->host_cctxs,
shared_cap->host_cctxs, shared_cap->host_scqs, shared_cap->host_srqs,
shared_cap->host_scqs,
shared_cap->host_srqs,
shared_cap->host_mpts); shared_cap->host_mpts);
} }
static void parse_l2nic_res_cap(struct service_cap *cap, static void parse_l2nic_res_cap(struct hinic_hwdev *hwdev,
struct service_cap *cap,
struct hinic_dev_cap *dev_cap, struct hinic_dev_cap *dev_cap,
enum func_type type) enum func_type type)
{ {
...@@ -293,24 +294,23 @@ static void parse_l2nic_res_cap(struct service_cap *cap, ...@@ -293,24 +294,23 @@ static void parse_l2nic_res_cap(struct service_cap *cap,
nic_cap->lro_sz = dev_cap->nic_lro_sz; nic_cap->lro_sz = dev_cap->nic_lro_sz;
nic_cap->tso_sz = dev_cap->nic_tso_sz; nic_cap->tso_sz = dev_cap->nic_tso_sz;
pr_info("L2nic resource capbility, max_sqs=0x%x, max_rqs=0x%x, vf_max_sqs=0x%x, vf_max_rqs=0x%x, max_queue_allowed=0x%x\n", sdk_info(hwdev->dev_hdl, "L2nic resource capbility, max_sqs=0x%x, max_rqs=0x%x, vf_max_sqs=0x%x, vf_max_rqs=0x%x, max_queue_allowed=0x%x\n",
nic_cap->max_sqs, nic_cap->max_sqs, nic_cap->max_rqs,
nic_cap->max_rqs, nic_cap->vf_max_sqs, nic_cap->vf_max_rqs,
nic_cap->vf_max_sqs,
nic_cap->vf_max_rqs,
nic_cap->max_queue_allowed); nic_cap->max_queue_allowed);
/* Check parameters from firmware */ /* Check parameters from firmware */
if (nic_cap->max_sqs > HINIC_CFG_MAX_QP || if (nic_cap->max_sqs > HINIC_CFG_MAX_QP ||
nic_cap->max_rqs > HINIC_CFG_MAX_QP) { nic_cap->max_rqs > HINIC_CFG_MAX_QP) {
pr_info("Number of qp exceed limit[1-%d]: sq: %d, rq: %d\n", sdk_info(hwdev->dev_hdl, "Number of qp exceed limit[1-%d]: sq: %d, rq: %d\n",
HINIC_CFG_MAX_QP, nic_cap->max_sqs, nic_cap->max_rqs); HINIC_CFG_MAX_QP, nic_cap->max_sqs, nic_cap->max_rqs);
nic_cap->max_sqs = HINIC_CFG_MAX_QP; nic_cap->max_sqs = HINIC_CFG_MAX_QP;
nic_cap->max_rqs = HINIC_CFG_MAX_QP; nic_cap->max_rqs = HINIC_CFG_MAX_QP;
} }
} }
static void parse_roce_res_cap(struct service_cap *cap, static void parse_roce_res_cap(struct hinic_hwdev *hwdev,
struct service_cap *cap,
struct hinic_dev_cap *dev_cap, struct hinic_dev_cap *dev_cap,
enum func_type type) enum func_type type)
{ {
...@@ -348,24 +348,24 @@ static void parse_roce_res_cap(struct service_cap *cap, ...@@ -348,24 +348,24 @@ static void parse_roce_res_cap(struct service_cap *cap,
roce_cap->wqe_cl_end = dev_cap->roce_wqe_cl_end; roce_cap->wqe_cl_end = dev_cap->roce_wqe_cl_end;
roce_cap->wqe_cl_sz = dev_cap->roce_wqe_cl_size; roce_cap->wqe_cl_sz = dev_cap->roce_wqe_cl_size;
pr_info("Get roce resource capbility\n"); sdk_info(hwdev->dev_hdl, "Get roce resource capbility\n");
pr_info("Max_qps=0x%x, max_cqs=0x%x, max_srqs=0x%x, max_mpts=0x%x\n", sdk_info(hwdev->dev_hdl, "Max_qps=0x%x, max_cqs=0x%x, max_srqs=0x%x, max_mpts=0x%x\n",
roce_cap->max_qps, roce_cap->max_cqs, roce_cap->max_qps, roce_cap->max_cqs,
roce_cap->max_srqs, roce_cap->max_mpts); roce_cap->max_srqs, roce_cap->max_mpts);
pr_info("Vf_max_qps=0x%x, vf_max_cqs=0x%x, vf_max_srqs= 0x%x, vf_max_mpts= 0x%x\n", sdk_info(hwdev->dev_hdl, "Vf_max_qps=0x%x, vf_max_cqs=0x%x, vf_max_srqs= 0x%x, vf_max_mpts= 0x%x\n",
roce_cap->vf_max_qps, roce_cap->vf_max_cqs, roce_cap->vf_max_qps, roce_cap->vf_max_cqs,
roce_cap->vf_max_srqs, roce_cap->vf_max_mpts); roce_cap->vf_max_srqs, roce_cap->vf_max_mpts);
pr_info("Cmtt_start=0x%x, cmtt_end=0x%x, cmtt_sz=0x%x\n", sdk_info(hwdev->dev_hdl, "Cmtt_start=0x%x, cmtt_end=0x%x, cmtt_sz=0x%x\n",
roce_cap->cmtt_cl_start, roce_cap->cmtt_cl_end, roce_cap->cmtt_cl_start, roce_cap->cmtt_cl_end,
roce_cap->cmtt_cl_sz); roce_cap->cmtt_cl_sz);
pr_info("Dmtt_start=0x%x, dmtt_end=0x%x, dmtt_sz=0x%x\n", sdk_info(hwdev->dev_hdl, "Dmtt_start=0x%x, dmtt_end=0x%x, dmtt_sz=0x%x\n",
roce_cap->dmtt_cl_start, roce_cap->dmtt_cl_end, roce_cap->dmtt_cl_start, roce_cap->dmtt_cl_end,
roce_cap->dmtt_cl_sz); roce_cap->dmtt_cl_sz);
pr_info("Wqe_start=0x%x, wqe_end=0x%x, wqe_sz=0x%x\n", sdk_info(hwdev->dev_hdl, "Wqe_start=0x%x, wqe_end=0x%x, wqe_sz=0x%x\n",
roce_cap->wqe_cl_start, roce_cap->wqe_cl_end, roce_cap->wqe_cl_start, roce_cap->wqe_cl_end,
roce_cap->wqe_cl_sz); roce_cap->wqe_cl_sz);
...@@ -384,7 +384,8 @@ static void parse_roce_res_cap(struct service_cap *cap, ...@@ -384,7 +384,8 @@ static void parse_roce_res_cap(struct service_cap *cap,
} }
} }
static void parse_iwarp_res_cap(struct service_cap *cap, static void parse_iwarp_res_cap(struct hinic_hwdev *hwdev,
struct service_cap *cap,
struct hinic_dev_cap *dev_cap, struct hinic_dev_cap *dev_cap,
enum func_type type) enum func_type type)
...@@ -420,23 +421,23 @@ static void parse_iwarp_res_cap(struct service_cap *cap, ...@@ -420,23 +421,23 @@ static void parse_iwarp_res_cap(struct service_cap *cap,
iwarp_cap->wqe_cl_end = dev_cap->iwarp_wqe_cl_end; iwarp_cap->wqe_cl_end = dev_cap->iwarp_wqe_cl_end;
iwarp_cap->wqe_cl_sz = dev_cap->iwarp_wqe_cl_size; iwarp_cap->wqe_cl_sz = dev_cap->iwarp_wqe_cl_size;
pr_info("Get iwrap resource capbility\n"); sdk_info(hwdev->dev_hdl, "Get iwrap resource capbility\n");
pr_info("Max_qps=0x%x, max_cqs=0x%x, max_mpts=0x%x\n", sdk_info(hwdev->dev_hdl, "Max_qps=0x%x, max_cqs=0x%x, max_mpts=0x%x\n",
iwarp_cap->max_qps, iwarp_cap->max_cqs, iwarp_cap->max_qps, iwarp_cap->max_cqs,
iwarp_cap->max_mpts); iwarp_cap->max_mpts);
pr_info("Vf_max_qps=0x%x, vf_max_cqs=0x%x, vf_max_mpts=0x%x\n", sdk_info(hwdev->dev_hdl, "Vf_max_qps=0x%x, vf_max_cqs=0x%x, vf_max_mpts=0x%x\n",
iwarp_cap->vf_max_qps, iwarp_cap->vf_max_cqs, iwarp_cap->vf_max_qps, iwarp_cap->vf_max_cqs,
iwarp_cap->vf_max_mpts); iwarp_cap->vf_max_mpts);
pr_info("Cmtt_start=0x%x, cmtt_end=0x%x, cmtt_sz=0x%x\n", sdk_info(hwdev->dev_hdl, "Cmtt_start=0x%x, cmtt_end=0x%x, cmtt_sz=0x%x\n",
iwarp_cap->cmtt_cl_start, iwarp_cap->cmtt_cl_end, iwarp_cap->cmtt_cl_start, iwarp_cap->cmtt_cl_end,
iwarp_cap->cmtt_cl_sz); iwarp_cap->cmtt_cl_sz);
pr_info("Dmtt_start=0x%x, dmtt_end=0x%x, dmtt_sz=0x%x\n", sdk_info(hwdev->dev_hdl, "Dmtt_start=0x%x, dmtt_end=0x%x, dmtt_sz=0x%x\n",
iwarp_cap->dmtt_cl_start, iwarp_cap->dmtt_cl_end, iwarp_cap->dmtt_cl_start, iwarp_cap->dmtt_cl_end,
iwarp_cap->dmtt_cl_sz); iwarp_cap->dmtt_cl_sz);
pr_info("Wqe_start=0x%x, wqe_end=0x%x, wqe_sz=0x%x\n", sdk_info(hwdev->dev_hdl, "Wqe_start=0x%x, wqe_end=0x%x, wqe_sz=0x%x\n",
iwarp_cap->wqe_cl_start, iwarp_cap->wqe_cl_end, iwarp_cap->wqe_cl_start, iwarp_cap->wqe_cl_end,
iwarp_cap->wqe_cl_sz); iwarp_cap->wqe_cl_sz);
...@@ -453,7 +454,8 @@ static void parse_iwarp_res_cap(struct service_cap *cap, ...@@ -453,7 +454,8 @@ static void parse_iwarp_res_cap(struct service_cap *cap,
} }
} }
static void parse_fcoe_res_cap(struct service_cap *cap, static void parse_fcoe_res_cap(struct hinic_hwdev *hwdev,
struct service_cap *cap,
struct hinic_dev_cap *dev_cap, struct hinic_dev_cap *dev_cap,
enum func_type type) enum func_type type)
{ {
...@@ -467,15 +469,16 @@ static void parse_fcoe_res_cap(struct service_cap *cap, ...@@ -467,15 +469,16 @@ static void parse_fcoe_res_cap(struct service_cap *cap,
fcoe_cap->vp_id_start = dev_cap->fcoe_vp_id_start; fcoe_cap->vp_id_start = dev_cap->fcoe_vp_id_start;
fcoe_cap->vp_id_end = dev_cap->fcoe_vp_id_end; fcoe_cap->vp_id_end = dev_cap->fcoe_vp_id_end;
pr_info("Get fcoe resource capbility\n"); sdk_info(hwdev->dev_hdl, "Get fcoe resource capbility\n");
pr_info("Max_qps=0x%x, max_cqs=0x%x, max_srqs=0x%x, max_cctxs=0x%x, cctxs_id_start=0x%x\n", sdk_info(hwdev->dev_hdl, "Max_qps=0x%x, max_cqs=0x%x, max_srqs=0x%x, max_cctxs=0x%x, cctxs_id_start=0x%x\n",
fcoe_cap->max_qps, fcoe_cap->max_cqs, fcoe_cap->max_srqs, fcoe_cap->max_qps, fcoe_cap->max_cqs, fcoe_cap->max_srqs,
fcoe_cap->max_cctxs, fcoe_cap->cctxs_id_start); fcoe_cap->max_cctxs, fcoe_cap->cctxs_id_start);
pr_info("Vp_id_start=0x%x, vp_id_end=0x%x\n", sdk_info(hwdev->dev_hdl, "Vp_id_start=0x%x, vp_id_end=0x%x\n",
fcoe_cap->vp_id_start, fcoe_cap->vp_id_end); fcoe_cap->vp_id_start, fcoe_cap->vp_id_end);
} }
static void parse_toe_res_cap(struct service_cap *cap, static void parse_toe_res_cap(struct hinic_hwdev *hwdev,
struct service_cap *cap,
struct hinic_dev_cap *dev_cap, struct hinic_dev_cap *dev_cap,
enum func_type type) enum func_type type)
{ {
...@@ -487,12 +490,13 @@ static void parse_toe_res_cap(struct service_cap *cap, ...@@ -487,12 +490,13 @@ static void parse_toe_res_cap(struct service_cap *cap,
toe_cap->srq_id_start = dev_cap->toe_srq_id_start; toe_cap->srq_id_start = dev_cap->toe_srq_id_start;
toe_cap->num_cos = dev_cap->max_cos_id + 1; toe_cap->num_cos = dev_cap->max_cos_id + 1;
pr_info("Get toe resource capbility, max_pctxs=0x%x, max_cqs=0x%x, max_srqs=0x%x, srq_id_start=0x%x\n", sdk_info(hwdev->dev_hdl, "Get toe resource capbility, max_pctxs=0x%x, max_cqs=0x%x, max_srqs=0x%x, srq_id_start=0x%x\n",
toe_cap->max_pctxs, toe_cap->max_cqs, toe_cap->max_srqs, toe_cap->max_pctxs, toe_cap->max_cqs, toe_cap->max_srqs,
toe_cap->srq_id_start); toe_cap->srq_id_start);
} }
static void parse_fc_res_cap(struct service_cap *cap, static void parse_fc_res_cap(struct hinic_hwdev *hwdev,
struct service_cap *cap,
struct hinic_dev_cap *dev_cap, struct hinic_dev_cap *dev_cap,
enum func_type type) enum func_type type)
{ {
...@@ -506,15 +510,16 @@ static void parse_fc_res_cap(struct service_cap *cap, ...@@ -506,15 +510,16 @@ static void parse_fc_res_cap(struct service_cap *cap,
fc_cap->vp_id_start = dev_cap->fc_vp_id_start; fc_cap->vp_id_start = dev_cap->fc_vp_id_start;
fc_cap->vp_id_end = dev_cap->fc_vp_id_end; fc_cap->vp_id_end = dev_cap->fc_vp_id_end;
pr_info("Get fc resource capbility\n"); sdk_info(hwdev->dev_hdl, "Get fc resource capbility\n");
pr_info("Max_parent_qpc_num=0x%x, scq_num=0x%x, srq_num=0x%x, max_child_qpc_num=0x%x, child_qpc_id_start=0x%x\n", sdk_info(hwdev->dev_hdl, "Max_parent_qpc_num=0x%x, scq_num=0x%x, srq_num=0x%x, max_child_qpc_num=0x%x, child_qpc_id_start=0x%x\n",
fc_cap->max_parent_qpc_num, fc_cap->scq_num, fc_cap->srq_num, fc_cap->max_parent_qpc_num, fc_cap->scq_num, fc_cap->srq_num,
fc_cap->max_child_qpc_num, fc_cap->child_qpc_id_start); fc_cap->max_child_qpc_num, fc_cap->child_qpc_id_start);
pr_info("Vp_id_start=0x%x, vp_id_end=0x%x\n", sdk_info(hwdev->dev_hdl, "Vp_id_start=0x%x, vp_id_end=0x%x\n",
fc_cap->vp_id_start, fc_cap->vp_id_end); fc_cap->vp_id_start, fc_cap->vp_id_end);
} }
static void parse_ovs_res_cap(struct service_cap *cap, static void parse_ovs_res_cap(struct hinic_hwdev *hwdev,
struct service_cap *cap,
struct hinic_dev_cap *dev_cap, struct hinic_dev_cap *dev_cap,
enum func_type type) enum func_type type)
{ {
...@@ -526,7 +531,7 @@ static void parse_ovs_res_cap(struct service_cap *cap, ...@@ -526,7 +531,7 @@ static void parse_ovs_res_cap(struct service_cap *cap,
if (type == TYPE_PF || type == TYPE_PPF) if (type == TYPE_PF || type == TYPE_PPF)
ovs_cap->dev_ovs_cap.dynamic_qp_en = dev_cap->ovs_dq_en; ovs_cap->dev_ovs_cap.dynamic_qp_en = dev_cap->ovs_dq_en;
pr_info("Get ovs resource capbility, max_qpc: 0x%x\n", sdk_info(hwdev->dev_hdl, "Get ovs resource capbility, max_qpc: 0x%x\n",
ovs_cap->dev_ovs_cap.max_pctxs); ovs_cap->dev_ovs_cap.max_pctxs);
} }
...@@ -546,39 +551,39 @@ static void parse_dev_cap(struct hinic_hwdev *dev, ...@@ -546,39 +551,39 @@ static void parse_dev_cap(struct hinic_hwdev *dev,
struct service_cap *cap = &dev->cfg_mgmt->svc_cap; struct service_cap *cap = &dev->cfg_mgmt->svc_cap;
/* Public resource */ /* Public resource */
parse_pub_res_cap(cap, dev_cap, type); parse_pub_res_cap(dev, cap, dev_cap, type);
/* PPF managed dynamic resource */ /* PPF managed dynamic resource */
if (type == TYPE_PPF) if (type == TYPE_PPF)
parse_dynamic_share_res_cap(cap, dev_cap, type); parse_dynamic_share_res_cap(dev, cap, dev_cap, type);
/* L2 NIC resource */ /* L2 NIC resource */
if (IS_NIC_TYPE(dev)) if (IS_NIC_TYPE(dev))
parse_l2nic_res_cap(cap, dev_cap, type); parse_l2nic_res_cap(dev, cap, dev_cap, type);
/* FCoE/IOE/TOE/FC without virtulization */ /* FCoE/IOE/TOE/FC without virtulization */
if (type == TYPE_PF || type == TYPE_PPF) { if (type == TYPE_PF || type == TYPE_PPF) {
if (IS_FC_TYPE(dev)) if (IS_FC_TYPE(dev))
parse_fc_res_cap(cap, dev_cap, type); parse_fc_res_cap(dev, cap, dev_cap, type);
if (IS_FCOE_TYPE(dev)) if (IS_FCOE_TYPE(dev))
parse_fcoe_res_cap(cap, dev_cap, type); parse_fcoe_res_cap(dev, cap, dev_cap, type);
if (IS_TOE_TYPE(dev)) if (IS_TOE_TYPE(dev))
parse_toe_res_cap(cap, dev_cap, type); parse_toe_res_cap(dev, cap, dev_cap, type);
} }
/* RoCE resource */ /* RoCE resource */
if (IS_ROCE_TYPE(dev)) if (IS_ROCE_TYPE(dev))
parse_roce_res_cap(cap, dev_cap, type); parse_roce_res_cap(dev, cap, dev_cap, type);
/* iWARP resource */ /* iWARP resource */
if (IS_IWARP_TYPE(dev)) if (IS_IWARP_TYPE(dev))
parse_iwarp_res_cap(cap, dev_cap, type); parse_iwarp_res_cap(dev, cap, dev_cap, type);
if (IS_OVS_TYPE(dev)) if (IS_OVS_TYPE(dev))
parse_ovs_res_cap(cap, dev_cap, type); parse_ovs_res_cap(dev, cap, dev_cap, type);
if (IS_ACL_TYPE(dev)) if (IS_ACL_TYPE(dev))
parse_acl_res_cap(cap, dev_cap, type); parse_acl_res_cap(cap, dev_cap, type);
......
...@@ -689,8 +689,8 @@ static int cmdq_sync_cmd_direct_resp(struct hinic_cmdq *cmdq, ...@@ -689,8 +689,8 @@ static int cmdq_sync_cmd_direct_resp(struct hinic_cmdq *cmdq,
if (!err) if (!err)
goto timeout_check_ok; goto timeout_check_ok;
sdk_err(cmdq->hwdev->dev_hdl, "Cmdq sync command timeout, prod idx: 0x%x\n", sdk_err(cmdq->hwdev->dev_hdl, "Cmdq sync command timeout, mod: %d cmd: 0x%x prod idx: 0x%x\n",
curr_prod_idx); mod, cmd, curr_prod_idx);
hinic_dump_ceq_info(cmdq->hwdev); hinic_dump_ceq_info(cmdq->hwdev);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -819,8 +819,8 @@ static int cmdq_sync_cmd_detail_resp(struct hinic_cmdq *cmdq, ...@@ -819,8 +819,8 @@ static int cmdq_sync_cmd_detail_resp(struct hinic_cmdq *cmdq,
if (!err) if (!err)
goto timeout_check_ok; goto timeout_check_ok;
sdk_err(cmdq->hwdev->dev_hdl, "Cmdq sync command timeout, prod idx: 0x%x\n", sdk_err(cmdq->hwdev->dev_hdl, "Cmdq sync command timeout, mod: %d cmd: 0x%x prod idx: 0x%x\n",
curr_prod_idx); mod, cmd, curr_prod_idx);
hinic_dump_ceq_info(cmdq->hwdev); hinic_dump_ceq_info(cmdq->hwdev);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
......
...@@ -630,6 +630,7 @@ void ffm_intr_msg_record(void *handle, void *buf_in, u16 in_size, ...@@ -630,6 +630,7 @@ void ffm_intr_msg_record(void *handle, void *buf_in, u16 in_size,
struct timex txc; struct timex txc;
struct rtc_time rctm; struct rtc_time rctm;
struct card_node *card_info = NULL; struct card_node *card_info = NULL;
struct hinic_hwdev *hwdev = handle;
bool flag = false; bool flag = false;
int i, j; int i, j;
...@@ -667,7 +668,8 @@ void ffm_intr_msg_record(void *handle, void *buf_in, u16 in_size, ...@@ -667,7 +668,8 @@ void ffm_intr_msg_record(void *handle, void *buf_in, u16 in_size,
ffm_idx = dbgtool_info->ffm->ffm_num; ffm_idx = dbgtool_info->ffm->ffm_num;
if (ffm_idx < FFM_RECORD_NUM_MAX) { if (ffm_idx < FFM_RECORD_NUM_MAX) {
pr_info("%s: recv intr, ffm_idx: %d\n", __func__, ffm_idx); nic_info(hwdev->dev_hdl, "%s: recv intr, ffm_idx: %d\n",
__func__, ffm_idx);
dbgtool_info->ffm->ffm[ffm_idx].node_id = intr->node_id; dbgtool_info->ffm->ffm[ffm_idx].node_id = intr->node_id;
dbgtool_info->ffm->ffm[ffm_idx].err_level = intr->err_level; dbgtool_info->ffm->ffm[ffm_idx].err_level = intr->err_level;
......
...@@ -1163,7 +1163,7 @@ static int init_eq(struct hinic_eq *eq, struct hinic_hwdev *hwdev, u16 q_id, ...@@ -1163,7 +1163,7 @@ static int init_eq(struct hinic_eq *eq, struct hinic_hwdev *hwdev, u16 q_id,
"hinic_aeq%d@pci:%s", eq->q_id, "hinic_aeq%d@pci:%s", eq->q_id,
pci_name(hwdev->pcidev_hdl)); pci_name(hwdev->pcidev_hdl));
if (err <= 0 || err >= (int)sizeof(eq->irq_name)) { if (err <= 0 || err >= (int)sizeof(eq->irq_name)) {
pr_err("Failed snprintf irq_name, function return(%d) and dest_len(%d)\n", sdk_err(hwdev->dev_hdl, "Failed snprintf irq_name, function return(%d) and dest_len(%d)\n",
err, (int)sizeof(eq->irq_name)); err, (int)sizeof(eq->irq_name));
err = -EINVAL; err = -EINVAL;
goto req_irq_err; goto req_irq_err;
...@@ -1175,7 +1175,7 @@ static int init_eq(struct hinic_eq *eq, struct hinic_hwdev *hwdev, u16 q_id, ...@@ -1175,7 +1175,7 @@ static int init_eq(struct hinic_eq *eq, struct hinic_hwdev *hwdev, u16 q_id,
"hinic_ceq%d@pci:%s", eq->q_id, "hinic_ceq%d@pci:%s", eq->q_id,
pci_name(hwdev->pcidev_hdl)); pci_name(hwdev->pcidev_hdl));
if (err <= 0 || err >= (int)sizeof(eq->irq_name)) { if (err <= 0 || err >= (int)sizeof(eq->irq_name)) {
pr_err("Failed snprintf irq_name, function return(%d) and dest_len(%d)\n", sdk_err(hwdev->dev_hdl, "Failed snprintf irq_name, function return(%d) and dest_len(%d)\n",
err, (int)sizeof(eq->irq_name)); err, (int)sizeof(eq->irq_name));
err = -EINVAL; err = -EINVAL;
goto req_irq_err; goto req_irq_err;
......
...@@ -494,6 +494,7 @@ enum hinic_msix_state { ...@@ -494,6 +494,7 @@ enum hinic_msix_state {
void hinic_set_msix_state(void *hwdev, u16 msix_idx, void hinic_set_msix_state(void *hwdev, u16 msix_idx,
enum hinic_msix_state flag); enum hinic_msix_state flag);
enum hinic_msix_state hinic_get_msix_state(void *hwdev, u16 msix_idx);
/* Define the version information structure */ /* Define the version information structure */
struct dev_version_info { struct dev_version_info {
......
...@@ -458,6 +458,23 @@ int hinic_alloc_db_phy_addr(void *hwdev, u64 *db_base, u64 *dwqe_base) ...@@ -458,6 +458,23 @@ int hinic_alloc_db_phy_addr(void *hwdev, u64 *db_base, u64 *dwqe_base)
} }
EXPORT_SYMBOL(hinic_alloc_db_phy_addr); EXPORT_SYMBOL(hinic_alloc_db_phy_addr);
enum hinic_msix_state hinic_get_msix_state(void *hwdev, u16 msix_idx)
{
struct hinic_hwif *hwif = NULL;
u32 offset = msix_idx * HINIC_PCI_MSIX_ENTRY_SIZE +
HINIC_PCI_MSIX_ENTRY_VECTOR_CTRL;
u32 mask_bits;
if (!hwdev)
return HINIC_MSIX_DISABLE;
hwif = ((struct hinic_hwdev *)hwdev)->hwif;
mask_bits = readl(hwif->intr_regs_base + offset);
return !!(mask_bits & HINIC_PCI_MSIX_ENTRY_CTRL_MASKBIT);
}
void hinic_set_msix_state(void *hwdev, u16 msix_idx, enum hinic_msix_state flag) void hinic_set_msix_state(void *hwdev, u16 msix_idx, enum hinic_msix_state flag)
{ {
struct hinic_hwif *hwif; struct hinic_hwif *hwif;
...@@ -614,7 +631,7 @@ int hinic_init_hwif(struct hinic_hwdev *hwdev, void *cfg_reg_base, ...@@ -614,7 +631,7 @@ int hinic_init_hwif(struct hinic_hwdev *hwdev, void *cfg_reg_base,
/* disable mgmt cpu report any event */ /* disable mgmt cpu report any event */
hinic_set_pf_status(hwdev->hwif, HINIC_PF_STATUS_INIT); hinic_set_pf_status(hwdev->hwif, HINIC_PF_STATUS_INIT);
pr_info("global_func_idx: %d, func_type: %d, host_id: %d, ppf: %d, mpf: %d\n", sdk_info(hwdev->dev_hdl, "global_func_idx: %d, func_type: %d, host_id: %d, ppf: %d, mpf: %d\n",
hwif->attr.func_global_idx, hwif->attr.func_type, hwif->attr.func_global_idx, hwif->attr.func_type,
hwif->attr.pci_intf_idx, hwif->attr.ppf_idx, hwif->attr.pci_intf_idx, hwif->attr.ppf_idx,
hwif->attr.mpf_idx); hwif->attr.mpf_idx);
......
...@@ -1242,6 +1242,7 @@ static void hinic_get_stats64(struct net_device *netdev, ...@@ -1242,6 +1242,7 @@ static void hinic_get_stats64(struct net_device *netdev,
static void hinic_tx_timeout(struct net_device *netdev) static void hinic_tx_timeout(struct net_device *netdev)
{ {
struct hinic_nic_dev *nic_dev = netdev_priv(netdev); struct hinic_nic_dev *nic_dev = netdev_priv(netdev);
u16 msix_idx;
u8 q_id; u8 q_id;
HINIC_NIC_STATS_INC(nic_dev, netdev_tx_timeout); HINIC_NIC_STATS_INC(nic_dev, netdev_tx_timeout);
...@@ -1251,12 +1252,15 @@ static void hinic_tx_timeout(struct net_device *netdev) ...@@ -1251,12 +1252,15 @@ static void hinic_tx_timeout(struct net_device *netdev)
if (!netif_xmit_stopped(netdev_get_tx_queue(netdev, q_id))) if (!netif_xmit_stopped(netdev_get_tx_queue(netdev, q_id)))
continue; continue;
msix_idx = nic_dev->irq_cfg[q_id].msix_entry_idx;
nicif_info(nic_dev, drv, netdev, nicif_info(nic_dev, drv, netdev,
"txq%d: sw_pi: %d, hw_ci: %d, sw_ci: %d, napi->state: 0x%lx\n", "txq%d: sw_pi: %d, hw_ci: %d, sw_ci: %d, napi->state: 0x%lx, msix mask: %d, intr_flag: 0x%lx\n",
q_id, hinic_dbg_get_sq_pi(nic_dev->hwdev, q_id), q_id, hinic_dbg_get_sq_pi(nic_dev->hwdev, q_id),
hinic_get_sq_hw_ci(nic_dev->hwdev, q_id), hinic_get_sq_hw_ci(nic_dev->hwdev, q_id),
hinic_get_sq_local_ci(nic_dev->hwdev, q_id), hinic_get_sq_local_ci(nic_dev->hwdev, q_id),
nic_dev->irq_cfg[q_id].napi.state); nic_dev->irq_cfg[q_id].napi.state,
hinic_get_msix_state(nic_dev->hwdev, msix_idx),
nic_dev->irq_cfg[q_id].intr_flag);
} }
} }
......
...@@ -1118,6 +1118,7 @@ static int send_mbox_seg(struct hinic_mbox_func_to_func *func_to_func, ...@@ -1118,6 +1118,7 @@ static int send_mbox_seg(struct hinic_mbox_func_to_func *func_to_func,
mbox_retry_get_ack(func_to_func, done, rsp_aeq)) { mbox_retry_get_ack(func_to_func, done, rsp_aeq)) {
sdk_err(hwdev->dev_hdl, "Send mailbox segment timeout\n"); sdk_err(hwdev->dev_hdl, "Send mailbox segment timeout\n");
dump_mox_reg(hwdev); dump_mox_reg(hwdev);
hinic_dump_aeq_info(hwdev);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -1234,8 +1235,8 @@ int hinic_mbox_to_func(struct hinic_mbox_func_to_func *func_to_func, ...@@ -1234,8 +1235,8 @@ int hinic_mbox_to_func(struct hinic_mbox_func_to_func *func_to_func,
dst_func, HINIC_HWIF_DIRECT_SEND, MBOX_ACK, dst_func, HINIC_HWIF_DIRECT_SEND, MBOX_ACK,
&msg_info); &msg_info);
if (err) { if (err) {
sdk_err(func_to_func->hwdev->dev_hdl, "Send mailbox failed, msg_id: %d\n", sdk_err(func_to_func->hwdev->dev_hdl, "Send mailbox mod %d cmd 0x%x failed, msg_id: %d\n",
msg_info.msg_id); mod, cmd, msg_info.msg_id);
set_mbox_to_func_event(func_to_func, EVENT_FAIL); set_mbox_to_func_event(func_to_func, EVENT_FAIL);
goto send_err; goto send_err;
} }
...@@ -1247,7 +1248,9 @@ int hinic_mbox_to_func(struct hinic_mbox_func_to_func *func_to_func, ...@@ -1247,7 +1248,9 @@ int hinic_mbox_to_func(struct hinic_mbox_func_to_func *func_to_func,
HINIC_HWIF_DIRECT_SEND))) { HINIC_HWIF_DIRECT_SEND))) {
set_mbox_to_func_event(func_to_func, EVENT_TIMEOUT); set_mbox_to_func_event(func_to_func, EVENT_TIMEOUT);
sdk_err(func_to_func->hwdev->dev_hdl, sdk_err(func_to_func->hwdev->dev_hdl,
"Send mbox msg timeout, msg_id: %d\n", msg_info.msg_id); "Send mbox msg mod %d cmd 0x%x timeout, msg_id: %d\n",
mod, cmd, msg_info.msg_id);
hinic_dump_aeq_info(func_to_func->hwdev);
err = -ETIMEDOUT; err = -ETIMEDOUT;
goto send_err; goto send_err;
} }
...@@ -1265,7 +1268,7 @@ int hinic_mbox_to_func(struct hinic_mbox_func_to_func *func_to_func, ...@@ -1265,7 +1268,7 @@ int hinic_mbox_to_func(struct hinic_mbox_func_to_func *func_to_func,
if (buf_out && out_size) { if (buf_out && out_size) {
if (*out_size < mbox_for_resp->mbox_len) { if (*out_size < mbox_for_resp->mbox_len) {
sdk_err(func_to_func->hwdev->dev_hdl, sdk_err(func_to_func->hwdev->dev_hdl,
"Invalid response mbox message length: %d for mod %d cmd %d, should less than: %d\n", "Invalid response mbox message length: %d for mod %d cmd 0x%x, should less than: %d\n",
mbox_for_resp->mbox_len, mod, cmd, *out_size); mbox_for_resp->mbox_len, mod, cmd, *out_size);
err = -EFAULT; err = -EFAULT;
goto send_err; goto send_err;
......
...@@ -441,8 +441,8 @@ int hinic_pf_to_mgmt_sync(void *hwdev, enum hinic_mod_type mod, u8 cmd, ...@@ -441,8 +441,8 @@ int hinic_pf_to_mgmt_sync(void *hwdev, enum hinic_mod_type mod, u8 cmd,
HINIC_MSG_ACK, HINIC_MSG_DIRECT_SEND, HINIC_MSG_ACK, HINIC_MSG_DIRECT_SEND,
MSG_NO_RESP); MSG_NO_RESP);
if (err) { if (err) {
sdk_err(dev, "Failed to send sync msg to mgmt, sync_msg_id: %d\n", sdk_err(dev, "Failed to send sync msg mod %d cmd 0x%x to mgmt, sync_msg_id: %d\n",
pf_to_mgmt->sync_msg_id); mod, cmd, pf_to_mgmt->sync_msg_id);
pf_to_mgmt_send_event_set(pf_to_mgmt, SEND_EVENT_FAIL); pf_to_mgmt_send_event_set(pf_to_mgmt, SEND_EVENT_FAIL);
goto unlock_sync_msg; goto unlock_sync_msg;
} }
...@@ -451,8 +451,8 @@ int hinic_pf_to_mgmt_sync(void *hwdev, enum hinic_mod_type mod, u8 cmd, ...@@ -451,8 +451,8 @@ int hinic_pf_to_mgmt_sync(void *hwdev, enum hinic_mod_type mod, u8 cmd,
ret = wait_for_completion_timeout(recv_done, timeo); ret = wait_for_completion_timeout(recv_done, timeo);
if (!ret) { if (!ret) {
sdk_err(dev, "Mgmt response sync cmd timeout, sync_msg_id: %d\n", sdk_err(dev, "Mgmt response sync msg mod %d cmd 0x%x timeout, sync_msg_id: %d\n",
pf_to_mgmt->sync_msg_id); mod, cmd, pf_to_mgmt->sync_msg_id);
hinic_dump_aeq_info((struct hinic_hwdev *)hwdev); hinic_dump_aeq_info((struct hinic_hwdev *)hwdev);
err = -ETIMEDOUT; err = -ETIMEDOUT;
pf_to_mgmt_send_event_set(pf_to_mgmt, SEND_EVENT_TIMEOUT); pf_to_mgmt_send_event_set(pf_to_mgmt, SEND_EVENT_TIMEOUT);
...@@ -467,7 +467,7 @@ int hinic_pf_to_mgmt_sync(void *hwdev, enum hinic_mod_type mod, u8 cmd, ...@@ -467,7 +467,7 @@ int hinic_pf_to_mgmt_sync(void *hwdev, enum hinic_mod_type mod, u8 cmd,
if (buf_out && out_size) { if (buf_out && out_size) {
if (*out_size < recv_msg->msg_len) { if (*out_size < recv_msg->msg_len) {
sdk_err(dev, "Invalid response message length: %d for mod %d cmd %d from mgmt, should less than: %d\n", sdk_err(dev, "Invalid response message length: %d for mod %d cmd 0x%x from mgmt, should less than: %d\n",
recv_msg->msg_len, mod, cmd, *out_size); recv_msg->msg_len, mod, cmd, *out_size);
err = -EFAULT; err = -EFAULT;
goto unlock_sync_msg; goto unlock_sync_msg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册