From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Jacob Keller <jacob.e.keller@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 09/13] i40e: properly convert le16 value to CPU format
Date: Sat, 18 Feb 2017 22:33:37 -0800 [thread overview]
Message-ID: <20170219063341.8039-10-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20170219063341.8039-1-jeffrey.t.kirsher@intel.com>
From: Jacob Keller <jacob.e.keller@intel.com>
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>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index a6dca5822cff..df78271bdce5 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1254,6 +1254,7 @@ static int i40e_correct_mac_vlan_filters(struct i40e_vsi *vsi,
struct hlist_head *tmp_del_list,
int vlan_filters)
{
+ s16 pvid = le16_to_cpu(vsi->info.pvid);
struct i40e_mac_filter *f, *add_head;
struct i40e_new_mac_filter *new;
struct hlist_node *h;
@@ -1275,8 +1276,8 @@ static int i40e_correct_mac_vlan_filters(struct i40e_vsi *vsi,
/* Update the filters about to be added in place */
hlist_for_each_entry(new, tmp_add_list, hlist) {
- if (vsi->info.pvid && new->f->vlan != vsi->info.pvid)
- new->f->vlan = vsi->info.pvid;
+ if (pvid && new->f->vlan != pvid)
+ new->f->vlan = pvid;
else if (vlan_filters && new->f->vlan == I40E_VLAN_ANY)
new->f->vlan = 0;
else if (!vlan_filters && new->f->vlan == 0)
@@ -1290,12 +1291,12 @@ static int i40e_correct_mac_vlan_filters(struct i40e_vsi *vsi,
* order to avoid duplicating code for adding the new filter
* then deleting the old filter.
*/
- if ((vsi->info.pvid && f->vlan != vsi->info.pvid) ||
+ if ((pvid && f->vlan != pvid) ||
(vlan_filters && f->vlan == I40E_VLAN_ANY) ||
(!vlan_filters && f->vlan == 0)) {
/* Determine the new vlan we will be adding */
- if (vsi->info.pvid)
- new_vlan = vsi->info.pvid;
+ if (pvid)
+ new_vlan = pvid;
else if (vlan_filters)
new_vlan = 0;
else
--
2.11.0
next prev parent reply other threads:[~2017-02-19 6:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-19 6:33 [net-next 00/13][pull request] 40GbE Intel Wired LAN Driver Updates 2017-02-18 Jeff Kirsher
2017-02-19 6:33 ` [net-next 01/13] i40e: fix disable overflow promiscuous mode Jeff Kirsher
2017-02-19 6:33 ` [net-next 02/13] i40e: enable mc magic pkt wakeup during power down Jeff Kirsher
2017-02-19 6:33 ` [net-next 03/13] i40e: remove unnecessary call to i40e_update_link_info Jeff Kirsher
2017-02-19 6:33 ` [net-next 04/13] i40evf: free rings in remove function Jeff Kirsher
2017-02-19 6:33 ` [net-next 05/13] i40evf: add comment Jeff Kirsher
2017-02-19 6:33 ` [net-next 06/13] i40e: Fix Adaptive ITR enabling Jeff Kirsher
2017-02-19 6:33 ` [net-next 07/13] i40e: refactor AQ CMD buffer debug printing Jeff Kirsher
2017-02-19 6:33 ` [net-next 08/13] i40e: convert to cpu from le16 to generate switch_id correctly Jeff Kirsher
2017-02-19 6:33 ` Jeff Kirsher [this message]
2017-02-19 6:33 ` [net-next 10/13] i40e: Error handling for link event Jeff Kirsher
2017-02-19 6:33 ` [net-next 11/13] i40e: mark the value passed to csum_replace_by_diff as __wsum Jeff Kirsher
2017-02-19 6:33 ` [net-next 12/13] i40e: remove duplicate device id from PCI table Jeff Kirsher
2017-02-19 6:33 ` [net-next 13/13] i40e: Invoke softirqs after napi_reschedule Jeff Kirsher
2017-02-20 15:31 ` [net-next 00/13][pull request] 40GbE Intel Wired LAN Driver Updates 2017-02-18 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170219063341.8039-10-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jacob.e.keller@intel.com \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).