ソースを参照

qcacmn: API support for AST flow override

Lithium HW can parse each MSDU when packets are enqueued to transmit
classifier and each MSDU can get enqueued to different MSDU-Queue.
By default, there are 2 queues per TID – UDP and NON-UDP. Based on
the flow parsing, packets will be queued to either of them.
Enterprise customers uses RAW mode frames which transmit classifier
would not be able to identify L4 protocol for  UDP or NON-UDP queue
for encrypted frames.
Customer can also have different application based packets which needs
to be enqueued to differently prioritized queues. They can choose to
tag each MSDU based on application DPI and derive the flow priority
as below –
•	UDP
•	NON-UDP
•	HI-PRIO
•	LOW-PRIO
Customer needs API support from host which will provide an ast-index
based on a particular flow id given peer mac address. Based on the mac
address, host will find the associated peer and return the ast_index &
cache set number corresponding to the flow id from peer flow based ast
entry table. Customer will then program this ast-index and ast override
in transmit classifier CMD ring to enqueue MSDU to a specific
flow-queuein TQM.
Host API:
Input parameter – uint8_t *peer mac address, uint8_t flow id
Output – uint16_t ast_index
Change-Id: I79557c31532514ad5ec0c1848827a3e5cd91cdf2
Mainak Sen 5 年 前
コミット
d13ed3e9e1
6 ファイル変更144 行追加0 行削除
  1. 4 0
      dp/inc/cdp_txrx_ops.h
  2. 48 0
      dp/wifi3.0/dp_htt.c
  3. 3 0
      dp/wifi3.0/dp_main.c
  4. 5 0
      dp/wifi3.0/dp_peer.c
  5. 36 0
      dp/wifi3.0/dp_peer.h
  6. 48 0
      dp/wifi3.0/dp_types.h

+ 4 - 0
dp/inc/cdp_txrx_ops.h

@@ -1045,6 +1045,10 @@ struct ol_if_ops {
 					    uint8_t *target_pdev_id);
 	bool (*is_roam_inprogress)(uint32_t vdev_id);
 	enum QDF_GLOBAL_MODE (*get_con_mode)(void);
+#ifdef QCA_PEER_MULTIQ_SUPPORT
+	int  (*peer_ast_flowid_map)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle,
+			       uint16_t peer_id, uint8_t vdev_id, uint8_t *peer_mac_addr);
+#endif
 	/* TODO: Add any other control path calls required to OL_IF/WMA layer */
 
 };

+ 48 - 0
dp/wifi3.0/dp_htt.c

@@ -4018,6 +4018,10 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
 			u_int8_t vdev_id;
 			bool is_wds;
 			u_int16_t ast_hash;
+			struct dp_ast_flow_override_info ast_flow_info;
+
+			qdf_mem_set(&ast_flow_info, 0,
+					    sizeof(struct dp_ast_flow_override_info));
 
 			peer_id = HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(*msg_word);
 			hw_peer_id =
@@ -4030,6 +4034,40 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
 			HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(*(msg_word + 3));
 			ast_hash =
 			HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(*(msg_word + 3));
+			/*
+			 * Update 4 ast_index per peer, ast valid mask
+			 * and TID flow valid mask.
+			 * AST valid mask is 3 bit field corresponds to
+			 * ast_index[3:1]. ast_index 0 is always valid.
+			 */
+			ast_flow_info.ast_valid_mask =
+			HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(*(msg_word + 3));
+			ast_flow_info.ast_idx[0] = hw_peer_id;
+			ast_flow_info.ast_flow_mask[0] =
+			HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(*(msg_word + 4));
+			ast_flow_info.ast_idx[1] =
+			HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(*(msg_word + 4));
+			ast_flow_info.ast_flow_mask[1] =
+			HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(*(msg_word + 4));
+			ast_flow_info.ast_idx[2] =
+			HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(*(msg_word + 5));
+			ast_flow_info.ast_flow_mask[2] =
+			HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(*(msg_word + 4));
+			ast_flow_info.ast_idx[3] =
+			HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(*(msg_word + 6));
+			ast_flow_info.ast_flow_mask[3] =
+			HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(*(msg_word + 4));
+			/*
+			 * TID valid mask is applicable only
+			 * for HI and LOW priority flows.
+			 * tid_valid_mas is 8 bit field corresponds
+			 * to TID[7:0]
+			 */
+			ast_flow_info.tid_valid_low_pri_mask =
+			HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(*(msg_word + 5));
+			ast_flow_info.tid_valid_hi_pri_mask =
+			HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(*(msg_word + 5));
+
 			QDF_TRACE(QDF_MODULE_ID_TXRX,
 				  QDF_TRACE_LEVEL_INFO,
 				  "HTT_T2H_MSG_TYPE_PEER_MAP msg for peer id %d vdev id %d n",
@@ -4039,6 +4077,16 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
 					       hw_peer_id, vdev_id,
 					       peer_mac_addr, ast_hash,
 					       is_wds);
+
+			/*
+			 * Update ast indexes for flow override support
+			 * Applicable only for non wds peers
+			 */
+			dp_peer_ast_index_flow_queue_map_create(
+					    soc->dp_soc, is_wds,
+					    peer_id, peer_mac_addr,
+					    &ast_flow_info);
+
 			break;
 		}
 	case HTT_T2H_MSG_TYPE_PEER_UNMAP_V2:

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

@@ -5539,6 +5539,9 @@ dp_peer_create_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
 	for (i = 0; i < MAX_NUM_PEER_ID_PER_PEER; i++)
 		peer->peer_ids[i] = HTT_INVALID_PEER;
 
+	/* reset the ast index to flowid table */
+	dp_peer_reset_flowq_map(peer);
+
 	qdf_spin_lock_bh(&soc->peer_ref_mutex);
 
 	qdf_atomic_init(&peer->ref_cnt);

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

@@ -1625,6 +1625,11 @@ dp_rx_peer_unmap_handler(struct dp_soc *soc, uint16_t peer_id,
 		}
 	}
 
+	/*
+	 * Reset ast flow mapping table
+	 */
+	dp_peer_reset_flowq_map(peer);
+
 	if (soc->cdp_soc.ol_ops->peer_unmap_event) {
 		soc->cdp_soc.ol_ops->peer_unmap_event(soc->ctrl_psoc,
 				peer_id, vdev_id);

+ 36 - 0
dp/wifi3.0/dp_peer.h

@@ -239,6 +239,42 @@ void dp_peer_multipass_list_init(struct dp_vdev *vdev);
 void dp_peer_multipass_list_remove(struct dp_peer *peer);
 #endif
 
+
+#ifndef QCA_PEER_MULTIQ_SUPPORT
+/**
+ * dp_peer_reset_flowq_map() - reset peer flowq map table
+ * @peer - dp peer handle
+ *
+ * Return: none
+ */
+static inline
+void dp_peer_reset_flowq_map(struct dp_peer *peer)
+{
+}
+
+/**
+ * dp_peer_ast_index_flow_queue_map_create() - create ast index flow queue map
+ * @soc - genereic soc handle
+ * @is_wds - flag to indicate if peer is wds
+ * @peer_id - peer_id from htt peer map message
+ * @peer_mac_addr - mac address of the peer
+ * @ast_info - ast flow override information from peer map
+ *
+ * Return: none
+ */
+static inline
+void dp_peer_ast_index_flow_queue_map_create(void *soc_hdl,
+		    bool is_wds, uint16_t peer_id, uint8_t *peer_mac_addr,
+		    struct dp_ast_flow_override_info *ast_info)
+{
+}
+#else
+void dp_peer_reset_flowq_map(struct dp_peer *peer);
+void dp_peer_ast_index_flow_queue_map_create(void *soc_hdl,
+		    bool is_wds, uint16_t peer_id, uint8_t *peer_mac_addr,
+		    struct dp_ast_flow_override_info *ast_info);
+#endif
+
 /**
  * dp_peer_update_pkt_capture_params: Set Rx & Tx Capture flags for a peer
  * @soc: DP SOC handle

+ 48 - 0
dp/wifi3.0/dp_types.h

@@ -1998,6 +1998,51 @@ struct dp_peer_cached_bufq {
 	uint32_t dropped;
 };
 
+/**
+ * enum dp_peer_ast_flowq
+ * @DP_PEER_AST_FLOWQ_HI_PRIO: Hi Priority flow queue
+ * @DP_PEER_AST_FLOWQ_LOW_PRIO: Low priority flow queue
+ * @DP_PEER_AST_FLOWQ_UDP: flow queue type is UDP
+ * @DP_PEER_AST_FLOWQ_NON_UDP: flow queue type is Non UDP
+ */
+enum dp_peer_ast_flowq {
+	DP_PEER_AST_FLOWQ_HI_PRIO,
+	DP_PEER_AST_FLOWQ_LOW_PRIO,
+	DP_PEER_AST_FLOWQ_UDP,
+	DP_PEER_AST_FLOWQ_NON_UDP,
+	DP_PEER_AST_FLOWQ_MAX,
+};
+
+/*
+ * struct dp_ast_flow_override_info - ast override info
+ * @ast_index - ast indexes in peer map message
+ * @ast_valid_mask - ast valid mask for each ast index
+ * @ast_flow_mask - ast flow mask for each ast index
+ * @tid_valid_low_pri_mask - per tid mask for low priority flow
+ * @tid_valid_hi_pri_mask - per tid mask for hi priority flow
+ */
+struct dp_ast_flow_override_info {
+	uint16_t ast_idx[DP_PEER_AST_FLOWQ_MAX];
+	uint8_t ast_valid_mask;
+	uint8_t ast_flow_mask[DP_PEER_AST_FLOWQ_MAX];
+	uint8_t tid_valid_low_pri_mask;
+	uint8_t tid_valid_hi_pri_mask;
+};
+
+/*
+ * struct dp_peer_ast_params - ast parameters for a msdu flow-queue
+ * @ast_index - ast index populated by FW
+ * @is_valid - ast flow valid mask
+ * @valid_tid_mask - per tid mask for this ast index
+ * @flowQ - flow queue id associated with this ast index
+ */
+struct dp_peer_ast_params {
+	uint16_t ast_idx;
+	uint8_t is_valid;
+	uint8_t valid_tid_mask;
+	uint8_t flowQ;
+};
+
 /* Peer structure for data path state */
 struct dp_peer {
 	/* VDEV to which this peer is associated */
@@ -2097,6 +2142,9 @@ struct dp_peer {
 	/* delayed ba ppdu id */
 	uint32_t last_delayed_ba_ppduid;
 #endif
+#ifdef QCA_PEER_MULTIQ_SUPPORT
+	struct dp_peer_ast_params peer_ast_flowq_idx[DP_PEER_AST_FLOWQ_MAX];
+#endif
 };
 
 /*