提交 2ae0bf50 编写于 作者: J Jacob Keller 提交者: Jeff Kirsher

i40e: convert to cpu from le16 to generate switch_id correctly

On Big Endian platforms we would incorrectly calculate the wrong switch
id since we did not properly convert the le16 value into CPU format.
Caught by sparse.

Change-ID: I69a2f9fa064a0a91691f7d0e6fcc206adceb8e36
Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 773d4023
...@@ -974,7 +974,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp, ...@@ -974,7 +974,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
struct i40e_dcbx_config *r_cfg = struct i40e_dcbx_config *r_cfg =
&pf->hw.remote_dcbx_config; &pf->hw.remote_dcbx_config;
int i, ret; int i, ret;
u32 switch_id; u16 switch_id;
bw_data = kzalloc(sizeof( bw_data = kzalloc(sizeof(
struct i40e_aqc_query_port_ets_config_resp), struct i40e_aqc_query_port_ets_config_resp),
...@@ -986,7 +986,8 @@ static ssize_t i40e_dbg_command_write(struct file *filp, ...@@ -986,7 +986,8 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
vsi = pf->vsi[pf->lan_vsi]; vsi = pf->vsi[pf->lan_vsi];
switch_id = switch_id =
vsi->info.switch_id & I40E_AQ_VSI_SW_ID_MASK; le16_to_cpu(vsi->info.switch_id) &
I40E_AQ_VSI_SW_ID_MASK;
ret = i40e_aq_query_port_ets_config(&pf->hw, ret = i40e_aq_query_port_ets_config(&pf->hw,
switch_id, switch_id,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册