archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <>
	Emmanuel Grumbach <>,
	Luca Coelho <>
Subject: [PATCH 5/7] iwlwifi: fix tracing when tx only is enabled
Date: Wed,  5 Jul 2017 09:05:37 +0300	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

From: Emmanuel Grumbach <>

iwl_trace_data is somewhat confusing. It returns a bool
that tells if the payload of the skb should be added to
the tx_data event. If it returns false, then the payload
of the skb is added to the tx event.

The purpose is to be able to start tracing with
-e iwlwifi
and record non-data packets only which saves bandwidth.

Since EAPOLs are important, seldom and not real data
packet (despite being WiFi data packets), they are
included in tx event and thus iwl_trace_data returns false
on those. This last part was buggy, and because of that,
all the data packets were included in the tx event.

Fix that.

Fixes: 0c4cb7314d15 ("iwlwifi: tracing: decouple from mac80211")
Signed-off-by: Emmanuel Grumbach <>
Signed-off-by: Luca Coelho <>
 drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h b/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h
index 545d14b0bc92..f5c1127253cb 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h
@@ -55,8 +55,8 @@ static inline bool iwl_trace_data(struct sk_buff *skb)
 	/* also account for the RFC 1042 header, of course */
 	offs += 6;
-	return skb->len > offs + 2 &&
-	       *(__be16 *)(skb->data + offs) == cpu_to_be16(ETH_P_PAE);
+	return skb->len <= offs + 2 ||
+		*(__be16 *)(skb->data + offs) != cpu_to_be16(ETH_P_PAE);
 static inline size_t iwl_rx_trace_len(const struct iwl_trans *trans,

  parent reply	other threads:[~2017-07-05  6:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-05  6:05 [PATCH 0/7] iwlwifi: some fixes intended for 4.13 Luca Coelho
2017-07-05  6:05 ` [PATCH 1/7] iwlwifi: dvm: prevent an out of bounds access Luca Coelho
2017-07-05  6:05 ` [PATCH 2/7] iwlwifi: pcie: fix unused txq NULL pointer dereference Luca Coelho
2017-07-05  6:05 ` [PATCH 3/7] iwlwifi: mvm: fix a NULL pointer dereference of error in recovery Luca Coelho
2017-07-05  6:05 ` [PATCH 4/7] iwlwifi: missing error code in iwl_trans_pcie_alloc() Luca Coelho
2017-07-05  6:05 ` Luca Coelho [this message]
2017-07-05  6:05 ` [PATCH 6/7] iwlwifi: mvm: handle IBSS probe_queue in a few missing places Luca Coelho
2017-07-05  6:05 ` [PATCH 7/7] iwlwifi: mvm: defer setting IWL_MVM_STATUS_IN_HW_RESTART Luca Coelho

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* 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).