瀏覽代碼

qcacmn: Serialize dp reorder queue setup wmi command

Refactor the code to move the serialization of
rx reorder queue setup wmi command to target-if
layer.

CRs-Fixed: 2431099
Change-Id: I6b383f5e875fec55c3586dfee576894f6eb35f73
Rakesh Pillai 6 年之前
父節點
當前提交
9498cd70f4
共有 4 個文件被更改,包括 111 次插入136 次删除
  1. 0 24
      dp/inc/cdp_txrx_ops.h
  2. 6 111
      dp/wifi3.0/dp_peer.c
  3. 23 1
      target_if/dp/inc/target_if_dp.h
  4. 82 0
      target_if/dp/src/target_if_dp.c

+ 0 - 24
dp/inc/cdp_txrx_ops.h

@@ -846,30 +846,6 @@ struct cdp_pflow_ops {
 #define LRO_IPV4_SEED_ARR_SZ 5
 #define LRO_IPV6_SEED_ARR_SZ 11
 
-/**
- * struct cdp_reorder_q_setup - reorder queue setup params
- * @soc: dp soc pointer
- * @ctrl_pdev: umac ctrl pdev pointer
- * @vdev_id: vdev id
- * @peer_macaddr: peer mac address
- * @hw_qdesc: hw queue descriptor
- * @tid: tid number
- * @queue_no: queue number
- * @ba_window_size_valid: BA window size validity flag
- * @ba_window_size: BA window size
- */
-struct cdp_reorder_q_setup {
-	struct cdp_soc *soc;
-	struct cdp_ctrl_objmgr_pdev *ctrl_pdev;
-	uint8_t vdev_id;
-	uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
-	qdf_dma_addr_t hw_qdesc_paddr;
-	uint8_t tid;
-	uint16_t queue_no;
-	uint8_t ba_window_size_valid;
-	uint16_t ba_window_size;
-};
-
 /**
  * struct cdp_lro_hash_config - set rx_offld(LRO/GRO) init parameters
  * @lro_enable: indicates whether rx_offld is enabled

+ 6 - 111
dp/wifi3.0/dp_peer.c

@@ -32,9 +32,6 @@
 #endif
 #include <cdp_txrx_handle.h>
 #include <wlan_cfg.h>
-#ifdef SERIALIZE_QUEUE_SETUP
-#include "scheduler_api.h"
-#endif
 
 #ifdef DP_LFR
 static inline void
@@ -1616,112 +1613,6 @@ void *dp_find_peer_by_addr(struct cdp_pdev *dev, uint8_t *peer_mac_addr,
 	return peer;
 }
 
-#ifdef SERIALIZE_QUEUE_SETUP
-static QDF_STATUS
-dp_rx_reorder_queue_setup(struct scheduler_msg *msg)
-{
-	struct cdp_reorder_q_setup *q_params;
-	struct dp_soc *soc;
-
-	if (!(msg->bodyptr)) {
-		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
-			  "Invalid message body");
-		return QDF_STATUS_E_INVAL;
-	}
-
-	q_params = msg->bodyptr;
-	soc = (struct dp_soc *)q_params->soc;
-	if (soc->cdp_soc.ol_ops->peer_rx_reorder_queue_setup) {
-		soc->cdp_soc.ol_ops->peer_rx_reorder_queue_setup(
-				q_params->ctrl_pdev, q_params->vdev_id,
-				q_params->peer_mac, q_params->hw_qdesc_paddr,
-				q_params->tid, q_params->queue_no,
-				q_params->ba_window_size_valid,
-				q_params->ba_window_size);
-	}
-
-	qdf_mem_free(q_params);
-
-	return QDF_STATUS_SUCCESS;
-}
-
-static QDF_STATUS
-dp_flush_queue_setup_msg(struct scheduler_msg *msg)
-{
-	if (msg->bodyptr)
-		qdf_mem_free(msg->bodyptr);
-
-	return QDF_STATUS_SUCCESS;
-}
-
-/**
- * dp_rx_reorder_update_queue_setup() - update rx reorder queue setup
- * @peer: dp peer pointer
- * @hw_qdesc: hw queue descriptor
- * @tid: tid number
- * @queue_no: queue number
- * @size_valid: BA window size validity flag
- * @window_size: BA window size
- *
- * return: QDF_STATUS_SUCCESS for success or error code
- */
-static QDF_STATUS
-dp_rx_reorder_update_queue_setup(struct dp_peer *peer, qdf_dma_addr_t hw_qdesc,
-				 int tid, uint16_t queue_no, uint8_t size_valid,
-				 uint16_t window_size)
-{
-	struct dp_soc *soc = peer->vdev->pdev->soc;
-	struct scheduler_msg msg = {0};
-	struct cdp_reorder_q_setup *q_params;
-	QDF_STATUS status;
-
-	q_params = qdf_mem_malloc(sizeof(*q_params));
-	qdf_mem_zero(q_params, sizeof(*q_params));
-
-	q_params->soc = (struct cdp_soc *)soc;
-	q_params->ctrl_pdev = peer->vdev->pdev->ctrl_pdev;
-	q_params->vdev_id = peer->vdev->vdev_id;
-	q_params->hw_qdesc_paddr = hw_qdesc;
-	q_params->tid = tid;
-	q_params->queue_no = queue_no;
-	q_params->ba_window_size_valid = size_valid;
-	q_params->ba_window_size = window_size;
-	qdf_mem_copy(q_params->peer_mac, peer->mac_addr.raw, QDF_MAC_ADDR_SIZE);
-
-	msg.bodyptr = q_params;
-	msg.callback = dp_rx_reorder_queue_setup;
-	msg.flush_callback = dp_flush_queue_setup_msg;
-	status = scheduler_post_message(QDF_MODULE_ID_DP,
-					QDF_MODULE_ID_DP,
-					QDF_MODULE_ID_TARGET_IF, &msg);
-
-	if (status != QDF_STATUS_SUCCESS)
-		qdf_mem_free(q_params);
-
-	return status;
-}
-#else
-
-static QDF_STATUS
-dp_rx_reorder_update_queue_setup(struct dp_peer *peer, qdf_dma_addr_t hw_qdesc,
-				 int tid, uint16_t queue_no, uint8_t size_valid,
-				 uint16_t window_size)
-{
-	struct dp_soc *soc = peer->vdev->pdev->soc;
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
-
-	if (soc->cdp_soc.ol_ops->peer_rx_reorder_queue_setup) {
-		status = soc->cdp_soc.ol_ops->peer_rx_reorder_queue_setup(
-					peer->vdev->pdev->ctrl_pdev,
-					peer->vdev->vdev_id, peer->mac_addr.raw,
-					hw_qdesc, tid, tid, size_valid,
-					window_size);
-	}
-
-	return status;
-}
-#endif
-
 /*
  * dp_rx_tid_update_wifi3() – Update receive TID state
  * @peer: Datapath peer handle
@@ -1757,8 +1648,12 @@ static int dp_rx_tid_update_wifi3(struct dp_peer *peer, int tid, uint32_t
 
 	rx_tid->ba_win_size = ba_window_size;
 
-	dp_rx_reorder_update_queue_setup(peer, rx_tid->hw_qdesc_paddr, tid,
-					 tid, 1, ba_window_size);
+	if (soc->cdp_soc.ol_ops->peer_rx_reorder_queue_setup) {
+		soc->cdp_soc.ol_ops->peer_rx_reorder_queue_setup(
+			peer->vdev->pdev->ctrl_pdev,
+			peer->vdev->vdev_id, peer->mac_addr.raw,
+			rx_tid->hw_qdesc_paddr, tid, tid, 1, ba_window_size);
+	}
 
 	return 0;
 }

+ 23 - 1
target_if/dp/inc/target_if_dp.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-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
@@ -31,6 +31,28 @@
 #include <target_if.h>
 #include <cdp_txrx_ops.h>
 
+/**
+ * struct reorder_q_setup - reorder queue setup params
+ * @pdev: pdev
+ * @vdev_id: vdev id
+ * @peer_macaddr: peer mac address
+ * @hw_qdesc: hw queue descriptor
+ * @tid: tid number
+ * @queue_no: queue number
+ * @ba_window_size_valid: BA window size validity flag
+ * @ba_window_size: BA window size
+ */
+struct reorder_q_setup {
+	struct cdp_ctrl_objmgr_pdev *pdev;
+	uint8_t vdev_id;
+	uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
+	qdf_dma_addr_t hw_qdesc_paddr;
+	uint8_t tid;
+	uint16_t queue_no;
+	uint8_t ba_window_size_valid;
+	uint16_t ba_window_size;
+};
+
 /**
  * target_if_peer_set_default_routing() - set peer default routing
  * @pdev: pdev pointer

+ 82 - 0
target_if/dp/src/target_if_dp.c

@@ -58,6 +58,87 @@ target_if_peer_set_default_routing(struct cdp_ctrl_objmgr_pdev *pdev,
 	}
 }
 
+#ifdef SERIALIZE_QUEUE_SETUP
+static QDF_STATUS
+target_if_rx_reorder_queue_setup(struct scheduler_msg *msg)
+{
+	struct rx_reorder_queue_setup_params param;
+	struct common_wmi_handle *pdev_wmi_handle;
+	struct reorder_q_setup *q_params;
+	struct cdp_ctrl_objmgr_pdev *pdev;
+	QDF_STATUS status;
+
+	if (!(msg->bodyptr)) {
+		target_if_err("rx_reorder: Invalid message body");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	q_params = msg->bodyptr;
+	pdev = q_params->pdev;
+	pdev_wmi_handle =
+		lmac_get_pdev_wmi_handle((struct wlan_objmgr_pdev *)pdev);
+	if (!pdev_wmi_handle) {
+		target_if_err("pdev wmi handle NULL");
+		status = QDF_STATUS_E_FAILURE;
+		goto out;
+	}
+
+	param.tid = q_params->tid;
+	param.vdev_id = q_params->vdev_id;
+	param.peer_macaddr = q_params->peer_mac;
+	param.hw_qdesc_paddr_lo = q_params->hw_qdesc_paddr & 0xffffffff;
+	param.hw_qdesc_paddr_hi = (uint64_t)q_params->hw_qdesc_paddr >> 32;
+	param.queue_no = q_params->queue_no;
+	param.ba_window_size_valid = q_params->ba_window_size_valid;
+	param.ba_window_size = q_params->ba_window_size;
+
+	status = wmi_unified_peer_rx_reorder_queue_setup_send(pdev_wmi_handle,
+							      &param);
+out:
+	qdf_mem_free(q_params);
+
+	return status;
+}
+
+QDF_STATUS
+target_if_peer_rx_reorder_queue_setup(struct cdp_ctrl_objmgr_pdev *pdev,
+				      uint8_t vdev_id, uint8_t *peer_macaddr,
+				      qdf_dma_addr_t hw_qdesc, int tid,
+				      uint16_t queue_no,
+				      uint8_t ba_window_size_valid,
+				      uint16_t ba_window_size)
+{
+	struct scheduler_msg msg = {0};
+	struct reorder_q_setup *q_params;
+	QDF_STATUS status;
+
+	q_params = qdf_mem_malloc(sizeof(*q_params));
+	if (!q_params)
+		return QDF_STATUS_E_NOMEM;
+
+	q_params->pdev = pdev;
+	q_params->vdev_id = vdev_id;
+	q_params->hw_qdesc_paddr = hw_qdesc;
+	q_params->tid = tid;
+	q_params->queue_no = queue_no;
+	q_params->ba_window_size_valid = ba_window_size_valid;
+	q_params->ba_window_size = ba_window_size;
+	qdf_mem_copy(q_params->peer_mac, peer_macaddr, QDF_MAC_ADDR_SIZE);
+
+	msg.bodyptr = q_params;
+	msg.callback = target_if_rx_reorder_queue_setup;
+	status = scheduler_post_message(QDF_MODULE_ID_TARGET_IF,
+					QDF_MODULE_ID_TARGET_IF,
+					QDF_MODULE_ID_TARGET_IF, &msg);
+
+	if (status != QDF_STATUS_SUCCESS)
+		qdf_mem_free(q_params);
+
+	return status;
+}
+
+#else
+
 QDF_STATUS
 target_if_peer_rx_reorder_queue_setup(struct cdp_ctrl_objmgr_pdev *pdev,
 				      uint8_t vdev_id, uint8_t *peer_macaddr,
@@ -87,6 +168,7 @@ target_if_peer_rx_reorder_queue_setup(struct cdp_ctrl_objmgr_pdev *pdev,
 	return wmi_unified_peer_rx_reorder_queue_setup_send(pdev_wmi_handle,
 							    &param);
 }
+#endif
 
 QDF_STATUS
 target_if_peer_rx_reorder_queue_remove(struct cdp_ctrl_objmgr_pdev *pdev,