Bladeren bron

qcacmn: Dont destroy rx_tid lock for peer reuse

In case of peer reuse case rx_tid locks are destroyed as
part of peer cleanup and are not initialized again. So while
deleting this peer as part of unref delete peer cleanup is done
which again tries to destroy the rx_tid locks which were already
destroyed. This leads to assert complaining destroying lock with
out initialization. So dont destroy the rx tid locks in case of
peer reference reuse.

Change-Id: I860de558950009cae6f62385dd665badfe9964e0
CRs-Fixed: 2504973
Sravan Kumar Kairam 5 jaren geleden
bovenliggende
commit
1e8591a2a0
3 gewijzigde bestanden met toevoegingen van 14 en 9 verwijderingen
  1. 4 2
      dp/wifi3.0/dp_internal.h
  2. 2 2
      dp/wifi3.0/dp_main.c
  3. 8 5
      dp/wifi3.0/dp_peer.c

+ 4 - 2
dp/wifi3.0/dp_internal.h

@@ -773,8 +773,10 @@ void dp_peer_ppdu_delayed_ba_cleanup(struct dp_peer *peer);
 
 extern void dp_peer_rx_init(struct dp_pdev *pdev, struct dp_peer *peer);
 void dp_peer_tx_init(struct dp_pdev *pdev, struct dp_peer *peer);
-extern void dp_peer_cleanup(struct dp_vdev *vdev, struct dp_peer *peer);
-extern void dp_peer_rx_cleanup(struct dp_vdev *vdev, struct dp_peer *peer);
+void dp_peer_cleanup(struct dp_vdev *vdev, struct dp_peer *peer,
+		     bool reuse);
+void dp_peer_rx_cleanup(struct dp_vdev *vdev, struct dp_peer *peer,
+			bool reuse);
 void dp_peer_unref_delete(struct dp_peer *peer);
 extern void dp_rx_discard(struct dp_vdev *vdev, struct dp_peer *peer,
 	unsigned tid, qdf_nbuf_t msdu_list);

+ 2 - 2
dp/wifi3.0/dp_main.c

@@ -5140,7 +5140,7 @@ static void *dp_peer_create_wifi3(struct cdp_vdev *vdev_handle,
 
 	if (peer) {
 		qdf_atomic_init(&peer->is_default_route_set);
-		dp_peer_cleanup(vdev, peer);
+		dp_peer_cleanup(vdev, peer, true);
 
 		qdf_spin_lock_bh(&soc->ast_lock);
 		dp_peer_delete_ast_entries(soc, peer);
@@ -5896,7 +5896,7 @@ void dp_peer_unref_delete(struct dp_peer *peer)
 		peer->wlanstats_ctx = NULL;
 
 		/* cleanup the peer data */
-		dp_peer_cleanup(vdev, peer);
+		dp_peer_cleanup(vdev, peer, false);
 		qdf_spin_unlock_bh(&soc->peer_ref_mutex);
 		dp_reset_and_release_peer_mem(soc, pdev, peer, vdev);
 		qdf_spin_lock_bh(&soc->peer_ref_mutex);

+ 8 - 5
dp/wifi3.0/dp_peer.c

@@ -2263,9 +2263,10 @@ void dp_peer_rx_init(struct dp_pdev *pdev, struct dp_peer *peer)
  * dp_peer_rx_cleanup() – Cleanup receive TID state
  * @vdev: Datapath vdev
  * @peer: Datapath peer
+ * @reuse: Peer reference reuse
  *
  */
-void dp_peer_rx_cleanup(struct dp_vdev *vdev, struct dp_peer *peer)
+void dp_peer_rx_cleanup(struct dp_vdev *vdev, struct dp_peer *peer, bool reuse)
 {
 	int tid;
 	uint32_t tid_delete_mask = 0;
@@ -2295,8 +2296,9 @@ void dp_peer_rx_cleanup(struct dp_vdev *vdev, struct dp_peer *peer)
 			tid_delete_mask);
 	}
 #endif
-	for (tid = 0; tid < DP_MAX_TIDS; tid++)
-		qdf_spinlock_destroy(&peer->rx_tid[tid].tid_lock);
+	if (!reuse)
+		for (tid = 0; tid < DP_MAX_TIDS; tid++)
+			qdf_spinlock_destroy(&peer->rx_tid[tid].tid_lock);
 }
 
 #ifdef FEATURE_PERPKT_INFO
@@ -2329,14 +2331,15 @@ void dp_peer_ppdu_delayed_ba_init(struct dp_peer *peer)
  * dp_peer_cleanup() – Cleanup peer information
  * @vdev: Datapath vdev
  * @peer: Datapath peer
+ * @reuse: Peer reference reuse
  *
  */
-void dp_peer_cleanup(struct dp_vdev *vdev, struct dp_peer *peer)
+void dp_peer_cleanup(struct dp_vdev *vdev, struct dp_peer *peer, bool reuse)
 {
 	dp_peer_tx_cleanup(vdev, peer);
 
 	/* cleanup the Rx reorder queues for this peer */
-	dp_peer_rx_cleanup(vdev, peer);
+	dp_peer_rx_cleanup(vdev, peer, reuse);
 }
 
 /* dp_teardown_256_ba_session() - Teardown sessions using 256