Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alice Michael <alice.michael@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [next PATCH S95 06/12] i40e: fix condition of WARN_ONCE for stat strings
Date: Mon, 20 Aug 2018 08:12:27 -0700	[thread overview]
Message-ID: <20180820151233.14629-6-alice.michael@intel.com> (raw)
In-Reply-To: <20180820151233.14629-1-alice.michael@intel.com>

From: Jacob Keller <jacob.e.keller@intel.com>

Commit 9b10df596bd4 ("i40e: use WARN_ONCE to replace the commented
BUG_ON size check") introduced a warning check to make sure
that the size of the stat strings was always the expected value. This
code accidentally inverted the check of the data pointer. Fix this so
that we accurately count the size of the stats we copied in.

This fixes an erroneous WARN kernel splat that occurs when requesting
ethtool statistics.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index ecc30524..3ef9069 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -1863,7 +1863,7 @@ static void i40e_get_stat_strings(struct net_device *netdev, u8 *data)
 	for (i = 0; i < I40E_MAX_USER_PRIORITY; i++)
 		i40e_add_stat_strings(&data, i40e_gstrings_pfc_stats, i);
 
-	WARN_ONCE(p - data != i40e_get_stats_count(netdev) * ETH_GSTRING_LEN,
+	WARN_ONCE(data - p != i40e_get_stats_count(netdev) * ETH_GSTRING_LEN,
 		  "stat strings count mismatch!");
 }
 
-- 
2.9.5


  parent reply	other threads:[~2018-08-20 15:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20 15:12 [Intel-wired-lan] [next PATCH S95 01/12] i40e: Fix VF's link state notification Alice Michael
2018-08-20 15:12 ` [Intel-wired-lan] [next PATCH S95 02/12] i40e: convert queue stats to i40e_stats array Alice Michael
2018-08-21 19:16   ` Bowers, AndrewX
2018-08-20 15:12 ` [Intel-wired-lan] [next PATCH S95 03/12] i40e: move ethtool stats boiler plate code to i40e_ethtool_stats.h Alice Michael
2018-08-21 19:17   ` Bowers, AndrewX
2018-08-20 15:12 ` [Intel-wired-lan] [next PATCH S95 04/12] i40evf: update ethtool stats code and use helper functions Alice Michael
2018-08-21 19:19   ` Bowers, AndrewX
2018-08-20 15:12 ` [Intel-wired-lan] [next PATCH S95 05/12] i40evf: Change a VF mac without reloading the VF driver Alice Michael
2018-08-21 19:29   ` Bowers, AndrewX
2018-08-29 16:34     ` Bowers, AndrewX
2018-08-20 15:12 ` Alice Michael [this message]
2018-08-21 19:36   ` [Intel-wired-lan] [next PATCH S95 06/12] i40e: fix condition of WARN_ONCE for stat strings Bowers, AndrewX
2018-08-24  1:50   ` Mauro Rodrigues
2018-08-20 15:12 ` [Intel-wired-lan] [next PATCH S95 07/12] i40e: Unset promiscuous settings on VF reset Alice Michael
2018-08-21 16:28   ` Shannon Nelson
2018-08-29 20:53   ` Bowers, AndrewX
2018-08-20 15:12 ` [Intel-wired-lan] [next PATCH S95 08/12] i40evf: Validate the number of queues a PF sends Alice Michael
2018-08-29 20:54   ` Bowers, AndrewX
2018-08-20 15:12 ` [Intel-wired-lan] [next PATCH S95 09/12] i40e: use correct length for strncpy Alice Michael
2018-08-21 16:28   ` Shannon Nelson
2018-08-23 16:11   ` Bowers, AndrewX
2018-08-20 15:12 ` [Intel-wired-lan] [next PATCH S95 10/12] i40evf: set IFF_UNICAST_FLT flag for the vf Alice Michael
2018-08-21 19:41   ` Bowers, AndrewX
2018-08-20 15:12 ` [Intel-wired-lan] [next PATCH S95 11/12] virtchnl: use u8 type for a field in the virtchnl_filter struct Alice Michael
2018-08-21 19:41   ` Bowers, AndrewX
2018-08-20 15:12 ` [Intel-wired-lan] [next PATCH S95 12/12] i40e: static analysis report from community Alice Michael
2018-08-21 19:42   ` Bowers, AndrewX
2018-08-21 16:27 ` [Intel-wired-lan] [next PATCH S95 01/12] i40e: Fix VF's link state notification Shannon Nelson
2018-08-29 20:53 ` Bowers, AndrewX

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=20180820151233.14629-6-alice.michael@intel.com \
    --to=alice.michael@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /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