Skip to content

Commit

Permalink
ath10k: Report firmware mem-usage on 10.4 and 10.2 firmware.
Browse files Browse the repository at this point in the history
Probably stock firmware won't report useful values, but at least
CT 10.4 wave-2 firmware will.

Signed-off-by: Ben Greear <greearb@candelatech.com>
  • Loading branch information
greearb committed Jan 2, 2018
1 parent baa1a0d commit 2f3171d
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 6 deletions.
5 changes: 5 additions & 0 deletions ath10k-4.13/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ struct ath10k_fw_stats_pdev {
s32 mpdu_errs;
s32 rx_ovfl_errs;
s32 rx_timeout_errs;

/* Other PDEV stats */
s32 dram_free;
s32 iram_free;
s32 sram_free;
};

struct ath10k_fw_stats {
Expand Down
13 changes: 13 additions & 0 deletions ath10k-4.13/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3046,6 +3046,9 @@ static int ath10k_wmi_10_2_op_pull_fw_stats(struct ath10k *ar,
ath10k_wmi_pull_pdev_stats_base(&src->base, dst);
ath10k_wmi_pull_pdev_stats_tx(&src->tx, dst);
ath10k_wmi_pull_pdev_stats_rx(&src->rx, dst);
dst->rx_timeout_errs = __le32_to_cpu(src->pdev_rx_timeout);
dst->dram_free = __le32_to_cpu(src->mem.dram_free);
dst->iram_free = __le32_to_cpu(src->mem.iram_free);
ath10k_wmi_pull_pdev_stats_extra(&src->extra, dst);
/* FIXME: expose 10.2 specific values */

Expand Down Expand Up @@ -3219,6 +3222,9 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar,
ath10k_wmi_pull_pdev_stats_rx(&src->rx, dst);
dst->rx_timeout_errs = __le32_to_cpu(src->pdev_rx_timeout);
dst->rx_ovfl_errs = __le32_to_cpu(src->rx_ovfl_errs);
dst->dram_free = __le32_to_cpu(src->mem.dram_free);
dst->iram_free = __le32_to_cpu(src->mem.iram_free);
dst->sram_free = __le32_to_cpu(src->mem.sram_free);
ath10k_wmi_pull_pdev_stats_extra(&src->extra, dst);

list_add_tail(&dst->list, &stats->pdevs);
Expand Down Expand Up @@ -8249,6 +8255,13 @@ void ath10k_wmi_10_4_op_fw_stats_fill(struct ath10k *ar,
len += scnprintf(buf + len, buf_len - len, "%30s %10d\n",
"Num Rx Overflow errors", pdev->rx_ovfl_errs);

len += scnprintf(buf + len, buf_len - len, "%30s %10d\n",
"DRAM Free", pdev->dram_free);
len += scnprintf(buf + len, buf_len - len, "%30s %10d\n",
"IRAM Free", pdev->iram_free);
len += scnprintf(buf + len, buf_len - len, "%30s %10d\n",
"SRAM Free", pdev->sram_free);

len += scnprintf(buf + len, buf_len - len, "\n");
len += scnprintf(buf + len, buf_len - len, "%30s (%zu)\n",
"ath10k VDEV stats", num_vdevs);
Expand Down
9 changes: 7 additions & 2 deletions ath10k-4.13/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -4419,6 +4419,12 @@ struct wmi_pdev_stats_mem {
__le32 iram_free;
} __packed;

struct wmi_pdev_stats_mem_10_4 {
__le32 iram_free;
__le32 dram_free;
__le32 sram_free;
} __packed;

struct wmi_10_2_pdev_stats {
struct wmi_pdev_stats_base base;
struct wmi_pdev_stats_tx tx;
Expand All @@ -4436,8 +4442,7 @@ struct wmi_10_4_pdev_stats {
struct wmi_pdev_stats_rx rx;
__le32 pdev_rx_timeout;
__le32 rx_ovfl_errs;
struct wmi_pdev_stats_mem mem;
__le32 sram_free_size;
struct wmi_pdev_stats_mem_10_4 mem;
struct wmi_pdev_stats_extra extra;
} __packed;

Expand Down
5 changes: 5 additions & 0 deletions ath10k-4.9/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ struct ath10k_fw_stats_pdev {
s32 mpdu_errs;
s32 rx_ovfl_errs;
s32 rx_timeout_errs;

/* Other PDEV stats */
s32 dram_free;
s32 iram_free;
s32 sram_free;
};

struct ath10k_fw_stats {
Expand Down
13 changes: 13 additions & 0 deletions ath10k-4.9/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3024,6 +3024,9 @@ static int ath10k_wmi_10_2_op_pull_fw_stats(struct ath10k *ar,
ath10k_wmi_pull_pdev_stats_base(&src->base, dst);
ath10k_wmi_pull_pdev_stats_tx(&src->tx, dst);
ath10k_wmi_pull_pdev_stats_rx(&src->rx, dst);
dst->rx_timeout_errs = __le32_to_cpu(src->pdev_rx_timeout);
dst->dram_free = __le32_to_cpu(src->mem.dram_free);
dst->iram_free = __le32_to_cpu(src->mem.iram_free);
ath10k_wmi_pull_pdev_stats_extra(&src->extra, dst);
/* FIXME: expose 10.2 specific values */

Expand Down Expand Up @@ -3197,6 +3200,9 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar,
ath10k_wmi_pull_pdev_stats_rx(&src->rx, dst);
dst->rx_timeout_errs = __le32_to_cpu(src->pdev_rx_timeout);
dst->rx_ovfl_errs = __le32_to_cpu(src->rx_ovfl_errs);
dst->dram_free = __le32_to_cpu(src->mem.dram_free);
dst->iram_free = __le32_to_cpu(src->mem.iram_free);
dst->sram_free = __le32_to_cpu(src->mem.sram_free);
ath10k_wmi_pull_pdev_stats_extra(&src->extra, dst);

list_add_tail(&dst->list, &stats->pdevs);
Expand Down Expand Up @@ -8169,6 +8175,13 @@ void ath10k_wmi_10_4_op_fw_stats_fill(struct ath10k *ar,
len += scnprintf(buf + len, buf_len - len, "%30s %10d\n",
"Num Rx Overflow errors", pdev->rx_ovfl_errs);

len += scnprintf(buf + len, buf_len - len, "%30s %10d\n",
"DRAM Free", pdev->dram_free);
len += scnprintf(buf + len, buf_len - len, "%30s %10d\n",
"IRAM Free", pdev->iram_free);
len += scnprintf(buf + len, buf_len - len, "%30s %10d\n",
"SRAM Free", pdev->sram_free);

len += scnprintf(buf + len, buf_len - len, "\n");
len += scnprintf(buf + len, buf_len - len, "%30s (%zu)\n",
"ath10k VDEV stats", num_vdevs);
Expand Down
9 changes: 7 additions & 2 deletions ath10k-4.9/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -4416,6 +4416,12 @@ struct wmi_pdev_stats_mem {
__le32 iram_free;
} __packed;

struct wmi_pdev_stats_mem_10_4 {
__le32 iram_free;
__le32 dram_free;
__le32 sram_free;
} __packed;

struct wmi_10_2_pdev_stats {
struct wmi_pdev_stats_base base;
struct wmi_pdev_stats_tx tx;
Expand All @@ -4433,8 +4439,7 @@ struct wmi_10_4_pdev_stats {
struct wmi_pdev_stats_rx rx;
__le32 pdev_rx_timeout;
__le32 rx_ovfl_errs;
struct wmi_pdev_stats_mem mem;
__le32 sram_free_size;
struct wmi_pdev_stats_mem_10_4 mem;
struct wmi_pdev_stats_extra extra;
} __packed;

Expand Down
5 changes: 5 additions & 0 deletions ath10k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ struct ath10k_fw_stats_pdev {
s32 mpdu_errs;
s32 rx_ovfl_errs;
s32 rx_timeout_errs;

/* Other PDEV stats */
s32 dram_free;
s32 iram_free;
s32 sram_free;
};

struct ath10k_fw_stats {
Expand Down
13 changes: 13 additions & 0 deletions ath10k/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3065,6 +3065,9 @@ static int ath10k_wmi_10_2_4_op_pull_fw_stats(struct ath10k *ar,
ath10k_wmi_pull_pdev_stats_base(&src->base, dst);
ath10k_wmi_pull_pdev_stats_tx(&src->tx, dst);
ath10k_wmi_pull_pdev_stats_rx(&src->rx, dst);
dst->rx_timeout_errs = __le32_to_cpu(src->pdev_rx_timeout);
dst->dram_free = __le32_to_cpu(src->mem.dram_free);
dst->iram_free = __le32_to_cpu(src->mem.iram_free);
ath10k_wmi_pull_pdev_stats_extra(&src->extra, dst);
/* FIXME: expose 10.2 specific values */

Expand Down Expand Up @@ -3157,6 +3160,9 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar,
ath10k_wmi_pull_pdev_stats_rx(&src->rx, dst);
dst->rx_timeout_errs = __le32_to_cpu(src->pdev_rx_timeout);
dst->rx_ovfl_errs = __le32_to_cpu(src->rx_ovfl_errs);
dst->dram_free = __le32_to_cpu(src->mem.dram_free);
dst->iram_free = __le32_to_cpu(src->mem.iram_free);
dst->sram_free = __le32_to_cpu(src->mem.sram_free);
ath10k_wmi_pull_pdev_stats_extra(&src->extra, dst);

list_add_tail(&dst->list, &stats->pdevs);
Expand Down Expand Up @@ -7989,6 +7995,13 @@ void ath10k_wmi_10_4_op_fw_stats_fill(struct ath10k *ar,
len += scnprintf(buf + len, buf_len - len, "%30s %10d\n",
"Num Rx Overflow errors", pdev->rx_ovfl_errs);

len += scnprintf(buf + len, buf_len - len, "%30s %10d\n",
"DRAM Free", pdev->dram_free);
len += scnprintf(buf + len, buf_len - len, "%30s %10d\n",
"IRAM Free", pdev->iram_free);
len += scnprintf(buf + len, buf_len - len, "%30s %10d\n",
"SRAM Free", pdev->sram_free);

len += scnprintf(buf + len, buf_len - len, "\n");
len += scnprintf(buf + len, buf_len - len, "%30s (%zu)\n",
"ath10k VDEV stats", num_vdevs);
Expand Down
9 changes: 7 additions & 2 deletions ath10k/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -4406,6 +4406,12 @@ struct wmi_pdev_stats_mem {
__le32 iram_free;
} __packed;

struct wmi_pdev_stats_mem_10_4 {
__le32 iram_free;
__le32 dram_free;
__le32 sram_free;
} __packed;

struct wmi_10_2_pdev_stats {
struct wmi_pdev_stats_base base;
struct wmi_pdev_stats_tx tx;
Expand All @@ -4423,8 +4429,7 @@ struct wmi_10_4_pdev_stats {
struct wmi_pdev_stats_rx rx;
__le32 pdev_rx_timeout;
__le32 rx_ovfl_errs;
struct wmi_pdev_stats_mem mem;
__le32 sram_free_size;
struct wmi_pdev_stats_mem_10_4 mem;
struct wmi_pdev_stats_extra extra;
} __packed;

Expand Down

0 comments on commit 2f3171d

Please sign in to comment.