Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i40e: properly convert le16 value to CPU format

This ensures that the pvid which is stored in __le16 format is converted
to the CPU format. This will fix comparison issues on Big Endian
platforms.

Change-ID: I92c80d1315dc2a0f9f095d5a0c48d461beb052ed
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>

authored by

Jacob Keller and committed by
Jeff Kirsher
5cb25901 2ae0bf50

+6 -5
+6 -5
drivers/net/ethernet/intel/i40e/i40e_main.c
··· 1254 1254 struct hlist_head *tmp_del_list, 1255 1255 int vlan_filters) 1256 1256 { 1257 + s16 pvid = le16_to_cpu(vsi->info.pvid); 1257 1258 struct i40e_mac_filter *f, *add_head; 1258 1259 struct i40e_new_mac_filter *new; 1259 1260 struct hlist_node *h; ··· 1276 1275 1277 1276 /* Update the filters about to be added in place */ 1278 1277 hlist_for_each_entry(new, tmp_add_list, hlist) { 1279 - if (vsi->info.pvid && new->f->vlan != vsi->info.pvid) 1280 - new->f->vlan = vsi->info.pvid; 1278 + if (pvid && new->f->vlan != pvid) 1279 + new->f->vlan = pvid; 1281 1280 else if (vlan_filters && new->f->vlan == I40E_VLAN_ANY) 1282 1281 new->f->vlan = 0; 1283 1282 else if (!vlan_filters && new->f->vlan == 0) ··· 1291 1290 * order to avoid duplicating code for adding the new filter 1292 1291 * then deleting the old filter. 1293 1292 */ 1294 - if ((vsi->info.pvid && f->vlan != vsi->info.pvid) || 1293 + if ((pvid && f->vlan != pvid) || 1295 1294 (vlan_filters && f->vlan == I40E_VLAN_ANY) || 1296 1295 (!vlan_filters && f->vlan == 0)) { 1297 1296 /* Determine the new vlan we will be adding */ 1298 - if (vsi->info.pvid) 1299 - new_vlan = vsi->info.pvid; 1297 + if (pvid) 1298 + new_vlan = pvid; 1300 1299 else if (vlan_filters) 1301 1300 new_vlan = 0; 1302 1301 else