Browse Source

qcacld-3.0: RX packet FW reinjection check for FISA

For beryllium, use sw_exception bit to indentify is it FW
reinjected frame or not, if sw_exception bit is marked, then
skip FISA for these kind of frame.

Change-Id: I6ca74c244c366641a7bcfddff2834550b1e5b472
CRs-Fixed: 3056157
Jinwei Chen 3 years ago
parent
commit
3cd06e5ecf
2 changed files with 45 additions and 10 deletions
  1. 1 0
      Kbuild
  2. 44 10
      core/dp/txrx3.0/dp_fisa_rx.c

+ 1 - 0
Kbuild

@@ -947,6 +947,7 @@ endif
 
 ifeq ($(CONFIG_BERYLLIUM), y)
 cppflags-y += -DCONFIG_BERYLLIUM
+cppflags-y += -DDP_OFFLOAD_FRAME_WITH_SW_EXCEPTION
 endif
 
 cppflags-$(CONFIG_TALLOC_DEBUG) += -DWLAN_TALLOC_DEBUG

+ 44 - 10
core/dp/txrx3.0/dp_fisa_rx.c

@@ -1080,6 +1080,47 @@ dp_fisa_rx_get_sw_ft_entry(struct dp_rx_fst *fisa_hdl, qdf_nbuf_t nbuf,
 	return sw_ft_entry;
 }
 
+#ifdef DP_OFFLOAD_FRAME_WITH_SW_EXCEPTION
+/*
+ * dp_rx_reo_dest_honor_check() - check if packet reo destination is changed
+				  by FW offload
+ *@nbuf: RX packet nbuf
+ *@tlv_reo_dest_ind: reo_dest_ind fetched from rx_packet_tlv
+ *
+ * Return: QDF_STATUS_SUCCESS - reo destination not change, others - yes.
+ */
+static inline QDF_STATUS
+dp_rx_reo_dest_honor_check(qdf_nbuf_t nbuf, uint32_t tlv_reo_dest_ind)
+{
+	uint8_t sw_exception =
+			qdf_nbuf_get_rx_reo_dest_ind_or_sw_excpt(nbuf);
+	/*
+	 * If sw_exception bit is marked, then this data packet is
+	 * re-injected by FW offload, reo destination will not honor
+	 * the original FSE/hash selection, skip FISA.
+	 */
+	return sw_exception ? QDF_STATUS_E_FAILURE : QDF_STATUS_SUCCESS;
+}
+#else
+static inline QDF_STATUS
+dp_rx_reo_dest_honor_check(qdf_nbuf_t nbuf, uint32_t tlv_reo_dest_ind)
+{
+	uint8_t  ring_reo_dest_ind =
+			qdf_nbuf_get_rx_reo_dest_ind_or_sw_excpt(nbuf);
+	/*
+	 * Compare reo_destination_indication between reo ring descriptor
+	 * and rx_pkt_tlvs, if they are different, then likely these kind
+	 * of frames re-injected by FW or touched by other module already,
+	 * skip FISA to avoid REO2SW ring mismatch issue for same flow.
+	 */
+	if (tlv_reo_dest_ind != ring_reo_dest_ind ||
+	    REO_DEST_IND_IPA_REROUTE == ring_reo_dest_ind)
+		return QDF_STATUS_E_FAILURE;
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
 /**
  * dp_rx_get_fisa_flow() - Get FT entry corresponding to incoming nbuf
  * @fisa_hdl: handle to FISA context
@@ -1095,10 +1136,10 @@ dp_rx_get_fisa_flow(struct dp_rx_fst *fisa_hdl, struct dp_vdev *vdev,
 	uint8_t *rx_tlv_hdr;
 	uint32_t flow_idx_hash;
 	uint32_t tlv_reo_dest_ind;
-	uint8_t  ring_reo_dest_ind;
 	bool flow_invalid, flow_timeout, flow_idx_valid;
 	struct dp_fisa_rx_sw_ft *sw_ft_entry = NULL;
 	hal_soc_handle_t hal_soc_hdl = fisa_hdl->soc_hdl->hal_soc;
+	QDF_STATUS status;
 
 	if (QDF_NBUF_CB_RX_TCP_PROTO(nbuf))
 		return sw_ft_entry;
@@ -1106,15 +1147,8 @@ dp_rx_get_fisa_flow(struct dp_rx_fst *fisa_hdl, struct dp_vdev *vdev,
 	rx_tlv_hdr = qdf_nbuf_data(nbuf);
 	hal_rx_msdu_get_reo_destination_indication(hal_soc_hdl, rx_tlv_hdr,
 						   &tlv_reo_dest_ind);
-	ring_reo_dest_ind = qdf_nbuf_get_rx_reo_dest_ind(nbuf);
-	/*
-	 * Compare reo_destination_indication between reo ring descriptor
-	 * and rx_pkt_tlvs, if they are different, then likely these kind
-	 * of frames re-injected by FW or touched by other module already,
-	 * skip FISA to avoid REO2SW ring mismatch issue for same flow.
-	 */
-	if (tlv_reo_dest_ind != ring_reo_dest_ind ||
-	    REO_DEST_IND_IPA_REROUTE == ring_reo_dest_ind)
+	status = dp_rx_reo_dest_honor_check(nbuf, tlv_reo_dest_ind);
+	if (QDF_IS_STATUS_ERROR(status))
 		return sw_ft_entry;
 
 	hal_rx_msdu_get_flow_params(hal_soc_hdl, rx_tlv_hdr, &flow_invalid,