All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Cc: "John W . Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org,
	"Luis R . Rodriguez" <rodrigue@qca.qualcomm.com>,
	Kalle Valo <kvalo@qca.qualcomm.com>
Subject: Re: [PATCH 1/2] wireless: expand per-station byte counters to 64bit
Date: Mon, 04 Feb 2013 16:36:59 +0100	[thread overview]
Message-ID: <1359992219.10311.16.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1359978792-7121-2-git-send-email-qca_vkondrat@qca.qualcomm.com>

On Mon, 2013-02-04 at 13:53 +0200, Vladimir Kondratiev wrote:
> In per-station statistics, present 32bit counters are too small
> for practical purposes - with gigabit speeds, it get overlapped
> every few seconds.
> 
> Expand counters in the struct station_info to be 64-bit.
> Driver can still fill only 32-bit and indicate in @filled
> only bits like STATION_INFO_[TR]X_BYTES; in case driver provides
> full 64-bit counter, it should also set in @filled
> bit STATION_INFO_[TR]RX_BYTES64

Applied, but ...

> Netlink sends both 32-bit and 64-bit counters, if present, to not break
> user space.

You didn't quite implement that, so I changed it:


> +	if ((sinfo->filled & STATION_INFO_RX_BYTES64) &&
> +	    nla_put_u64(msg, NL80211_STA_INFO_RX_BYTES64,
> +			sinfo->rx_bytes))
> +		goto nla_put_failure;
>[...]

+       if (sinfo->filled & STATION_INFO_RX_BYTES64) {
+               if (nla_put_u64(msg, NL80211_STA_INFO_RX_BYTES64,
+                               sinfo->rx_bytes))
+                       goto nla_put_failure;
+               if (sinfo->rx_bytes <= UINT_MAX &&
+                   nla_put_u32(msg, NL80211_STA_INFO_RX_BYTES,
+                               (u32)sinfo->rx_bytes))
+                       goto nla_put_failure;
+       }
+       if (sinfo->filled & STATION_INFO_TX_BYTES64) {
+               if (nla_put_u64(msg, NL80211_STA_INFO_TX_BYTES64,
+                               sinfo->tx_bytes))
+                       goto nla_put_failure;
+               if (sinfo->tx_bytes <= UINT_MAX &&
+                   nla_put_u32(msg, NL80211_STA_INFO_TX_BYTES,
+                               (u32)sinfo->tx_bytes))
+                       goto nla_put_failure;
+       }


johannes


  reply	other threads:[~2013-02-04 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-04 11:53 [PATCH 0/2] 64-bit counters in the struct station_info Vladimir Kondratiev
2013-02-04 11:53 ` [PATCH 1/2] wireless: expand per-station byte counters to 64bit Vladimir Kondratiev
2013-02-04 15:36   ` Johannes Berg [this message]
2013-02-04 17:48     ` Johannes Berg
2013-02-04 11:53 ` [PATCH 2/2] ath6kl: provide 64-bit per-station byte counters Vladimir Kondratiev
2013-02-05  9:48   ` [PATCH v2] " Vladimir Kondratiev
2013-03-05  7:20   ` [PATCH 2/2] " Kalle Valo

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=1359992219.10311.16.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=qca_vkondrat@qca.qualcomm.com \
    --cc=rodrigue@qca.qualcomm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.