qcacmn: Add support to get reo qdesc size for li & be platforms

Bifurcate the hal_get_reo_qdesc_size to corresponding lithium
or Berillium platforms.
This can handle difference, if any between them and later enhance
to set the qdesc size based on peer negotiation.
Currently for NON_QOS_TID, the BA window size is hardcoded as
256 for Li and 1024 for Be.

Also modify hal_reo_cmd_update_queue_params to accommodate higher
Block-Ack Window size. For this steal bits from pn_size and use
pn_size values as macros PN_SIZE_XX which is only 3 bits,
instead of 8bits.

Change-Id: If310175da579aa3a47a8b031a1774c6c8982d4b2
CRs-Fixed: 3125986
This commit is contained in:
Vinay Adella
2022-02-02 21:30:05 +05:30
committed by Madan Koyyalamudi
parent fae0e38eb4
commit 381d67a7a2
8 changed files with 76 additions and 47 deletions

View File

@@ -3268,12 +3268,8 @@ QDF_STATUS dp_rx_tid_setup_wifi3(struct dp_peer *peer, int tid,
* send WMI message to FW to change the REO queue descriptor in Rx * send WMI message to FW to change the REO queue descriptor in Rx
* peer entry as part of dp_rx_tid_update. * peer entry as part of dp_rx_tid_update.
*/ */
if (tid != DP_NON_QOS_TID) hw_qdesc_size = hal_get_reo_qdesc_size(soc->hal_soc,
hw_qdesc_size = hal_get_reo_qdesc_size(soc->hal_soc, ba_window_size, tid);
HAL_RX_MAX_BA_WINDOW, tid);
else
hw_qdesc_size = hal_get_reo_qdesc_size(soc->hal_soc,
ba_window_size, tid);
hw_qdesc_align = hal_get_reo_qdesc_align(soc->hal_soc); hw_qdesc_align = hal_get_reo_qdesc_align(soc->hal_soc);
/* To avoid unnecessary extra allocation for alignment, try allocating /* To avoid unnecessary extra allocation for alignment, try allocating
@@ -4047,6 +4043,9 @@ int dp_addba_resp_tx_completion_wifi3(struct cdp_soc_t *cdp_soc,
if (peer->active_ba_session_cnt == 0) { if (peer->active_ba_session_cnt == 0) {
if (rx_tid->ba_win_size > 64 && rx_tid->ba_win_size <= 256) if (rx_tid->ba_win_size > 64 && rx_tid->ba_win_size <= 256)
peer->hw_buffer_size = 256; peer->hw_buffer_size = 256;
else if (rx_tid->ba_win_size <= 1024 &&
rx_tid->ba_win_size > 256)
peer->hw_buffer_size = 1024;
else else
peer->hw_buffer_size = 64; peer->hw_buffer_size = 64;
} }
@@ -4472,12 +4471,12 @@ dp_set_pn_check_wifi3(struct cdp_soc_t *soc, uint8_t vdev_id,
case cdp_sec_type_aes_gcmp: case cdp_sec_type_aes_gcmp:
case cdp_sec_type_aes_gcmp_256: case cdp_sec_type_aes_gcmp_256:
params.u.upd_queue_params.pn_check_needed = 1; params.u.upd_queue_params.pn_check_needed = 1;
params.u.upd_queue_params.pn_size = 48; params.u.upd_queue_params.pn_size = PN_SIZE_48;
pn_size = 48; pn_size = 48;
break; break;
case cdp_sec_type_wapi: case cdp_sec_type_wapi:
params.u.upd_queue_params.pn_check_needed = 1; params.u.upd_queue_params.pn_check_needed = 1;
params.u.upd_queue_params.pn_size = 128; params.u.upd_queue_params.pn_size = PN_SIZE_128;
pn_size = 128; pn_size = 128;
if (vdev->opmode == wlan_op_mode_ap) { if (vdev->opmode == wlan_op_mode_ap) {
params.u.upd_queue_params.pn_even = 1; params.u.upd_queue_params.pn_even = 1;

View File

@@ -165,6 +165,12 @@ void hal_set_link_desc_addr_be(void *desc, uint32_t cookie,
static uint32_t hal_get_reo_qdesc_size_be(uint32_t ba_window_size, int tid) static uint32_t hal_get_reo_qdesc_size_be(uint32_t ba_window_size, int tid)
{ {
/* Hardcode the ba_window_size to HAL_RX_MAX_BA_WINDOW for
* NON_QOS_TID until HW issues are resolved.
*/
if (tid != HAL_NON_QOS_TID)
ba_window_size = HAL_RX_MAX_BA_WINDOW;
/* Return descriptor size corresponding to window size of 2 since /* Return descriptor size corresponding to window size of 2 since
* we set ba_window_size to 2 while setting up REO descriptors as * we set ba_window_size to 2 while setting up REO descriptors as
* a WAR to get 2k jump exception aggregates are received without * a WAR to get 2k jump exception aggregates are received without

View File

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -804,13 +805,6 @@ hal_reo_cmd_update_rx_queue_be(hal_ring_handle_t hal_ring_hdl,
HAL_DESC_64_SET_FIELD(reo_desc, REO_UPDATE_RX_REO_QUEUE, HAL_DESC_64_SET_FIELD(reo_desc, REO_UPDATE_RX_REO_QUEUE,
BA_WINDOW_SIZE, p->ba_window_size - 1); BA_WINDOW_SIZE, p->ba_window_size - 1);
if (p->pn_size == 24)
p->pn_size = PN_SIZE_24;
else if (p->pn_size == 48)
p->pn_size = PN_SIZE_48;
else if (p->pn_size == 128)
p->pn_size = PN_SIZE_128;
HAL_DESC_64_SET_FIELD(reo_desc, REO_UPDATE_RX_REO_QUEUE, HAL_DESC_64_SET_FIELD(reo_desc, REO_UPDATE_RX_REO_QUEUE,
PN_SIZE, p->pn_size); PN_SIZE, p->pn_size);

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -371,29 +371,13 @@ static inline
uint32_t hal_get_reo_qdesc_size(hal_soc_handle_t hal_soc_hdl, uint32_t hal_get_reo_qdesc_size(hal_soc_handle_t hal_soc_hdl,
uint32_t ba_window_size, int tid) uint32_t ba_window_size, int tid)
{ {
/* Return descriptor size corresponding to window size of 2 since struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
* we set ba_window_size to 2 while setting up REO descriptors as
* a WAR to get 2k jump exception aggregates are received without
* a BA session.
*/
if (ba_window_size <= 1) {
if (tid != HAL_NON_QOS_TID)
return sizeof(struct rx_reo_queue) +
sizeof(struct rx_reo_queue_ext);
else
return sizeof(struct rx_reo_queue);
}
if (ba_window_size <= 105) if (hal_soc->ops->hal_get_reo_qdesc_size)
return sizeof(struct rx_reo_queue) + return hal_soc->ops->hal_get_reo_qdesc_size(ba_window_size,
sizeof(struct rx_reo_queue_ext); tid);
if (ba_window_size <= 210) return sizeof(struct rx_reo_queue);
return sizeof(struct rx_reo_queue) +
(2 * sizeof(struct rx_reo_queue_ext));
return sizeof(struct rx_reo_queue) +
(3 * sizeof(struct rx_reo_queue_ext));
} }
/** /**

View File

@@ -321,8 +321,8 @@ struct hal_reo_cmd_update_queue_params {
pn_uneven:1, pn_uneven:1,
pn_hand_enab:1, pn_hand_enab:1,
ignore_ampdu:1; ignore_ampdu:1;
uint32_t ba_window_size:9, uint32_t ba_window_size:15,
pn_size:8, pn_size:2,
svld:1, svld:1,
ssn:12, ssn:12,
seq_2k_err_detect:1, seq_2k_err_detect:1,

View File

@@ -28,6 +28,12 @@
static uint32_t hal_get_reo_qdesc_size_li(uint32_t ba_window_size, int tid) static uint32_t hal_get_reo_qdesc_size_li(uint32_t ba_window_size, int tid)
{ {
/* Hardcode the ba_window_size to HAL_RX_MAX_BA_WINDOW for
* NON_QOS_TID until HW issues are resolved.
*/
if (tid != HAL_NON_QOS_TID)
ba_window_size = HAL_RX_MAX_BA_WINDOW;
/* Return descriptor size corresponding to window size of 2 since /* Return descriptor size corresponding to window size of 2 since
* we set ba_window_size to 2 while setting up REO descriptors as * we set ba_window_size to 2 while setting up REO descriptors as
* a WAR to get 2k jump exception aggregates are received without * a WAR to get 2k jump exception aggregates are received without

View File

@@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -795,13 +795,6 @@ hal_reo_cmd_update_rx_queue_li(hal_ring_handle_t hal_ring_hdl,
HAL_DESC_SET_FIELD(reo_desc, REO_UPDATE_RX_REO_QUEUE_4, HAL_DESC_SET_FIELD(reo_desc, REO_UPDATE_RX_REO_QUEUE_4,
BA_WINDOW_SIZE, p->ba_window_size - 1); BA_WINDOW_SIZE, p->ba_window_size - 1);
if (p->pn_size == 24)
p->pn_size = PN_SIZE_24;
else if (p->pn_size == 48)
p->pn_size = PN_SIZE_48;
else if (p->pn_size == 128)
p->pn_size = PN_SIZE_128;
HAL_DESC_SET_FIELD(reo_desc, REO_UPDATE_RX_REO_QUEUE_4, HAL_DESC_SET_FIELD(reo_desc, REO_UPDATE_RX_REO_QUEUE_4,
PN_SIZE, p->pn_size); PN_SIZE, p->pn_size);

View File

@@ -44,6 +44,7 @@
#include <mon_ingress_ring.h> #include <mon_ingress_ring.h>
#include <mon_destination_ring.h> #include <mon_destination_ring.h>
#endif #endif
#include "rx_reo_queue_1k.h"
#include <hal_be_rx.h> #include <hal_be_rx.h>
@@ -1631,6 +1632,50 @@ static void hal_reo_setup_9224(struct hal_soc *soc, void *reoparams)
hal_reo_shared_qaddr_init((hal_soc_handle_t)soc); hal_reo_shared_qaddr_init((hal_soc_handle_t)soc);
} }
/**
* hal_qcn9224_get_reo_qdesc_size()- Get the reo queue descriptor size
* from the give Block-Ack window size
* Return: reo queue descriptor size
*/
static uint32_t hal_qcn9224_get_reo_qdesc_size(uint32_t ba_window_size, int tid)
{
/* Hardcode the ba_window_size to HAL_RX_MAX_BA_WINDOW for
* NON_QOS_TID until HW issues are resolved.
*/
#define HAL_RX_MAX_BA_WINDOW_BE 1024
if (tid != HAL_NON_QOS_TID)
ba_window_size = HAL_RX_MAX_BA_WINDOW_BE;
/* Return descriptor size corresponding to window size of 2 since
* we set ba_window_size to 2 while setting up REO descriptors as
* a WAR to get 2k jump exception aggregates are received without
* a BA session.
*/
if (ba_window_size <= 1) {
if (tid != HAL_NON_QOS_TID)
return sizeof(struct rx_reo_queue) +
sizeof(struct rx_reo_queue_ext);
else
return sizeof(struct rx_reo_queue);
}
if (ba_window_size <= 105)
return sizeof(struct rx_reo_queue) +
sizeof(struct rx_reo_queue_ext);
if (ba_window_size <= 210)
return sizeof(struct rx_reo_queue) +
(2 * sizeof(struct rx_reo_queue_ext));
if (ba_window_size <= 256)
return sizeof(struct rx_reo_queue) +
(3 * sizeof(struct rx_reo_queue_ext));
return sizeof(struct rx_reo_queue) +
(10 * sizeof(struct rx_reo_queue_ext)) +
sizeof(struct rx_reo_queue_1k);
}
static void hal_hw_txrx_ops_attach_qcn9224(struct hal_soc *hal_soc) static void hal_hw_txrx_ops_attach_qcn9224(struct hal_soc *hal_soc)
{ {
/* init and setup */ /* init and setup */
@@ -1840,6 +1885,8 @@ static void hal_hw_txrx_ops_attach_qcn9224(struct hal_soc *hal_soc)
hal_soc->ops->hal_reo_shared_qaddr_detach = hal_reo_shared_qaddr_detach_be; hal_soc->ops->hal_reo_shared_qaddr_detach = hal_reo_shared_qaddr_detach_be;
hal_soc->ops->hal_reo_shared_qaddr_write = hal_reo_shared_qaddr_write_be; hal_soc->ops->hal_reo_shared_qaddr_write = hal_reo_shared_qaddr_write_be;
#endif #endif
/* Overwrite the default BE ops */
hal_soc->ops->hal_get_reo_qdesc_size = hal_qcn9224_get_reo_qdesc_size;
/* TX MONITOR */ /* TX MONITOR */
#ifdef QCA_MONITOR_2_0_SUPPORT #ifdef QCA_MONITOR_2_0_SUPPORT
hal_soc->ops->hal_txmon_status_parse_tlv = hal_soc->ops->hal_txmon_status_parse_tlv =