Commit 92fae6fb authored by Michal Kalderon's avatar Michal Kalderon Committed by David S. Miller

qed: FW 8.42.2.0 Queue Manager changes

This patch contains changes in initialization and usage of the QM blocks.
Instead of setting a rate limiter per vport the rate limiters are now a
global resource and set independentaly.

The patch also contains a field name change:
vport_wfq which is part of vport_params was renamed to wfq as the vport
prefix is redundant.
Signed-off-by: default avatarAriel Elior <ariel.elior@marvell.com>
Signed-off-by: default avatarMichal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6aebde8d
...@@ -1522,7 +1522,6 @@ void qed_qm_init_pf(struct qed_hwfn *p_hwfn, ...@@ -1522,7 +1522,6 @@ void qed_qm_init_pf(struct qed_hwfn *p_hwfn,
params.num_vports = qm_info->num_vports; params.num_vports = qm_info->num_vports;
params.pf_wfq = qm_info->pf_wfq; params.pf_wfq = qm_info->pf_wfq;
params.pf_rl = qm_info->pf_rl; params.pf_rl = qm_info->pf_rl;
params.link_speed = p_link->speed;
params.pq_params = qm_info->qm_pq_params; params.pq_params = qm_info->qm_pq_params;
params.vport_params = qm_info->qm_vport_params; params.vport_params = qm_info->qm_vport_params;
......
...@@ -1571,7 +1571,7 @@ static void qed_init_qm_vport_params(struct qed_hwfn *p_hwfn) ...@@ -1571,7 +1571,7 @@ static void qed_init_qm_vport_params(struct qed_hwfn *p_hwfn)
/* all vports participate in weighted fair queueing */ /* all vports participate in weighted fair queueing */
for (i = 0; i < qed_init_qm_get_num_vports(p_hwfn); i++) for (i = 0; i < qed_init_qm_get_num_vports(p_hwfn); i++)
qm_info->qm_vport_params[i].vport_wfq = 1; qm_info->qm_vport_params[i].wfq = 1;
} }
/* initialize qm port params */ /* initialize qm port params */
...@@ -2034,9 +2034,8 @@ static void qed_dp_init_qm_params(struct qed_hwfn *p_hwfn) ...@@ -2034,9 +2034,8 @@ static void qed_dp_init_qm_params(struct qed_hwfn *p_hwfn)
vport = &(qm_info->qm_vport_params[i]); vport = &(qm_info->qm_vport_params[i]);
DP_VERBOSE(p_hwfn, DP_VERBOSE(p_hwfn,
NETIF_MSG_HW, NETIF_MSG_HW,
"vport idx %d, vport_rl %d, wfq %d, first_tx_pq_id [ ", "vport idx %d, wfq %d, first_tx_pq_id [ ",
qm_info->start_vport + i, qm_info->start_vport + i, vport->wfq);
vport->vport_rl, vport->vport_wfq);
for (tc = 0; tc < NUM_OF_TCS; tc++) for (tc = 0; tc < NUM_OF_TCS; tc++)
DP_VERBOSE(p_hwfn, DP_VERBOSE(p_hwfn,
NETIF_MSG_HW, NETIF_MSG_HW,
...@@ -2049,11 +2048,11 @@ static void qed_dp_init_qm_params(struct qed_hwfn *p_hwfn) ...@@ -2049,11 +2048,11 @@ static void qed_dp_init_qm_params(struct qed_hwfn *p_hwfn)
pq = &(qm_info->qm_pq_params[i]); pq = &(qm_info->qm_pq_params[i]);
DP_VERBOSE(p_hwfn, DP_VERBOSE(p_hwfn,
NETIF_MSG_HW, NETIF_MSG_HW,
"pq idx %d, port %d, vport_id %d, tc %d, wrr_grp %d, rl_valid %d\n", "pq idx %d, port %d, vport_id %d, tc %d, wrr_grp %d, rl_valid %d rl_id %d\n",
qm_info->start_pq + i, qm_info->start_pq + i,
pq->port_id, pq->port_id,
pq->vport_id, pq->vport_id,
pq->tc_id, pq->wrr_group, pq->rl_valid); pq->tc_id, pq->wrr_group, pq->rl_valid, pq->rl_id);
} }
} }
...@@ -2623,7 +2622,7 @@ static int qed_hw_init_common(struct qed_hwfn *p_hwfn, ...@@ -2623,7 +2622,7 @@ static int qed_hw_init_common(struct qed_hwfn *p_hwfn,
params.max_phys_tcs_per_port = qm_info->max_phys_tcs_per_port; params.max_phys_tcs_per_port = qm_info->max_phys_tcs_per_port;
params.pf_rl_en = qm_info->pf_rl_en; params.pf_rl_en = qm_info->pf_rl_en;
params.pf_wfq_en = qm_info->pf_wfq_en; params.pf_wfq_en = qm_info->pf_wfq_en;
params.vport_rl_en = qm_info->vport_rl_en; params.global_rl_en = qm_info->vport_rl_en;
params.vport_wfq_en = qm_info->vport_wfq_en; params.vport_wfq_en = qm_info->vport_wfq_en;
params.port_params = qm_info->qm_port_params; params.port_params = qm_info->qm_port_params;
...@@ -5087,11 +5086,11 @@ static void qed_configure_wfq_for_all_vports(struct qed_hwfn *p_hwfn, ...@@ -5087,11 +5086,11 @@ static void qed_configure_wfq_for_all_vports(struct qed_hwfn *p_hwfn,
for (i = 0; i < p_hwfn->qm_info.num_vports; i++) { for (i = 0; i < p_hwfn->qm_info.num_vports; i++) {
u32 wfq_speed = p_hwfn->qm_info.wfq_data[i].min_speed; u32 wfq_speed = p_hwfn->qm_info.wfq_data[i].min_speed;
vport_params[i].vport_wfq = (wfq_speed * QED_WFQ_UNIT) / vport_params[i].wfq = (wfq_speed * QED_WFQ_UNIT) /
min_pf_rate; min_pf_rate;
qed_init_vport_wfq(p_hwfn, p_ptt, qed_init_vport_wfq(p_hwfn, p_ptt,
vport_params[i].first_tx_pq_id, vport_params[i].first_tx_pq_id,
vport_params[i].vport_wfq); vport_params[i].wfq);
} }
} }
...@@ -5102,7 +5101,7 @@ static void qed_init_wfq_default_param(struct qed_hwfn *p_hwfn, ...@@ -5102,7 +5101,7 @@ static void qed_init_wfq_default_param(struct qed_hwfn *p_hwfn,
int i; int i;
for (i = 0; i < p_hwfn->qm_info.num_vports; i++) for (i = 0; i < p_hwfn->qm_info.num_vports; i++)
p_hwfn->qm_info.qm_vport_params[i].vport_wfq = 1; p_hwfn->qm_info.qm_vport_params[i].wfq = 1;
} }
static void qed_disable_wfq_for_all_vports(struct qed_hwfn *p_hwfn, static void qed_disable_wfq_for_all_vports(struct qed_hwfn *p_hwfn,
...@@ -5118,7 +5117,7 @@ static void qed_disable_wfq_for_all_vports(struct qed_hwfn *p_hwfn, ...@@ -5118,7 +5117,7 @@ static void qed_disable_wfq_for_all_vports(struct qed_hwfn *p_hwfn,
qed_init_wfq_default_param(p_hwfn, min_pf_rate); qed_init_wfq_default_param(p_hwfn, min_pf_rate);
qed_init_vport_wfq(p_hwfn, p_ptt, qed_init_vport_wfq(p_hwfn, p_ptt,
vport_params[i].first_tx_pq_id, vport_params[i].first_tx_pq_id,
vport_params[i].vport_wfq); vport_params[i].wfq);
} }
} }
......
...@@ -2630,13 +2630,18 @@ struct init_nig_pri_tc_map_req { ...@@ -2630,13 +2630,18 @@ struct init_nig_pri_tc_map_req {
struct init_nig_pri_tc_map_entry pri[NUM_OF_VLAN_PRIORITIES]; struct init_nig_pri_tc_map_entry pri[NUM_OF_VLAN_PRIORITIES];
}; };
/* QM per global RL init parameters */
struct init_qm_global_rl_params {
u32 rate_limit;
};
/* QM per-port init parameters */ /* QM per-port init parameters */
struct init_qm_port_params { struct init_qm_port_params {
u8 active; u16 active_phys_tcs;
u8 active_phys_tcs;
u16 num_pbf_cmd_lines; u16 num_pbf_cmd_lines;
u16 num_btb_blocks; u16 num_btb_blocks;
u16 reserved; u8 active;
u8 reserved;
}; };
/* QM per-PQ init parameters */ /* QM per-PQ init parameters */
...@@ -2645,15 +2650,14 @@ struct init_qm_pq_params { ...@@ -2645,15 +2650,14 @@ struct init_qm_pq_params {
u8 tc_id; u8 tc_id;
u8 wrr_group; u8 wrr_group;
u8 rl_valid; u8 rl_valid;
u16 rl_id;
u8 port_id; u8 port_id;
u8 reserved0; u8 reserved;
u16 reserved1;
}; };
/* QM per-vport init parameters */ /* QM per-vport init parameters */
struct init_qm_vport_params { struct init_qm_vport_params {
u32 vport_rl; u16 wfq;
u16 vport_wfq;
u16 first_tx_pq_id[NUM_OF_TCS]; u16 first_tx_pq_id[NUM_OF_TCS];
}; };
...@@ -3982,7 +3986,7 @@ struct qed_qm_common_rt_init_params { ...@@ -3982,7 +3986,7 @@ struct qed_qm_common_rt_init_params {
u8 max_phys_tcs_per_port; u8 max_phys_tcs_per_port;
bool pf_rl_en; bool pf_rl_en;
bool pf_wfq_en; bool pf_wfq_en;
bool vport_rl_en; bool global_rl_en;
bool vport_wfq_en; bool vport_wfq_en;
struct init_qm_port_params *port_params; struct init_qm_port_params *port_params;
}; };
...@@ -4001,11 +4005,10 @@ struct qed_qm_pf_rt_init_params { ...@@ -4001,11 +4005,10 @@ struct qed_qm_pf_rt_init_params {
u16 start_pq; u16 start_pq;
u16 num_pf_pqs; u16 num_pf_pqs;
u16 num_vf_pqs; u16 num_vf_pqs;
u8 start_vport; u16 start_vport;
u8 num_vports; u16 num_vports;
u16 pf_wfq; u16 pf_wfq;
u32 pf_rl; u32 pf_rl;
u32 link_speed;
struct init_qm_pq_params *pq_params; struct init_qm_pq_params *pq_params;
struct init_qm_vport_params *vport_params; struct init_qm_vport_params *vport_params;
}; };
...@@ -4054,22 +4057,22 @@ int qed_init_pf_rl(struct qed_hwfn *p_hwfn, ...@@ -4054,22 +4057,22 @@ int qed_init_pf_rl(struct qed_hwfn *p_hwfn,
*/ */
int qed_init_vport_wfq(struct qed_hwfn *p_hwfn, int qed_init_vport_wfq(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, struct qed_ptt *p_ptt,
u16 first_tx_pq_id[NUM_OF_TCS], u16 vport_wfq); u16 first_tx_pq_id[NUM_OF_TCS], u16 wfq);
/** /**
* @brief qed_init_vport_rl - Initializes the rate limit of the specified VPORT * @brief qed_init_global_rl - Initializes the rate limit of the specified
* rate limiter
* *
* @param p_hwfn * @param p_hwfn
* @param p_ptt - ptt window used for writing the registers * @param p_ptt - ptt window used for writing the registers
* @param vport_id - VPORT ID * @param rl_id - RL ID
* @param vport_rl - rate limit in Mb/sec units * @param rate_limit - rate limit in Mb/sec units
* @param link_speed - link speed in Mbps.
* *
* @return 0 on success, -1 on error. * @return 0 on success, -1 on error.
*/ */
int qed_init_vport_rl(struct qed_hwfn *p_hwfn, int qed_init_global_rl(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, struct qed_ptt *p_ptt,
u8 vport_id, u32 vport_rl, u32 link_speed); u16 rl_id, u32 rate_limit);
/** /**
* @brief qed_send_qm_stop_cmd Sends a stop command to the QM * @brief qed_send_qm_stop_cmd Sends a stop command to the QM
......
...@@ -4354,9 +4354,9 @@ qed_iov_bulletin_get_forced_vlan(struct qed_hwfn *p_hwfn, u16 rel_vf_id) ...@@ -4354,9 +4354,9 @@ qed_iov_bulletin_get_forced_vlan(struct qed_hwfn *p_hwfn, u16 rel_vf_id)
static int qed_iov_configure_tx_rate(struct qed_hwfn *p_hwfn, static int qed_iov_configure_tx_rate(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt, int vfid, int val) struct qed_ptt *p_ptt, int vfid, int val)
{ {
struct qed_mcp_link_state *p_link;
struct qed_vf_info *vf; struct qed_vf_info *vf;
u8 abs_vp_id = 0; u8 abs_vp_id = 0;
u16 rl_id;
int rc; int rc;
vf = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true); vf = qed_iov_get_vf_info(p_hwfn, (u16)vfid, true);
...@@ -4367,10 +4367,8 @@ static int qed_iov_configure_tx_rate(struct qed_hwfn *p_hwfn, ...@@ -4367,10 +4367,8 @@ static int qed_iov_configure_tx_rate(struct qed_hwfn *p_hwfn,
if (rc) if (rc)
return rc; return rc;
p_link = &QED_LEADING_HWFN(p_hwfn->cdev)->mcp_info->link_output; rl_id = abs_vp_id; /* The "rl_id" is set as the "vport_id" */
return qed_init_global_rl(p_hwfn, p_ptt, rl_id, (u32)val);
return qed_init_vport_rl(p_hwfn, p_ptt, abs_vp_id, (u32)val,
p_link->speed);
} }
static int static int
......
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