qcacmn: Optimizations for Tx monitor buffer allocations
Currently 2K Tx buffers are allocated at init time and 6K Tx buffers are allocated at mon vap creation time. Changes are done to move Tx buffer allocations to 0+8K model, where allocations are done when enable cmd is triggered. CRs-Fixed: 3284106 Change-Id: If0a112b8138f2be1db8f764fd7aa4ef12f274bb7
这个提交包含在:
@@ -500,7 +500,8 @@ QDF_STATUS dp_vdev_set_monitor_mode_buf_rings_rx_2_0(struct dp_pdev *pdev)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS dp_vdev_set_monitor_mode_buf_rings_tx_2_0(struct dp_pdev *pdev)
|
||||
QDF_STATUS dp_vdev_set_monitor_mode_buf_rings_tx_2_0(struct dp_pdev *pdev,
|
||||
uint16_t num_of_buffers)
|
||||
{
|
||||
int tx_mon_max_entries;
|
||||
struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx;
|
||||
@@ -530,17 +531,17 @@ QDF_STATUS dp_vdev_set_monitor_mode_buf_rings_tx_2_0(struct dp_pdev *pdev)
|
||||
return status;
|
||||
}
|
||||
|
||||
if (mon_soc_be->tx_mon_ring_fill_level < tx_mon_max_entries) {
|
||||
status = dp_tx_mon_buffers_alloc(soc,
|
||||
(tx_mon_max_entries -
|
||||
mon_soc_be->tx_mon_ring_fill_level));
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
dp_mon_err("%pK: Tx mon buffers allocation failed", soc);
|
||||
return status;
|
||||
if (mon_soc_be->tx_mon_ring_fill_level < num_of_buffers) {
|
||||
if (dp_tx_mon_buffers_alloc(soc,
|
||||
(num_of_buffers -
|
||||
mon_soc_be->tx_mon_ring_fill_level))) {
|
||||
dp_mon_err("%pK: Tx mon buffers allocation failed",
|
||||
soc);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
mon_soc_be->tx_mon_ring_fill_level +=
|
||||
(tx_mon_max_entries -
|
||||
mon_soc_be->tx_mon_ring_fill_level);
|
||||
(num_of_buffers -
|
||||
mon_soc_be->tx_mon_ring_fill_level);
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
@@ -559,13 +560,6 @@ QDF_STATUS dp_vdev_set_monitor_mode_buf_rings_2_0(struct dp_pdev *pdev)
|
||||
return status;
|
||||
}
|
||||
|
||||
status = dp_vdev_set_monitor_mode_buf_rings_tx_2_0(pdev);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
dp_mon_err("%pK: Tx monitor extra buffer allocation failed",
|
||||
soc);
|
||||
return status;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -998,12 +992,6 @@ QDF_STATUS dp_tx_mon_soc_init_2_0(struct dp_soc *soc)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* monitor buffers for src */
|
||||
if (dp_tx_mon_buffers_alloc(soc, DP_MON_RING_FILL_LEVEL_DEFAULT)) {
|
||||
dp_mon_err("%pK: Tx mon buffers allocation failed", soc);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
fail:
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
@@ -1031,7 +1019,7 @@ QDF_STATUS dp_mon_soc_init_2_0(struct dp_soc *soc)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
mon_soc_be->tx_mon_ring_fill_level = DP_MON_RING_FILL_LEVEL_DEFAULT;
|
||||
mon_soc_be->tx_mon_ring_fill_level = 0;
|
||||
mon_soc_be->rx_mon_ring_fill_level = DP_MON_RING_FILL_LEVEL_DEFAULT;
|
||||
|
||||
mon_soc_be->is_dp_mon_soc_initialized = true;
|
||||
|
@@ -307,10 +307,12 @@ void dp_mon_filter_show_rx_filter_be(enum dp_mon_filter_mode mode,
|
||||
/**
|
||||
* dp_vdev_set_monitor_mode_buf_rings_tx_2_0() - Add buffers to tx ring
|
||||
* @pdev: Pointer to dp_pdev object
|
||||
* @num_of_buffers: Number of buffers to allocate
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS dp_vdev_set_monitor_mode_buf_rings_tx_2_0(struct dp_pdev *pdev);
|
||||
QDF_STATUS dp_vdev_set_monitor_mode_buf_rings_tx_2_0(struct dp_pdev *pdev,
|
||||
uint16_t num_of_buffers);
|
||||
|
||||
/**
|
||||
* dp_vdev_set_monitor_mode_buf_rings_rx_2_0() - Add buffers to rx ring
|
||||
|
@@ -580,12 +580,17 @@ void dp_print_pdev_tx_monitor_stats_2_0(struct dp_pdev *pdev)
|
||||
QDF_STATUS
|
||||
dp_config_enh_tx_monitor_2_0(struct dp_pdev *pdev, uint8_t val)
|
||||
{
|
||||
struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx;
|
||||
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
|
||||
struct dp_mon_pdev_be *mon_pdev_be =
|
||||
dp_get_be_mon_pdev_from_dp_mon_pdev(mon_pdev);
|
||||
struct dp_pdev_tx_monitor_be *tx_mon_be =
|
||||
&mon_pdev_be->tx_monitor_be;
|
||||
struct dp_soc *soc = pdev->soc;
|
||||
uint16_t num_of_buffers;
|
||||
QDF_STATUS status;
|
||||
|
||||
soc_cfg_ctx = soc->wlan_cfg_ctx;
|
||||
switch (val) {
|
||||
case TX_MON_BE_DISABLE:
|
||||
{
|
||||
@@ -596,6 +601,13 @@ dp_config_enh_tx_monitor_2_0(struct dp_pdev *pdev, uint8_t val)
|
||||
}
|
||||
case TX_MON_BE_FULL_CAPTURE:
|
||||
{
|
||||
num_of_buffers = wlan_cfg_get_dp_soc_tx_mon_buf_ring_size(soc_cfg_ctx);
|
||||
status = dp_vdev_set_monitor_mode_buf_rings_tx_2_0(pdev,
|
||||
num_of_buffers);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
dp_mon_err("Tx monitor buffer allocation failed");
|
||||
return status;
|
||||
}
|
||||
qdf_mem_zero(&tx_mon_be->stats,
|
||||
sizeof(struct dp_tx_monitor_drop_stats));
|
||||
tx_mon_be->last_tsft = 0;
|
||||
@@ -607,6 +619,12 @@ dp_config_enh_tx_monitor_2_0(struct dp_pdev *pdev, uint8_t val)
|
||||
}
|
||||
case TX_MON_BE_PEER_FILTER:
|
||||
{
|
||||
status = dp_vdev_set_monitor_mode_buf_rings_tx_2_0(pdev,
|
||||
DP_MON_RING_FILL_LEVEL_DEFAULT);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
dp_mon_err("Tx monitor buffer allocation failed");
|
||||
return status;
|
||||
}
|
||||
tx_mon_be->mode = TX_MON_BE_PEER_FILTER;
|
||||
mon_pdev_be->tx_mon_mode = 2;
|
||||
mon_pdev_be->tx_mon_filter_length = DMA_LENGTH_256B;
|
||||
@@ -1189,12 +1207,17 @@ void dp_tx_ppdu_stats_detach_2_0(struct dp_pdev *pdev)
|
||||
QDF_STATUS
|
||||
dp_config_enh_tx_core_monitor_2_0(struct dp_pdev *pdev, uint8_t val)
|
||||
{
|
||||
struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx;
|
||||
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
|
||||
struct dp_mon_pdev_be *mon_pdev_be =
|
||||
dp_get_be_mon_pdev_from_dp_mon_pdev(mon_pdev);
|
||||
struct dp_pdev_tx_monitor_be *tx_mon_be =
|
||||
&mon_pdev_be->tx_monitor_be;
|
||||
struct dp_soc *soc = pdev->soc;
|
||||
uint16_t num_of_buffers;
|
||||
QDF_STATUS status;
|
||||
|
||||
soc_cfg_ctx = soc->wlan_cfg_ctx;
|
||||
switch (val) {
|
||||
case TX_MON_BE_FRM_WRK_DISABLE:
|
||||
{
|
||||
@@ -1205,6 +1228,13 @@ dp_config_enh_tx_core_monitor_2_0(struct dp_pdev *pdev, uint8_t val)
|
||||
}
|
||||
case TX_MON_BE_FRM_WRK_FULL_CAPTURE:
|
||||
{
|
||||
num_of_buffers = wlan_cfg_get_dp_soc_tx_mon_buf_ring_size(soc_cfg_ctx);
|
||||
status = dp_vdev_set_monitor_mode_buf_rings_tx_2_0(pdev,
|
||||
num_of_buffers);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
dp_mon_err("Tx monitor buffer allocation failed");
|
||||
return status;
|
||||
}
|
||||
tx_mon_be->mode = val;
|
||||
qdf_mem_zero(&tx_mon_be->stats,
|
||||
sizeof(struct dp_tx_monitor_drop_stats));
|
||||
@@ -1215,6 +1245,12 @@ dp_config_enh_tx_core_monitor_2_0(struct dp_pdev *pdev, uint8_t val)
|
||||
}
|
||||
case TX_MON_BE_FRM_WRK_128B_CAPTURE:
|
||||
{
|
||||
status = dp_vdev_set_monitor_mode_buf_rings_tx_2_0(pdev,
|
||||
DP_MON_RING_FILL_LEVEL_DEFAULT);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
dp_mon_err("Tx monitor buffer allocation failed");
|
||||
return status;
|
||||
}
|
||||
tx_mon_be->mode = val;
|
||||
mon_pdev_be->tx_mon_mode = 1;
|
||||
mon_pdev_be->tx_mon_filter_length = DMA_LENGTH_128B;
|
||||
|
在新工单中引用
屏蔽一个用户