qcacmn: Clear the peer when it is deleted

The peer rx packets should be flushed when
deleting the peer and its state should be reset
to DISCONNECT, when deleting the peer.

If the state of peer is not set to DISCONNECT,
then the flushing of rx packets for the peer
which is being deleted will call the rx callback
and submit these packet to the stack, which can
cause unwanted behaviour.

This way the UMAC does not need to specifically
call clear peer before deleting the peer.

Change-Id: I3b5a737126350a361d968f6349aef6291b2e3f56
CRs-Fixed: 2659629
This commit is contained in:
Rakesh Pillai
2020-04-11 11:48:34 +05:30
committed by nshrivas
parent b7f1c6fa92
commit d1f8fbb225
4 changed files with 38 additions and 28 deletions

View File

@@ -171,7 +171,8 @@ static void dp_pktlogmod_exit(struct dp_pdev *handle);
static inline QDF_STATUS dp_peer_create_wifi3(struct cdp_soc_t *soc_hdl,
uint8_t vdev_id,
uint8_t *peer_mac_addr);
static QDF_STATUS dp_peer_delete_wifi3(struct cdp_soc_t *soc, uint8_t vdev_id,
static QDF_STATUS dp_peer_delete_wifi3(struct cdp_soc_t *soc_hdl,
uint8_t vdev_id,
uint8_t *peer_mac, uint32_t bitmap);
static void dp_vdev_flush_peers(struct cdp_vdev *vdev_handle,
bool unmap_only);
@@ -6721,7 +6722,6 @@ void dp_peer_unref_delete(struct dp_peer *peer)
#ifdef PEER_CACHE_RX_PKTS
static inline void dp_peer_rx_bufq_resources_deinit(struct dp_peer *peer)
{
dp_rx_flush_rx_cached(peer, true);
qdf_list_destroy(&peer->bufq_info.cached_bufq);
qdf_spinlock_destroy(&peer->bufq_info.bufq_lock);
}
@@ -6733,17 +6733,19 @@ static inline void dp_peer_rx_bufq_resources_deinit(struct dp_peer *peer)
/*
* dp_peer_detach_wifi3() Detach txrx peer
* @soc: soc handle
* @soc_hdl: soc handle
* @vdev_id: id of dp handle
* @peer_mac: mac of datapath PEER handle
* @bitmap: bitmap indicating special handling of request.
*
*/
static QDF_STATUS dp_peer_delete_wifi3(struct cdp_soc_t *soc, uint8_t vdev_id,
static QDF_STATUS dp_peer_delete_wifi3(struct cdp_soc_t *soc_hdl,
uint8_t vdev_id,
uint8_t *peer_mac, uint32_t bitmap)
{
struct dp_peer *peer = dp_peer_find_hash_find((struct dp_soc *)soc,
peer_mac, 0, vdev_id);
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
struct dp_peer *peer = dp_peer_find_hash_find(soc, peer_mac,
0, vdev_id);
/* Peer can be null for monitor vap mac address */
if (!peer) {
@@ -6765,6 +6767,9 @@ static QDF_STATUS dp_peer_delete_wifi3(struct cdp_soc_t *soc, uint8_t vdev_id,
dp_local_peer_id_free(peer->vdev->pdev, peer);
/* Drop all rx packets before deleting peer */
dp_clear_peer_internal(soc, peer);
dp_peer_rx_bufq_resources_deinit(peer);
qdf_spinlock_destroy(&peer->peer_info_lock);