Skip to content

Commit 6f437d4

Browse files
Mintz, Yuvaldavem330
authored andcommitted
qed: Don't use attention PTT for configuring BW
Commit 653d2ffd6405 ("qed*: Fix link indication race") introduced another race - one of the inner functions called from the link-change flow is explicitly using the slowpath context dedicated PTT instead of gaining that PTT from the caller. Since this flow can now be called from a different context as well, we're in risk of the PTT breaking. Fixes: 653d2ffd6405 ("qed*: Fix link indication race") Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent fd3c615 commit 6f437d4

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

drivers/net/ethernet/qlogic/qed/qed.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,9 @@ static inline u8 qed_concrete_to_sw_fid(struct qed_dev *cdev,
688688
#define OOO_LB_TC 9
689689

690690
int qed_configure_vport_wfq(struct qed_dev *cdev, u16 vp_id, u32 rate);
691-
void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev, u32 min_pf_rate);
691+
void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev,
692+
struct qed_ptt *p_ptt,
693+
u32 min_pf_rate);
692694

693695
void qed_clean_wfq_db(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
694696
#define QED_LEADING_HWFN(dev) (&dev->hwfns[0])

drivers/net/ethernet/qlogic/qed/qed_dev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3198,7 +3198,8 @@ int qed_configure_vport_wfq(struct qed_dev *cdev, u16 vp_id, u32 rate)
31983198
}
31993199

32003200
/* API to configure WFQ from mcp link change */
3201-
void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev, u32 min_pf_rate)
3201+
void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev,
3202+
struct qed_ptt *p_ptt, u32 min_pf_rate)
32023203
{
32033204
int i;
32043205

@@ -3212,8 +3213,7 @@ void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev, u32 min_pf_rate)
32123213
for_each_hwfn(cdev, i) {
32133214
struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
32143215

3215-
__qed_configure_vp_wfq_on_link_change(p_hwfn,
3216-
p_hwfn->p_dpc_ptt,
3216+
__qed_configure_vp_wfq_on_link_change(p_hwfn, p_ptt,
32173217
min_pf_rate);
32183218
}
32193219
}

drivers/net/ethernet/qlogic/qed/qed_mcp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,8 @@ static void qed_mcp_handle_link_change(struct qed_hwfn *p_hwfn,
679679

680680
/* Min bandwidth configuration */
681681
__qed_configure_pf_min_bandwidth(p_hwfn, p_ptt, p_link, min_bw);
682-
qed_configure_vp_wfq_on_link_change(p_hwfn->cdev, p_link->min_pf_rate);
682+
qed_configure_vp_wfq_on_link_change(p_hwfn->cdev, p_ptt,
683+
p_link->min_pf_rate);
683684

684685
p_link->an = !!(status & LINK_STATUS_AUTO_NEGOTIATE_ENABLED);
685686
p_link->an_complete = !!(status &

0 commit comments

Comments
 (0)