Commit 538f8d00 authored by Sudarsana Reddy Kalluru's avatar Sudarsana Reddy Kalluru Committed by David S. Miller

qed: Fix setting of incorrect eswitch mode.

By default, driver sets the eswitch mode incorrectly as VEB (virtual
Ethernet bridging).
Need to set VEB eswitch mode only when sriov is enabled, and it should be
to set NONE by default. The patch incorporates this change.

Fixes: 0fefbfba ("qed*: Management firmware - notifications and defaults")
Signed-off-by: default avatarSudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: default avatarMichal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bb7858ba
...@@ -1804,7 +1804,7 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params) ...@@ -1804,7 +1804,7 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params)
DP_INFO(p_hwfn, "Failed to update driver state\n"); DP_INFO(p_hwfn, "Failed to update driver state\n");
rc = qed_mcp_ov_update_eswitch(p_hwfn, p_hwfn->p_main_ptt, rc = qed_mcp_ov_update_eswitch(p_hwfn, p_hwfn->p_main_ptt,
QED_OV_ESWITCH_VEB); QED_OV_ESWITCH_NONE);
if (rc) if (rc)
DP_INFO(p_hwfn, "Failed to update eswitch mode\n"); DP_INFO(p_hwfn, "Failed to update eswitch mode\n");
} }
......
...@@ -4513,6 +4513,8 @@ static void qed_sriov_enable_qid_config(struct qed_hwfn *hwfn, ...@@ -4513,6 +4513,8 @@ static void qed_sriov_enable_qid_config(struct qed_hwfn *hwfn,
static int qed_sriov_enable(struct qed_dev *cdev, int num) static int qed_sriov_enable(struct qed_dev *cdev, int num)
{ {
struct qed_iov_vf_init_params params; struct qed_iov_vf_init_params params;
struct qed_hwfn *hwfn;
struct qed_ptt *ptt;
int i, j, rc; int i, j, rc;
if (num >= RESC_NUM(&cdev->hwfns[0], QED_VPORT)) { if (num >= RESC_NUM(&cdev->hwfns[0], QED_VPORT)) {
...@@ -4525,8 +4527,8 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num) ...@@ -4525,8 +4527,8 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num)
/* Initialize HW for VF access */ /* Initialize HW for VF access */
for_each_hwfn(cdev, j) { for_each_hwfn(cdev, j) {
struct qed_hwfn *hwfn = &cdev->hwfns[j]; hwfn = &cdev->hwfns[j];
struct qed_ptt *ptt = qed_ptt_acquire(hwfn); ptt = qed_ptt_acquire(hwfn);
/* Make sure not to use more than 16 queues per VF */ /* Make sure not to use more than 16 queues per VF */
params.num_queues = min_t(int, params.num_queues = min_t(int,
...@@ -4562,6 +4564,19 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num) ...@@ -4562,6 +4564,19 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num)
goto err; goto err;
} }
hwfn = QED_LEADING_HWFN(cdev);
ptt = qed_ptt_acquire(hwfn);
if (!ptt) {
DP_ERR(hwfn, "Failed to acquire ptt\n");
rc = -EBUSY;
goto err;
}
rc = qed_mcp_ov_update_eswitch(hwfn, ptt, QED_OV_ESWITCH_VEB);
if (rc)
DP_INFO(cdev, "Failed to update eswitch mode\n");
qed_ptt_release(hwfn, ptt);
return num; return num;
err: err:
......
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