Sfoglia il codice sorgente

qcacmn: cdp: Converge cdp_pmf_ops

Currently the cdp apis are given vdev/peer
handle as its arguments, which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the vdev_id or peer mac address, which will be
used to get the respective handles, and hence
avoiding the unwanted access of the handles if
it has been deleted.

- get_pn_info

Change-Id: I410938ed4c3878baa725b6fe3a785cbb99d5fdf4
CRs-Fixed: 2540837
Vevek Venkatesan 5 anni fa
parent
commit
dc1517ec8c
2 ha cambiato i file con 15 aggiunte e 9 eliminazioni
  1. 6 3
      dp/inc/cdp_txrx_ops.h
  2. 9 6
      dp/inc/cdp_txrx_pmf.h

+ 6 - 3
dp/inc/cdp_txrx_ops.h

@@ -1216,11 +1216,14 @@ struct cdp_mob_stats_ops {
 
 /**
  * struct cdp_pmf_ops - mcl protected management frame ops
- * @get_pn_info:
+ * @get_pn_info: handler to get pn info from peer
+ *
+ * Function pointers for pmf related operations.
  */
 struct cdp_pmf_ops {
-	void (*get_pn_info)(void *peer, uint8_t **last_pn_valid,
-			uint64_t **last_pn, uint32_t **rmf_pn_replays);
+	void (*get_pn_info)(struct cdp_soc_t *soc, uint8_t *peer_mac,
+			    uint8_t vdev_id, uint8_t **last_pn_valid,
+			    uint64_t **last_pn, uint32_t **rmf_pn_replays);
 };
 #endif
 

+ 9 - 6
dp/inc/cdp_txrx_pmf.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016, 2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -22,7 +22,8 @@
 /**
  * cdp_get_pn_info() - Returns pn info from peer
  * @soc - data path soc handle
- * @peer: handle to peer
+ * @peer_mac: peer mac address
+ * @vdev_id: virtual device/interface id
  * @last_pn_valid: return last_rmf_pn_valid value from peer.
  * @last_pn: return last_rmf_pn value from peer.
  * @rmf_pn_replays: return rmf_pn_replays value from peer.
@@ -30,8 +31,9 @@
  * Return: NONE
  */
 static inline void
-cdp_get_pn_info(ol_txrx_soc_handle soc, void *peer, uint8_t **last_pn_valid,
-		    uint64_t **last_pn, uint32_t **rmf_pn_replays)
+cdp_get_pn_info(ol_txrx_soc_handle soc, uint8_t *peer_mac, uint8_t vdev_id,
+		uint8_t **last_pn_valid, uint64_t **last_pn,
+		uint32_t **rmf_pn_replays)
 {
 	if (!soc || !soc->ops || !soc->ops->pmf_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -40,8 +42,9 @@ cdp_get_pn_info(ol_txrx_soc_handle soc, void *peer, uint8_t **last_pn_valid,
 	}
 
 	if (soc->ops->pmf_ops->get_pn_info)
-		return soc->ops->pmf_ops->get_pn_info(
-			peer, last_pn_valid, last_pn, rmf_pn_replays);
+		return soc->ops->pmf_ops->get_pn_info(soc, peer_mac, vdev_id,
+						      last_pn_valid,
+						      last_pn, rmf_pn_replays);
 
 	return;
 }