Skip to content

Commit 50fdf60

Browse files
Sudarsana Reddy Kallurudavem330
authored andcommitted
qed: Fix populating the invalid stag value in multi function mode.
In multi-function mode, driver receives the stag value (outer vlan) for a PF from management FW (MFW). If the stag value is negotiated prior to the driver load, then the stag is not notified to the driver and hence driver will have the invalid stag value. The fix is to request the MFW for STAG value during the driver load time. Fixes: cac6f691 ("qed: Add support for Unified Fabric Port") Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com> Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent cf5cca6 commit 50fdf60

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@ static int qed_vf_start(struct qed_hwfn *p_hwfn,
17061706
int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params)
17071707
{
17081708
struct qed_load_req_params load_req_params;
1709-
u32 load_code, param, drv_mb_param;
1709+
u32 load_code, resp, param, drv_mb_param;
17101710
bool b_default_mtu = true;
17111711
struct qed_hwfn *p_hwfn;
17121712
int rc = 0, mfw_rc, i;
@@ -1852,6 +1852,19 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params)
18521852

18531853
if (IS_PF(cdev)) {
18541854
p_hwfn = QED_LEADING_HWFN(cdev);
1855+
1856+
/* Get pre-negotiated values for stag, bandwidth etc. */
1857+
DP_VERBOSE(p_hwfn,
1858+
QED_MSG_SPQ,
1859+
"Sending GET_OEM_UPDATES command to trigger stag/bandwidth attention handling\n");
1860+
drv_mb_param = 1 << DRV_MB_PARAM_DUMMY_OEM_UPDATES_OFFSET;
1861+
rc = qed_mcp_cmd(p_hwfn, p_hwfn->p_main_ptt,
1862+
DRV_MSG_CODE_GET_OEM_UPDATES,
1863+
drv_mb_param, &resp, &param);
1864+
if (rc)
1865+
DP_NOTICE(p_hwfn,
1866+
"Failed to send GET_OEM_UPDATES attention request\n");
1867+
18551868
drv_mb_param = STORM_FW_VERSION;
18561869
rc = qed_mcp_cmd(p_hwfn, p_hwfn->p_main_ptt,
18571870
DRV_MSG_CODE_OV_UPDATE_STORM_FW_VER,

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12414,6 +12414,7 @@ struct public_drv_mb {
1241412414
#define DRV_MSG_SET_RESOURCE_VALUE_MSG 0x35000000
1241512415
#define DRV_MSG_CODE_OV_UPDATE_WOL 0x38000000
1241612416
#define DRV_MSG_CODE_OV_UPDATE_ESWITCH_MODE 0x39000000
12417+
#define DRV_MSG_CODE_GET_OEM_UPDATES 0x41000000
1241712418

1241812419
#define DRV_MSG_CODE_BW_UPDATE_ACK 0x32000000
1241912420
#define DRV_MSG_CODE_NIG_DRAIN 0x30000000
@@ -12541,6 +12542,9 @@ struct public_drv_mb {
1254112542
#define DRV_MB_PARAM_ESWITCH_MODE_VEB 0x1
1254212543
#define DRV_MB_PARAM_ESWITCH_MODE_VEPA 0x2
1254312544

12545+
#define DRV_MB_PARAM_DUMMY_OEM_UPDATES_MASK 0x1
12546+
#define DRV_MB_PARAM_DUMMY_OEM_UPDATES_OFFSET 0
12547+
1254412548
#define DRV_MB_PARAM_SET_LED_MODE_OPER 0x0
1254512549
#define DRV_MB_PARAM_SET_LED_MODE_ON 0x1
1254612550
#define DRV_MB_PARAM_SET_LED_MODE_OFF 0x2

0 commit comments

Comments
 (0)