qcacmn: Add HTT HTC tx completion based packet free

Add CE4 tx completion for htt htc packets. current logic
uses htt htc misc list to free packets.

Change-Id: Iea15d0dba544d3cc7581b11aa7ab7e5c0024133a
CRs-Fixed: 2630768
This commit is contained in:
sandhu
2021-01-28 13:26:57 -08:00
committed by Madan Koyyalamudi
parent 273504da32
commit 9dc81d7965
5 changed files with 78 additions and 9 deletions

View File

@@ -606,6 +606,15 @@ htt_htc_pkt_pool_free(struct htt_soc *soc)
soc->htt_htc_pkt_freelist = NULL; soc->htt_htc_pkt_freelist = NULL;
} }
#ifdef ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST
static void
htt_htc_misc_pkt_list_add(struct htt_soc *soc, struct dp_htt_htc_pkt *pkt)
{
}
#else /* ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST */
/* /*
* htt_htc_misc_pkt_list_trim() - trim misc list * htt_htc_misc_pkt_list_trim() - trim misc list
* @htt_soc: HTT SOC handle * @htt_soc: HTT SOC handle
@@ -668,6 +677,8 @@ htt_htc_misc_pkt_list_add(struct htt_soc *soc, struct dp_htt_htc_pkt *pkt)
htt_htc_misc_pkt_list_trim(soc, misclist_trim_level); htt_htc_misc_pkt_list_trim(soc, misclist_trim_level);
} }
#endif /* ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST */
/** /**
* DP_HTT_SEND_HTC_PKT() - Send htt packet from host * DP_HTT_SEND_HTC_PKT() - Send htt packet from host
* @soc : HTT SOC handle * @soc : HTT SOC handle
@@ -778,6 +789,7 @@ dp_htt_h2t_send_complete_free_netbuf(
qdf_nbuf_free(netbuf); qdf_nbuf_free(netbuf);
} }
#ifdef ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST
/* /*
* dp_htt_h2t_send_complete() - H2T completion handler * dp_htt_h2t_send_complete() - H2T completion handler
* @context: Opaque context (HTT SOC handle) * @context: Opaque context (HTT SOC handle)
@@ -785,9 +797,36 @@ dp_htt_h2t_send_complete_free_netbuf(
*/ */
static void static void
dp_htt_h2t_send_complete(void *context, HTC_PACKET *htc_pkt) dp_htt_h2t_send_complete(void *context, HTC_PACKET *htc_pkt)
{
struct htt_soc *soc = (struct htt_soc *) context;
struct dp_htt_htc_pkt *htt_pkt;
qdf_nbuf_t netbuf;
htt_pkt = container_of(htc_pkt, struct dp_htt_htc_pkt, htc_pkt);
/* process (free or keep) the netbuf that held the message */
netbuf = (qdf_nbuf_t) htc_pkt->pNetBufContext;
/*
* adf sendcomplete is required for windows only
*/
/* qdf_nbuf_set_sendcompleteflag(netbuf, TRUE); */
/* free the htt_htc_pkt / HTC_PACKET object */
qdf_nbuf_free(netbuf);
htt_htc_pkt_free(soc, htt_pkt);
}
#else /* ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST */
/*
* * dp_htt_h2t_send_complete() - H2T completion handler
* * @context: Opaque context (HTT SOC handle)
* * @htc_pkt: HTC packet
* */
static void
dp_htt_h2t_send_complete(void *context, HTC_PACKET *htc_pkt)
{ {
void (*send_complete_part2)( void (*send_complete_part2)(
void *soc, QDF_STATUS status, qdf_nbuf_t msdu); void *soc, QDF_STATUS status, qdf_nbuf_t msdu);
struct htt_soc *soc = (struct htt_soc *) context; struct htt_soc *soc = (struct htt_soc *) context;
struct dp_htt_htc_pkt *htt_pkt; struct dp_htt_htc_pkt *htt_pkt;
qdf_nbuf_t netbuf; qdf_nbuf_t netbuf;
@@ -800,16 +839,18 @@ dp_htt_h2t_send_complete(void *context, HTC_PACKET *htc_pkt)
netbuf = (qdf_nbuf_t) htc_pkt->pNetBufContext; netbuf = (qdf_nbuf_t) htc_pkt->pNetBufContext;
/* /*
* adf sendcomplete is required for windows only * adf sendcomplete is required for windows only
*/ */
/* qdf_nbuf_set_sendcompleteflag(netbuf, TRUE); */ /* qdf_nbuf_set_sendcompleteflag(netbuf, TRUE); */
if (send_complete_part2) { if (send_complete_part2){
send_complete_part2( send_complete_part2(
htt_pkt->soc_ctxt, htc_pkt->Status, netbuf); htt_pkt->soc_ctxt, htc_pkt->Status, netbuf);
} }
/* free the htt_htc_pkt / HTC_PACKET object */ /* free the htt_htc_pkt / HTC_PACKET object */
htt_htc_pkt_free(soc, htt_pkt); htt_htc_pkt_free(soc, htt_pkt);
} }
#endif /* ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST */
/* /*
* htt_h2t_ver_req_msg() - Send HTT version request message to target * htt_h2t_ver_req_msg() - Send HTT version request message to target
* @htt_soc: HTT SOC handle * @htt_soc: HTT SOC handle

View File

@@ -74,6 +74,12 @@ static void hif_target_dump_access_log(void);
#define CE_ATTR_DIAG_FLAGS \ #define CE_ATTR_DIAG_FLAGS \
(CE_ATTR_FLAGS | CE_ATTR_DIAG) (CE_ATTR_FLAGS | CE_ATTR_DIAG)
#ifdef ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST
#define CE4_COMP_HTT_HTC CE_ATTR_FLAGS
#else
#define CE4_COMP_HTT_HTC (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR)
#endif
#ifdef QCN7605_SUPPORT #ifdef QCN7605_SUPPORT
#define QCN7605_CE_COUNT 9 #define QCN7605_CE_COUNT 9
@@ -1274,7 +1280,7 @@ static struct CE_attr host_ce_config_wlan_qca6490[] = {
/* host->target WMI */ /* host->target WMI */
{ /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,}, { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL,},
/* host->target HTT */ /* host->target HTT */
{ /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0, { /* CE4 */ CE4_COMP_HTT_HTC, 0,
CE_HTT_H2T_MSG_SRC_NENTRIES_QCA6490, 256, 0, NULL,}, CE_HTT_H2T_MSG_SRC_NENTRIES_QCA6490, 256, 0, NULL,},
/* target -> host PKTLOG */ /* target -> host PKTLOG */
{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,}, { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},

View File

@@ -2519,7 +2519,7 @@ void hif_send_complete_check(struct hif_opaque_softc *hif_ctx, uint8_t pipe,
1)) 1))
return; return;
} }
#if ATH_11AC_TXCOMPACT #ifdef ATH_11AC_TXCOMPACT
ce_per_engine_servicereap(scn, pipe); ce_per_engine_servicereap(scn, pipe);
#else #else
ce_per_engine_service(scn, pipe); ce_per_engine_service(scn, pipe);

View File

@@ -923,6 +923,27 @@ void ce_per_engine_servicereap(struct hif_softc *scn, unsigned int ce_id)
#endif /*ATH_11AC_TXCOMPACT */ #endif /*ATH_11AC_TXCOMPACT */
#ifdef ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST
static inline bool check_ce_id_and_epping_enabled(int CE_id, uint32_t mode)
{
// QDF_IS_EPPING_ENABLED is pre lithium feature
// CE4 completion is enabled only lithium and later
// so no need to check for EPPING
return true;
}
#else /* ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST */
static inline bool check_ce_id_and_epping_enabled(int CE_id, uint32_t mode)
{
if (CE_id != CE_HTT_H2T_MSG || QDF_IS_EPPING_ENABLED(mode))
return true;
else
return false;
}
#endif /* ENABLE_CE4_COMP_DISABLE_HTT_HTC_MISC_LIST */
/* /*
* ce_engine_service_reg: * ce_engine_service_reg:
* *
@@ -1006,8 +1027,7 @@ more_completions:
&id, &sw_idx, &hw_idx, &id, &sw_idx, &hw_idx,
&toeplitz_hash_result) == QDF_STATUS_SUCCESS) { &toeplitz_hash_result) == QDF_STATUS_SUCCESS) {
if (CE_id != CE_HTT_H2T_MSG || if (check_ce_id_and_epping_enabled(CE_id, mode)) {
QDF_IS_EPPING_ENABLED(mode)) {
qdf_spin_unlock(&CE_state->ce_index_lock); qdf_spin_unlock(&CE_state->ce_index_lock);
CE_state->send_cb((struct CE_handle *)CE_state, CE_state->send_cb((struct CE_handle *)CE_state,
CE_context, transfer_context, CE_context, transfer_context,

View File

@@ -2459,7 +2459,9 @@ QDF_STATUS htc_tx_completion_handler(void *Context,
netbuf = NULL; netbuf = NULL;
break; break;
} }
if (pPacket->PktInfo.AsTx.Tag != HTC_TX_PACKET_TAG_AUTO_PM) if (pPacket->PktInfo.AsTx.Tag != HTC_TX_PACKET_TAG_AUTO_PM &&
pPacket->PktInfo.AsTx.Tag != HTC_TX_PACKET_TAG_RUNTIME_PUT &&
pPacket->PktInfo.AsTx.Tag != HTC_TX_PACKET_TAG_RTPM_PUT_RC)
hif_pm_runtime_put(target->hif_dev, hif_pm_runtime_put(target->hif_dev,
RTPM_ID_WMI); RTPM_ID_WMI);