diff options
| author | Manjunathappa Prakash <prakashpm@codeaurora.org> | 2016-10-13 14:46:49 -0700 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-11-15 00:35:23 -0800 |
| commit | 3c92df03f50eace8ba9baab6012eee0c513afe9b (patch) | |
| tree | 92296b9edc20b66c0f84d069240fd219943e39fe /core/dp | |
| parent | 765c0f5e1ba0851f20cef59bbdaf2979192bae46 (diff) | |
qcacld-3.0: Add changes for per NAPI or per Rx CE LRO manager
Make changes for per per Rx context LRO manager, this addresses
all parallel Rx concurrency issues. There by removes all the contention.
Change-Id: I3609bcdb67e0046fac5a22bba9cb6a5eb4bcbe84
CRs-Fixed: 1079320
Diffstat (limited to 'core/dp')
| -rw-r--r-- | core/dp/htt/htt_rx.c | 5 | ||||
| -rw-r--r-- | core/dp/txrx/ol_txrx.c | 79 | ||||
| -rw-r--r-- | core/dp/txrx/ol_txrx_types.h | 2 |
3 files changed, 58 insertions, 28 deletions
diff --git a/core/dp/htt/htt_rx.c b/core/dp/htt/htt_rx.c index b3bae10b0a6a..1d131e40cb80 100644 --- a/core/dp/htt/htt_rx.c +++ b/core/dp/htt/htt_rx.c @@ -1994,14 +1994,16 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, qdf_nbuf_t msdu, next, prev = NULL; uint8_t *rx_ind_data; uint32_t *msg_word; + uint32_t rx_ctx_id; unsigned int msdu_count = 0; uint8_t offload_ind, frag_ind; - struct htt_host_rx_desc_base *rx_desc; uint8_t peer_id; + struct htt_host_rx_desc_base *rx_desc; HTT_ASSERT1(htt_rx_in_order_ring_elems(pdev) != 0); rx_ind_data = qdf_nbuf_data(rx_ind_msg); + rx_ctx_id = QDF_NBUF_CB_RX_CTX_ID(rx_ind_msg); msg_word = (uint32_t *) rx_ind_data; peer_id = HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET( *(u_int32_t *)rx_ind_data); @@ -2059,6 +2061,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, QDF_NBUF_CB_DP_TRACE_PRINT(msdu) = false; qdf_dp_trace_set_track(msdu, QDF_RX); QDF_NBUF_CB_TX_PACKET_TRACK(msdu) = QDF_NBUF_TX_PKT_DATA_TRACK; + QDF_NBUF_CB_RX_CTX_ID(msdu) = rx_ctx_id; ol_rx_log_packet(pdev, peer_id, msdu); DPTRACE(qdf_dp_trace(msdu, QDF_DP_TRACE_RX_HTT_PACKET_PTR_RECORD, diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 9c781637813c..60a806839ac4 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -70,6 +70,7 @@ #include <ol_tx_queue.h> #include <ol_tx_sched.h> /* ol_tx_sched_attach, etc. */ #include <ol_txrx.h> +#include <ol_txrx_types.h> #include <cdp_txrx_flow_ctrl_legacy.h> #include <cdp_txrx_ipa.h> #include "wma.h" @@ -4639,7 +4640,7 @@ void ol_txrx_lro_flush_handler(void *context, void *rxpkt, uint16_t staid) { - ol_txrx_pdev_handle pdev = (ol_txrx_pdev_handle)context; + ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX); if (qdf_unlikely(!pdev)) { QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, @@ -4649,7 +4650,7 @@ void ol_txrx_lro_flush_handler(void *context, } if (pdev->lro_info.lro_flush_cb) - pdev->lro_info.lro_flush_cb(pdev->lro_info.lro_data); + pdev->lro_info.lro_flush_cb(context); else QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, "%s: lro_flush_cb NULL", __func__); @@ -4668,13 +4669,13 @@ void ol_txrx_lro_flush(void *data) { p_cds_sched_context sched_ctx = get_cds_sched_ctxt(); struct cds_ol_rx_pkt *pkt; - ol_txrx_pdev_handle pdev = (ol_txrx_pdev_handle)data; + ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX); if (qdf_unlikely(!sched_ctx)) return; if (!ol_cfg_is_rx_thread_enabled(pdev->ctrl_pdev)) { - ol_txrx_lro_flush_handler((void *)pdev, NULL, 0); + ol_txrx_lro_flush_handler(data, NULL, 0); } else { pkt = cds_alloc_ol_rx_pkt(sched_ctx); if (qdf_unlikely(!pkt)) { @@ -4685,7 +4686,7 @@ void ol_txrx_lro_flush(void *data) pkt->callback = (cds_ol_rx_thread_cb) ol_txrx_lro_flush_handler; - pkt->context = pdev; + pkt->context = data; pkt->Rxpkt = NULL; pkt->staId = 0; cds_indicate_rxpkt(sched_ctx, pkt); @@ -4694,51 +4695,77 @@ void ol_txrx_lro_flush(void *data) /** * ol_register_lro_flush_cb() - register the LRO flush callback - * @handler: callback function - * @data: opaque data pointer to be passed back + * @lro_flush_cb: flush callback function + * @lro_init_cb: Allocate and initialize LRO data structure. * * Store the LRO flush callback provided and in turn * register OL's LRO flush handler with CE * * Return: none */ -void ol_register_lro_flush_cb(void (handler)(void *), void *data) +void ol_register_lro_flush_cb(void (lro_flush_cb)(void *), + void *(lro_init_cb)(void)) { - struct hif_opaque_softc *hif_device = - (struct hif_opaque_softc *)cds_get_context(QDF_MODULE_ID_HIF); + struct hif_opaque_softc *hif_device; struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); - if (pdev != NULL) { - pdev->lro_info.lro_flush_cb = handler; - pdev->lro_info.lro_data = data; - } else + if (pdev == NULL) { TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "%s: pdev NULL!", __func__); + TXRX_ASSERT2(0); + goto out; + } + if (pdev->lro_info.lro_flush_cb != NULL) { + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, + "%s: LRO already initialised\n", __func__); + if (pdev->lro_info.lro_flush_cb != lro_flush_cb) { + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, + "lro_flush_cb is differ to previously registered callback\n") + TXRX_ASSERT2(0); + goto out; + } + qdf_atomic_inc(&pdev->lro_info.lro_dev_cnt); + goto out; + } + pdev->lro_info.lro_flush_cb = lro_flush_cb; + hif_device = (struct hif_opaque_softc *) + cds_get_context(QDF_MODULE_ID_HIF); - hif_lro_flush_cb_register(hif_device, ol_txrx_lro_flush, pdev); + hif_lro_flush_cb_register(hif_device, ol_txrx_lro_flush, lro_init_cb); + qdf_atomic_inc(&pdev->lro_info.lro_dev_cnt); + +out: + return; } /** - * ol_deregister_lro_flush_cb() - deregister the LRO flush - * callback + * ol_deregister_lro_flush_cb() - deregister the LRO flush callback + * @lro_deinit_cb: callback function for deregistration. * * Remove the LRO flush callback provided and in turn * deregister OL's LRO flush handler with CE * * Return: none */ -void ol_deregister_lro_flush_cb(void) +void ol_deregister_lro_flush_cb(void (lro_deinit_cb)(void *)) { - struct hif_opaque_softc *hif_device = - (struct hif_opaque_softc *)cds_get_context(QDF_MODULE_ID_HIF); + struct hif_opaque_softc *hif_device; struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); - hif_lro_flush_cb_deregister(hif_device); - - if (pdev != NULL) { - pdev->lro_info.lro_flush_cb = NULL; - pdev->lro_info.lro_data = NULL; - } else + if (pdev == NULL) { TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "%s: pdev NULL!", __func__); + return; + } + if (qdf_atomic_dec_and_test(&pdev->lro_info.lro_dev_cnt) == 0) { + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, + "%s: Other LRO enabled modules still exist, do not unregister the lro_flush_cb\n", __func__); + return; + } + hif_device = + (struct hif_opaque_softc *)cds_get_context(QDF_MODULE_ID_HIF); + + hif_lro_flush_cb_deregister(hif_device, lro_deinit_cb); + + pdev->lro_info.lro_flush_cb = NULL; } #endif /* FEATURE_LRO */ diff --git a/core/dp/txrx/ol_txrx_types.h b/core/dp/txrx/ol_txrx_types.h index 898fb983660c..cc0dd07387e5 100644 --- a/core/dp/txrx/ol_txrx_types.h +++ b/core/dp/txrx/ol_txrx_types.h @@ -948,8 +948,8 @@ struct ol_txrx_pdev_t { ol_tx_pause_callback_fp pause_cb; struct { - void *lro_data; void (*lro_flush_cb)(void *); + qdf_atomic_t lro_dev_cnt; } lro_info; struct ol_txrx_peer_t *self_peer; }; |
