mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-20 10:51:27 +00:00
216 lines
6.6 KiB
Diff
216 lines
6.6 KiB
Diff
From e8cb7ae8970b9b2726cff3734def7db66f13e898 Mon Sep 17 00:00:00 2001
|
|
From: Balamurugan Selvarajan <quic_bselvara@quicinc.com>
|
|
Date: Mon, 1 Aug 2022 14:43:55 +0530
|
|
Subject: [PATCH] ath12k: Add provision to configure rx hashmap
|
|
|
|
Currently the hashmap is set to default during REO
|
|
setup and all REO rings are equally distributed across
|
|
32 hash values.
|
|
|
|
Add provision to configure the hashmap so that destination
|
|
rings can be controlled.
|
|
|
|
echo 0x32321321 > /sys/kernel/debug/ath12k/qcn92xx hw1.0_0002:01:00.0/rx_hash
|
|
|
|
Signed-off-by: Balamurugan Selvarajan <quic_bselvara@quicinc.com>
|
|
---
|
|
drivers/net/wireless/ath/ath12k/core.h | 1 +
|
|
drivers/net/wireless/ath/ath12k/debugfs.c | 53 +++++++++++++++++++++++
|
|
drivers/net/wireless/ath/ath12k/hal.h | 1 +
|
|
drivers/net/wireless/ath/ath12k/hal_rx.c | 10 +++++
|
|
4 files changed, 65 insertions(+)
|
|
|
|
Index: backports-20220404-5.4.164-f40abb4788/drivers/net/wireless/ath/ath12k/core.h
|
|
===================================================================
|
|
--- backports-20220404-5.4.164-f40abb4788.orig/drivers/net/wireless/ath/ath12k/core.h
|
|
+++ backports-20220404-5.4.164-f40abb4788/drivers/net/wireless/ath/ath12k/core.h
|
|
@@ -1014,6 +1014,8 @@ struct ath12k_base {
|
|
struct device_node *hremote_node;
|
|
u32 host_ddr_fixed_mem_off;
|
|
bool stats_disable;
|
|
+ u32 rx_hash_ix2;
|
|
+ u32 rx_hash_ix3;
|
|
|
|
/* must be last */
|
|
u8 drv_priv[0] __aligned(sizeof(void *));
|
|
Index: backports-20220404-5.4.164-f40abb4788/drivers/net/wireless/ath/ath12k/debugfs.c
|
|
===================================================================
|
|
--- backports-20220404-5.4.164-f40abb4788.orig/drivers/net/wireless/ath/ath12k/debugfs.c
|
|
+++ backports-20220404-5.4.164-f40abb4788/drivers/net/wireless/ath/ath12k/debugfs.c
|
|
@@ -1133,6 +1133,106 @@ static const struct file_operations fops
|
|
.write = ath12k_write_stats_disable,
|
|
};
|
|
|
|
+static ssize_t ath12k_write_rx_hash_ix3(struct file *file,
|
|
+ const char __user *ubuf,
|
|
+ size_t count, loff_t *ppos)
|
|
+{
|
|
+ struct ath12k_base *ab = file->private_data;
|
|
+ struct ath12k_pdev *pdev;
|
|
+ u32 rx_hash;
|
|
+ u8 buf[128] = {0};
|
|
+ int ret, i, radioup = 0;
|
|
+
|
|
+ for (i = 0; i < ab->num_radios; i++) {
|
|
+ pdev = &ab->pdevs[i];
|
|
+ if (pdev && pdev->ar) {
|
|
+ radioup = 1;
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ if (radioup == 0) {
|
|
+ ath12k_err(ab, "radio is not up\n");
|
|
+ ret = -ENETDOWN;
|
|
+ goto exit;
|
|
+ }
|
|
+
|
|
+ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, ubuf, count);
|
|
+ if (ret < 0)
|
|
+ goto exit;
|
|
+
|
|
+ buf[ret] = '\0';
|
|
+ ret = sscanf(buf, "%x", &rx_hash);
|
|
+ if (!ret) {
|
|
+ ret = -EINVAL;
|
|
+ goto exit;
|
|
+ }
|
|
+
|
|
+ if (rx_hash != ab->rx_hash_ix3) {
|
|
+ ab->rx_hash_ix3 = rx_hash;
|
|
+ if (rx_hash)
|
|
+ ath12k_hal_reo_ring_ctrl_hash_ix3_setup(ab, rx_hash);
|
|
+ }
|
|
+ ret = count;
|
|
+exit:
|
|
+ return ret;
|
|
+}
|
|
+
|
|
+static ssize_t ath12k_write_rx_hash_ix2(struct file *file,
|
|
+ const char __user *ubuf,
|
|
+ size_t count, loff_t *ppos)
|
|
+{
|
|
+ struct ath12k_base *ab = file->private_data;
|
|
+ struct ath12k_pdev *pdev;
|
|
+ u32 rx_hash;
|
|
+ u8 buf[128] = {0};
|
|
+ int ret, i, radioup = 0;
|
|
+
|
|
+ for (i = 0; i < ab->num_radios; i++) {
|
|
+ pdev = &ab->pdevs[i];
|
|
+ if (pdev && pdev->ar) {
|
|
+ radioup = 1;
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+
|
|
+ if (radioup == 0) {
|
|
+ ath12k_err(ab, "radio is not up\n");
|
|
+ ret = -ENETDOWN;
|
|
+ goto exit;
|
|
+ }
|
|
+
|
|
+ ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, ubuf, count);
|
|
+ if (ret < 0)
|
|
+ goto exit;
|
|
+
|
|
+ buf[ret] = '\0';
|
|
+ ret = sscanf(buf, "%x", &rx_hash);
|
|
+ if (!ret) {
|
|
+ ret = -EINVAL;
|
|
+ goto exit;
|
|
+ }
|
|
+
|
|
+ if (rx_hash != ab->rx_hash_ix2) {
|
|
+ ab->rx_hash_ix2 = rx_hash;
|
|
+ if (rx_hash)
|
|
+ ath12k_hal_reo_ring_ctrl_hash_ix2_setup(ab, rx_hash);
|
|
+ }
|
|
+ ret = count;
|
|
+exit:
|
|
+ return ret;
|
|
+}
|
|
+
|
|
+static const struct file_operations fops_soc_rx_hash_ix2 = {
|
|
+ .open = simple_open,
|
|
+ .write = ath12k_write_rx_hash_ix2,
|
|
+};
|
|
+
|
|
+static const struct file_operations fops_soc_rx_hash_ix3 = {
|
|
+ .open = simple_open,
|
|
+ .write = ath12k_write_rx_hash_ix3,
|
|
+};
|
|
+
|
|
int ath12k_debugfs_pdev_create(struct ath12k_base *ab)
|
|
{
|
|
if (test_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags))
|
|
@@ -1156,6 +1256,12 @@ int ath12k_debugfs_pdev_create(struct at
|
|
debugfs_create_file("stats_disable", 0600, ab->debugfs_soc, ab,
|
|
&fops_soc_stats_disable);
|
|
|
|
+ debugfs_create_file("rx_hash_ix2", 0600, ab->debugfs_soc, ab,
|
|
+ &fops_soc_rx_hash_ix2);
|
|
+
|
|
+ debugfs_create_file("rx_hash_ix3", 0600, ab->debugfs_soc, ab,
|
|
+ &fops_soc_rx_hash_ix3);
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
Index: backports-20220404-5.4.164-f40abb4788/drivers/net/wireless/ath/ath12k/hal.h
|
|
===================================================================
|
|
--- backports-20220404-5.4.164-f40abb4788.orig/drivers/net/wireless/ath/ath12k/hal.h
|
|
+++ backports-20220404-5.4.164-f40abb4788/drivers/net/wireless/ath/ath12k/hal.h
|
|
@@ -1133,4 +1133,8 @@ u32 *ath12k_hal_srng_dst_get_next_cache_
|
|
struct hal_srng *srng);
|
|
void ath12k_hal_srng_dst_invalidate_entry(struct ath12k_base *ab,
|
|
struct hal_srng *srng, int entries);
|
|
+void ath12k_hal_reo_ring_ctrl_hash_ix3_setup(struct ath12k_base *ab,
|
|
+ u32 ring_hash_map);
|
|
+void ath12k_hal_reo_ring_ctrl_hash_ix2_setup(struct ath12k_base *ab,
|
|
+ u32 ring_hash_map);
|
|
#endif
|
|
Index: backports-20220404-5.4.164-f40abb4788/drivers/net/wireless/ath/ath12k/hal_rx.c
|
|
===================================================================
|
|
--- backports-20220404-5.4.164-f40abb4788.orig/drivers/net/wireless/ath/ath12k/hal_rx.c
|
|
+++ backports-20220404-5.4.164-f40abb4788/drivers/net/wireless/ath/ath12k/hal_rx.c
|
|
@@ -827,6 +827,24 @@ void ath12k_hal_reo_init_cmd_ring(struct
|
|
}
|
|
}
|
|
|
|
+void ath12k_hal_reo_ring_ctrl_hash_ix2_setup(struct ath12k_base *ab,
|
|
+ u32 ring_hash_map)
|
|
+{
|
|
+ u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG;
|
|
+
|
|
+ ath12k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_2,
|
|
+ ring_hash_map);
|
|
+}
|
|
+
|
|
+void ath12k_hal_reo_ring_ctrl_hash_ix3_setup(struct ath12k_base *ab,
|
|
+ u32 ring_hash_map)
|
|
+{
|
|
+ u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG;
|
|
+
|
|
+ ath12k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_3,
|
|
+ ring_hash_map);
|
|
+}
|
|
+
|
|
void ath12k_hal_reo_hw_setup(struct ath12k_base *ab, u32 ring_hash_map)
|
|
{
|
|
u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG;
|
|
@@ -857,10 +875,9 @@ void ath12k_hal_reo_hw_setup(struct ath1
|
|
ath12k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_3,
|
|
HAL_DEFAULT_VO_REO_TIMEOUT_USEC);
|
|
|
|
- ath12k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_2,
|
|
- ring_hash_map);
|
|
- ath12k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_3,
|
|
- ring_hash_map);
|
|
+ ath12k_hal_reo_ring_ctrl_hash_ix2_setup(ab, ring_hash_map);
|
|
+ ath12k_hal_reo_ring_ctrl_hash_ix3_setup(ab, ring_hash_map);
|
|
+
|
|
}
|
|
|
|
void ath12k_hal_rx_reo_ent_buf_paddr_get(void *rx_desc, dma_addr_t *paddr,
|