From: Luca Coelho <luca@coelho.fi>
To: johannes@sipsolutions.net
Cc: luca@coelho.fi, linux-wireless@vger.kernel.org
Subject: [PATCH 23/31] cfg80211: trace more information in assoc trace event
Date: Fri, 18 Jun 2021 13:41:48 +0300 [thread overview]
Message-ID: <iwlwifi.20210618133832.86c58fca486d.Iabd8f036d2ef1d770fd20ed3ccd149f32154f430@changeid> (raw)
In-Reply-To: <20210618104156.747775-1-luca@coelho.fi>
From: Johannes Berg <johannes.berg@intel.com>
Add more information to the assoc trace event so we can see
more precisely what's going on and what options were used.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
net/wireless/rdev-ops.h | 12 +++++++++++-
net/wireless/trace.h | 36 ++++++++++++++++++++++++++++++++++--
2 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 8b1358d04ca2..b1d37f582dc6 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -464,8 +464,18 @@ static inline int rdev_assoc(struct cfg80211_registered_device *rdev,
struct net_device *dev,
struct cfg80211_assoc_request *req)
{
+ const struct cfg80211_bss_ies *bss_ies;
int ret;
- trace_rdev_assoc(&rdev->wiphy, dev, req);
+
+ /*
+ * Note: we might trace not exactly the data that's processed,
+ * due to races and the driver/mac80211 getting a newer copy.
+ */
+ rcu_read_lock();
+ bss_ies = rcu_dereference(req->bss->ies);
+ trace_rdev_assoc(&rdev->wiphy, dev, req, bss_ies);
+ rcu_read_unlock();
+
ret = rdev->ops->assoc(&rdev->wiphy, dev, req);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 76b777d5903f..440bce5f0274 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1195,8 +1195,9 @@ TRACE_EVENT(rdev_auth,
TRACE_EVENT(rdev_assoc,
TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
- struct cfg80211_assoc_request *req),
- TP_ARGS(wiphy, netdev, req),
+ struct cfg80211_assoc_request *req,
+ const struct cfg80211_bss_ies *bss_ies),
+ TP_ARGS(wiphy, netdev, req, bss_ies),
TP_STRUCT__entry(
WIPHY_ENTRY
NETDEV_ENTRY
@@ -1204,6 +1205,17 @@ TRACE_EVENT(rdev_assoc,
MAC_ENTRY(prev_bssid)
__field(bool, use_mfp)
__field(u32, flags)
+ __dynamic_array(u8, bss_elements, bss_ies->len)
+ __field(bool, bss_elements_bcon)
+ __field(u64, bss_elements_tsf)
+ __dynamic_array(u8, elements, req->ie_len)
+ __array(u8, ht_capa, sizeof(struct ieee80211_ht_cap))
+ __array(u8, ht_capa_mask, sizeof(struct ieee80211_ht_cap))
+ __array(u8, vht_capa, sizeof(struct ieee80211_vht_cap))
+ __array(u8, vht_capa_mask, sizeof(struct ieee80211_vht_cap))
+ __dynamic_array(u8, fils_kek, req->fils_kek_len)
+ __dynamic_array(u8, fils_nonces,
+ req->fils_nonces ? 2 * FILS_NONCE_LEN : 0)
),
TP_fast_assign(
WIPHY_ASSIGN;
@@ -1215,6 +1227,26 @@ TRACE_EVENT(rdev_assoc,
MAC_ASSIGN(prev_bssid, req->prev_bssid);
__entry->use_mfp = req->use_mfp;
__entry->flags = req->flags;
+ if (bss_ies->len)
+ memcpy(__get_dynamic_array(bss_elements),
+ bss_ies->data, bss_ies->len);
+ __entry->bss_elements_bcon = bss_ies->from_beacon;
+ __entry->bss_elements_tsf = bss_ies->tsf;
+ if (req->ie)
+ memcpy(__get_dynamic_array(elements),
+ req->ie, req->ie_len);
+ memcpy(__entry->ht_capa, &req->ht_capa, sizeof(req->ht_capa));
+ memcpy(__entry->ht_capa_mask, &req->ht_capa_mask,
+ sizeof(req->ht_capa_mask));
+ memcpy(__entry->vht_capa, &req->vht_capa, sizeof(req->vht_capa));
+ memcpy(__entry->vht_capa_mask, &req->vht_capa_mask,
+ sizeof(req->vht_capa_mask));
+ if (req->fils_kek)
+ memcpy(__get_dynamic_array(fils_kek),
+ req->fils_kek, req->fils_kek_len);
+ if (req->fils_nonces)
+ memcpy(__get_dynamic_array(fils_nonces),
+ req->fils_nonces, 2 * FILS_NONCE_LEN);
),
TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT
", previous bssid: " MAC_PR_FMT ", use mfp: %s, flags: %u",
--
2.32.0
next prev parent reply other threads:[~2021-06-18 10:58 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-18 10:41 [PATCH 00/31] cfg80211/mac80211 patches from our internal tree 2021-06-18 Luca Coelho
2021-06-18 10:41 ` [PATCH 01/31] mac80211: add HE 6GHz cap IE in 6GHz band only Luca Coelho
2021-06-18 10:41 ` [PATCH 02/31] mac80211: do not add twice the HE 6GHz cap IE Luca Coelho
2021-06-18 17:14 ` Florian Fainelli
2021-06-18 20:17 ` Luca Coelho
2021-06-23 11:04 ` Luca Coelho
2021-06-18 10:41 ` [PATCH 03/31] ieee80211: define timing measurement in extended capabilities IE Luca Coelho
2021-06-18 10:41 ` [PATCH 04/31] cfg80211: make certificate generation more robust Luca Coelho
2021-06-18 10:41 ` [PATCH 05/31] mac80211: handle rate control (RC) racing with chanctx definition Luca Coelho
2021-06-18 10:41 ` [PATCH 06/31] cfg80211: avoid double free of PMSR request Luca Coelho
2021-06-18 10:41 ` [PATCH 07/31] mac80211: allow SMPS requests only in client mode Luca Coelho
2021-06-18 10:41 ` [PATCH 08/31] mac80211: free skb in WEP error case Luca Coelho
2021-06-18 10:41 ` [PATCH 09/31] mac80211: move SMPS mode setting after ieee80211_prep_connection Luca Coelho
2021-06-18 10:41 ` [PATCH 10/31] mac80211: add to bss_conf if broadcast TWT is supported Luca Coelho
2021-06-18 10:41 ` [PATCH 11/31] nl80211/cfg80211: add BSS color to NDP ranging parameters Luca Coelho
2021-06-18 10:41 ` [PATCH 12/31] mac80211: Properly WARN on HW scan before restart Luca Coelho
2021-06-18 10:41 ` [PATCH 13/31] ieee80211: add defines for HE PHY cap byte 10 Luca Coelho
2021-06-18 10:41 ` [PATCH 14/31] cfg80211: add cfg80211_any_usable_channels() Luca Coelho
2021-06-18 10:41 ` [PATCH 15/31] mac80211: conditionally advertise HE in probe requests Luca Coelho
2021-06-18 10:41 ` [PATCH 16/31] cfg80211: Support hidden AP discovery over 6GHz band Luca Coelho
2021-06-18 10:41 ` [PATCH 17/31] mac80211: always include HE 6GHz capability in probe request Luca Coelho
2021-06-18 10:41 ` [PATCH 18/31] mac80211: always include HE 6GHz capability in assoc request Luca Coelho
2021-06-18 10:41 ` [PATCH 19/31] mac80211: rearrange struct txq_info for fewer holes Luca Coelho
2021-06-18 10:41 ` [PATCH 20/31] mac80211: handle various extensible elements correctly Luca Coelho
2021-06-18 10:41 ` [PATCH 21/31] cfg80211: set custom regdomain after wiphy registration Luca Coelho
2021-06-18 10:41 ` [PATCH 22/31] mac80211: improve AP disconnect message Luca Coelho
2021-06-18 10:41 ` Luca Coelho [this message]
2021-06-18 10:41 ` [PATCH 24/31] mac80211: reset profile_periodicity/ema_ap Luca Coelho
2021-06-18 10:41 ` [PATCH 25/31] mac80211: remove use of ieee80211_get_he_sta_cap() Luca Coelho
2021-06-18 10:41 ` [PATCH 26/31] cfg80211: remove ieee80211_get_he_sta_cap() Luca Coelho
2021-06-18 10:41 ` [PATCH 27/31] cfg80211: allow advertising vendor-specific capabilities Luca Coelho
2021-06-18 10:41 ` [PATCH 28/31] mac80211: add vendor-specific capabilities to assoc request Luca Coelho
2021-06-18 10:41 ` [PATCH 29/31] mac8021: Allow probe request injection on passive non radar channels Luca Coelho
2021-06-18 10:41 ` [PATCH 30/31] mac80211: notify driver on mgd TX completion Luca Coelho
2021-06-18 10:41 ` [PATCH 31/31] cfg80211: reg: improve bad regulatory warning 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:
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=iwlwifi.20210618133832.86c58fca486d.Iabd8f036d2ef1d770fd20ed3ccd149f32154f430@changeid \
--to=luca@coelho.fi \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).