qcacmn: increment vdev refcount for search by id
Add new API dp_vdev_get_ref_by_id() which will return vdev pointer by holding a reference. Caller of this API has to ensure that this reference is released by calling dp_vdev_unref_delete() API New lock soc->vdev_map_lock is introduced to protect vdev id to object array Change-Id: I883e328932e35ef31254125492dbae20cebe0e00
这个提交包含在:
@@ -4338,20 +4338,24 @@ dp_vdev_peer_stats_update_protocol_cnt_free_peer:
|
||||
dp_peer_unref_delete(peer, DP_MOD_ID_GENERIC_STATS);
|
||||
}
|
||||
|
||||
void dp_peer_stats_update_protocol_cnt(struct cdp_soc_t *soc,
|
||||
void dp_peer_stats_update_protocol_cnt(struct cdp_soc_t *soc_hdl,
|
||||
int8_t vdev_id,
|
||||
qdf_nbuf_t nbuf,
|
||||
bool is_egress,
|
||||
bool is_rx)
|
||||
{
|
||||
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||
struct dp_vdev *vdev;
|
||||
|
||||
vdev = dp_get_vdev_from_soc_vdev_id_wifi3((struct dp_soc *)soc,
|
||||
vdev_id);
|
||||
if (qdf_likely(!vdev->peer_protocol_count_track))
|
||||
vdev = dp_vdev_get_ref_by_id(soc, vdev_id);
|
||||
if (!vdev)
|
||||
return;
|
||||
dp_vdev_peer_stats_update_protocol_cnt(vdev, nbuf, NULL, is_egress,
|
||||
is_rx);
|
||||
|
||||
if (qdf_likely(vdev->peer_protocol_count_track))
|
||||
dp_vdev_peer_stats_update_protocol_cnt(vdev, nbuf, NULL,
|
||||
is_egress, is_rx);
|
||||
|
||||
dp_vdev_unref_delete(soc, vdev);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户