Skip to content

Commit 2dd7111

Browse files
devegowdIntelVudentz
authored andcommitted
Bluetooth: btintel_pcie: Increase the tx and rx descriptor count
This change addresses latency issues observed in HID use cases where events arrive in bursts. By increasing the Rx descriptor count to 64, the firmware can handle bursty data more effectively, reducing latency and preventing buffer overflows. Signed-off-by: Chandrashekar Devegowda <[email protected]> Signed-off-by: Kiran K <[email protected]> Fixes: c2b636b ("Bluetooth: btintel_pcie: Add support for PCIe transport") Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent daabd27 commit 2dd7111

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

drivers/bluetooth/btintel_pcie.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,8 +1783,8 @@ static int btintel_pcie_alloc(struct btintel_pcie_data *data)
17831783
* + size of index * Number of queues(2) * type of index array(4)
17841784
* + size of context information
17851785
*/
1786-
total = (sizeof(struct tfd) + sizeof(struct urbd0) + sizeof(struct frbd)
1787-
+ sizeof(struct urbd1)) * BTINTEL_DESCS_COUNT;
1786+
total = (sizeof(struct tfd) + sizeof(struct urbd0)) * BTINTEL_PCIE_TX_DESCS_COUNT;
1787+
total += (sizeof(struct frbd) + sizeof(struct urbd1)) * BTINTEL_PCIE_RX_DESCS_COUNT;
17881788

17891789
/* Add the sum of size of index array and size of ci struct */
17901790
total += (sizeof(u16) * BTINTEL_PCIE_NUM_QUEUES * 4) + sizeof(struct ctx_info);
@@ -1809,36 +1809,36 @@ static int btintel_pcie_alloc(struct btintel_pcie_data *data)
18091809
data->dma_v_addr = v_addr;
18101810

18111811
/* Setup descriptor count */
1812-
data->txq.count = BTINTEL_DESCS_COUNT;
1813-
data->rxq.count = BTINTEL_DESCS_COUNT;
1812+
data->txq.count = BTINTEL_PCIE_TX_DESCS_COUNT;
1813+
data->rxq.count = BTINTEL_PCIE_RX_DESCS_COUNT;
18141814

18151815
/* Setup tfds */
18161816
data->txq.tfds_p_addr = p_addr;
18171817
data->txq.tfds = v_addr;
18181818

1819-
p_addr += (sizeof(struct tfd) * BTINTEL_DESCS_COUNT);
1820-
v_addr += (sizeof(struct tfd) * BTINTEL_DESCS_COUNT);
1819+
p_addr += (sizeof(struct tfd) * BTINTEL_PCIE_TX_DESCS_COUNT);
1820+
v_addr += (sizeof(struct tfd) * BTINTEL_PCIE_TX_DESCS_COUNT);
18211821

18221822
/* Setup urbd0 */
18231823
data->txq.urbd0s_p_addr = p_addr;
18241824
data->txq.urbd0s = v_addr;
18251825

1826-
p_addr += (sizeof(struct urbd0) * BTINTEL_DESCS_COUNT);
1827-
v_addr += (sizeof(struct urbd0) * BTINTEL_DESCS_COUNT);
1826+
p_addr += (sizeof(struct urbd0) * BTINTEL_PCIE_TX_DESCS_COUNT);
1827+
v_addr += (sizeof(struct urbd0) * BTINTEL_PCIE_TX_DESCS_COUNT);
18281828

18291829
/* Setup FRBD*/
18301830
data->rxq.frbds_p_addr = p_addr;
18311831
data->rxq.frbds = v_addr;
18321832

1833-
p_addr += (sizeof(struct frbd) * BTINTEL_DESCS_COUNT);
1834-
v_addr += (sizeof(struct frbd) * BTINTEL_DESCS_COUNT);
1833+
p_addr += (sizeof(struct frbd) * BTINTEL_PCIE_RX_DESCS_COUNT);
1834+
v_addr += (sizeof(struct frbd) * BTINTEL_PCIE_RX_DESCS_COUNT);
18351835

18361836
/* Setup urbd1 */
18371837
data->rxq.urbd1s_p_addr = p_addr;
18381838
data->rxq.urbd1s = v_addr;
18391839

1840-
p_addr += (sizeof(struct urbd1) * BTINTEL_DESCS_COUNT);
1841-
v_addr += (sizeof(struct urbd1) * BTINTEL_DESCS_COUNT);
1840+
p_addr += (sizeof(struct urbd1) * BTINTEL_PCIE_RX_DESCS_COUNT);
1841+
v_addr += (sizeof(struct urbd1) * BTINTEL_PCIE_RX_DESCS_COUNT);
18421842

18431843
/* Setup data buffers for txq */
18441844
err = btintel_pcie_setup_txq_bufs(data, &data->txq);

drivers/bluetooth/btintel_pcie.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,11 @@ enum msix_mbox_int_causes {
154154
/* Default interrupt timeout in msec */
155155
#define BTINTEL_DEFAULT_INTR_TIMEOUT_MS 3000
156156

157-
/* The number of descriptors in TX/RX queues */
158-
#define BTINTEL_DESCS_COUNT 16
157+
/* The number of descriptors in TX queues */
158+
#define BTINTEL_PCIE_TX_DESCS_COUNT 32
159+
160+
/* The number of descriptors in RX queues */
161+
#define BTINTEL_PCIE_RX_DESCS_COUNT 64
159162

160163
/* Number of Queue for TX and RX
161164
* It indicates the index of the IA(Index Array)

0 commit comments

Comments
 (0)