Search Linux Wireless

Re: [PATCH v2 2/6] mac80211: Support getting sta_info stats via ethtool.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/17/2012 06:37 PM, Johannes Berg wrote:
On Tue, 2012-04-17 at 10:46 -0700, greearb@xxxxxxxxxxxxxxx wrote:

+static void ieee80211_get_et_stats(struct wiphy *wiphy,
+				   struct net_device *dev,
+				   struct ethtool_stats *stats,
+				   u64 *data)
+{
+	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+	struct sta_info *sta;
+	struct ieee80211_local *local = sdata->local;
+
+	memset(data, 0, sizeof(u64) * STA_STATS_LEN);
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(sta,&local->sta_list, list) {

This doesn't seem right -- shouldn't it look up the BSSID or something
and only work on managed interfaces? What if there really are two
stations on this interface -- then it'll just overwrite it and return a
random station's data? That's useless.

Well, its weird at least.

But, if there are multiple stations, like for APs??, then it will
add the station's stats together.  Perhaps not horribly useful, but better
than nothing.

For managed interface, I *think* they don't have more than one station, right?

And, as for the underlying driver stats and survey stats (in later patches),
that is only probed once.  I guess if you somehow had two
stations on different channels on the same network device,
the survey stats would be a bit dodgy, but it does return
the freq for the stats in question, so at least you know
what you are getting.

Thanks,
Ben


johannes


--
Ben Greear <greearb@xxxxxxxxxxxxxxx>
Candela Technologies Inc  http://www.candelatech.com
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux