aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2016-12-12 18:44:14 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2017-02-18 23:35:36 -0500
commit2ae0bf501425cbddc8b992a2b65fc04d911cae8c (patch)
treecfb7296fcdd4c986a3518d00efebfbfac7bd35ba
parent773d4023badee2e196f4125a94fe9d5a739720a0 (diff)
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: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_debugfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
index f1f41f12902f..267ad2588255 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@@ -974,7 +974,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
974 struct i40e_dcbx_config *r_cfg = 974 struct i40e_dcbx_config *r_cfg =
975 &pf->hw.remote_dcbx_config; 975 &pf->hw.remote_dcbx_config;
976 int i, ret; 976 int i, ret;
977 u32 switch_id; 977 u16 switch_id;
978 978
979 bw_data = kzalloc(sizeof( 979 bw_data = kzalloc(sizeof(
980 struct i40e_aqc_query_port_ets_config_resp), 980 struct i40e_aqc_query_port_ets_config_resp),
@@ -986,7 +986,8 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
986 986
987 vsi = pf->vsi[pf->lan_vsi]; 987 vsi = pf->vsi[pf->lan_vsi];
988 switch_id = 988 switch_id =
989 vsi->info.switch_id & I40E_AQ_VSI_SW_ID_MASK; 989 le16_to_cpu(vsi->info.switch_id) &
990 I40E_AQ_VSI_SW_ID_MASK;
990 991
991 ret = i40e_aq_query_port_ets_config(&pf->hw, 992 ret = i40e_aq_query_port_ets_config(&pf->hw,
992 switch_id, 993 switch_id,