qcacmn: add APIs to iterate the peers at vdev level
Add new APIs to iterate through the vdev peer list by taking the peer reference. A call back has to be passed to these APIs which will be called for every peer in the lisst dp_vdev_iterate_peer() -> iterates through peer_list of vdev dp_pdev_iterate_peer() -> iterates through peer_list of all vdevs in pdev dp_soc_iterate_peer() -> iterates through peer_lists of all vdevs in soc Additonal APIs are added to for itearations where the callback will be called outside the vdev->peer_list_lock, as these APIs have additional memory allocations suggested to use only in case the iteration need to happen outside lock dp_vdev_iterate_peer_lock_safe() dp_pdev_iterate_peer_lock_safe() dp_soc_iterate_peer_lock_safe Change-Id: I24632fe611355cc3e93b7f16d90913d4b8686ca9
This commit is contained in:

committato da
snandini

parent
1322dc7949
commit
e2b00339f3
@@ -6040,37 +6040,29 @@ void dp_txrx_path_stats(struct dp_soc *soc)
|
||||
* dp_aggregate_pdev_ctrl_frames_stats()- function to agreegate peer stats
|
||||
* Current scope is bar received count
|
||||
*
|
||||
* @pdev_handle: DP_PDEV handle
|
||||
* @soc : Datapath SOC handle
|
||||
* @peer: Datapath peer handle
|
||||
* @arg : argument to iterate function
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static void
|
||||
dp_aggregate_pdev_ctrl_frames_stats(struct dp_pdev *pdev)
|
||||
dp_peer_ctrl_frames_stats_get(struct dp_soc *soc,
|
||||
struct dp_peer *peer,
|
||||
void *arg)
|
||||
{
|
||||
struct dp_vdev *vdev;
|
||||
struct dp_peer *peer;
|
||||
uint32_t waitcnt;
|
||||
struct dp_pdev *pdev = peer->vdev->pdev;
|
||||
|
||||
TAILQ_FOREACH(vdev, &pdev->vdev_list, vdev_list_elem) {
|
||||
TAILQ_FOREACH(peer, &vdev->peer_list, peer_list_elem) {
|
||||
|
||||
if (dp_peer_get_ref(pdev->soc, peer,
|
||||
DP_MOD_ID_GENERIC_STATS) !=
|
||||
QDF_STATUS_SUCCESS)
|
||||
continue;
|
||||
|
||||
waitcnt = 0;
|
||||
dp_peer_rxtid_stats(peer, dp_rx_bar_stats_cb, pdev);
|
||||
while (!(qdf_atomic_read(&pdev->stats_cmd_complete)) &&
|
||||
waitcnt < 10) {
|
||||
schedule_timeout_interruptible(
|
||||
STATS_PROC_TIMEOUT);
|
||||
waitcnt++;
|
||||
}
|
||||
qdf_atomic_set(&pdev->stats_cmd_complete, 0);
|
||||
dp_peer_unref_delete(peer, DP_MOD_ID_GENERIC_STATS);
|
||||
}
|
||||
waitcnt = 0;
|
||||
dp_peer_rxtid_stats(peer, dp_rx_bar_stats_cb, pdev);
|
||||
while (!(qdf_atomic_read(&pdev->stats_cmd_complete)) &&
|
||||
waitcnt < 10) {
|
||||
schedule_timeout_interruptible(
|
||||
STATS_PROC_TIMEOUT);
|
||||
waitcnt++;
|
||||
}
|
||||
qdf_atomic_set(&pdev->stats_cmd_complete, 0);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -6282,8 +6274,9 @@ dp_print_pdev_rx_stats(struct dp_pdev *pdev)
|
||||
DP_PRINT_STATS(" Failed frag alloc = %u",
|
||||
pdev->stats.replenish.frag_alloc_fail);
|
||||
|
||||
dp_pdev_iterate_peer_lock_safe(pdev, dp_peer_ctrl_frames_stats_get,
|
||||
NULL, DP_MOD_ID_GENERIC_STATS);
|
||||
/* Get bar_recv_cnt */
|
||||
dp_aggregate_pdev_ctrl_frames_stats(pdev);
|
||||
DP_PRINT_STATS("BAR Received Count: = %u",
|
||||
pdev->stats.rx.bar_recv_cnt);
|
||||
|
||||
|
Fai riferimento in un nuovo problema
Block a user