Browse Source

qcacmn: chain nbufs using phy_ppdu_id for peer invalid case

nbufs received on wbm_release ring were chained based on
first_msdu and last_msdu bits if the peer is invalid for these
frames, but these fields in the rx tlv header were in-correct as
hardware does not decap these msdu's.
Based on inputs from firmware we now changed this logic to
using phy_ppdu_id field from the rx_mpdu_start tlv & rx_attention tlv.

Change-Id: Ifc7faa2d1b0585bcc226e5cb2045fcb29d152273
Tallapragada Kalyan 7 years ago
parent
commit
70539512de
5 changed files with 36 additions and 4 deletions
  1. 7 2
      dp/wifi3.0/dp_rx_err.c
  2. 1 1
      dp/wifi3.0/dp_rx_mon_dest.c
  3. 2 0
      dp/wifi3.0/dp_types.h
  4. 25 0
      dp/wifi3.0/hal_rx.h
  5. 1 1
      hal/wifi3.0/hal_api_mon.h

+ 7 - 2
dp/wifi3.0/dp_rx_err.c

@@ -424,8 +424,10 @@ dp_rx_chain_msdus(struct dp_soc *soc, qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr,
 	 */
 	struct dp_pdev *dp_pdev = soc->pdev_list[mac_id];
 
-	if (hal_rx_msdu_end_first_msdu_get(rx_tlv_hdr)) {
+	if (!dp_pdev->first_nbuf) {
 		qdf_nbuf_set_rx_chfrag_start(nbuf, 1);
+		dp_pdev->ppdu_id = HAL_RX_HW_DESC_GET_PPDUID_GET(rx_tlv_hdr);
+		dp_pdev->first_nbuf = true;
 
 		/* If the new nbuf received is the first msdu of the
 		 * amsdu and there are msdus in the invalid peer msdu
@@ -450,8 +452,11 @@ dp_rx_chain_msdus(struct dp_soc *soc, qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr,
 
 	}
 
-	if (hal_rx_msdu_end_last_msdu_get(rx_tlv_hdr)) {
+	if (dp_pdev->ppdu_id == hal_rx_attn_phy_ppdu_id_get(rx_tlv_hdr) &&
+	    hal_rx_attn_msdu_done_get(rx_tlv_hdr)) {
 		qdf_nbuf_set_rx_chfrag_end(nbuf, 1);
+		qdf_assert_always(dp_pdev->first_nbuf == true);
+		dp_pdev->first_nbuf = false;
 		mpdu_done = true;
 	}
 

+ 1 - 1
dp/wifi3.0/dp_rx_mon_dest.c

@@ -205,7 +205,7 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id,
 			if (qdf_likely(check_ppdu_id)) {
 				if (is_first_msdu) {
 					msdu_ppdu_id =
-					HAL_RX_MON_HW_DESC_GET_PPDUID_GET(
+					HAL_RX_HW_DESC_GET_PPDUID_GET(
 						rx_desc_tlv);
 					is_first_msdu = false;
 				}

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

@@ -1163,6 +1163,8 @@ struct dp_pdev {
 	TAILQ_HEAD(, ppdu_info) ppdu_info_list;
 	uint32_t tlv_count;
 	uint32_t list_depth;
+	uint32_t ppdu_id;
+	bool first_nbuf;
 };
 
 struct dp_peer;

+ 25 - 0
dp/wifi3.0/hal_rx.h

@@ -803,6 +803,31 @@ hal_rx_attn_ip_cksum_fail_get(uint8_t *buf)
 	return ip_cksum_fail;
 }
 
+#define HAL_RX_ATTN_PHY_PPDU_ID_GET(_rx_attn)		\
+	(_HAL_MS((*_OFFSET_TO_WORD_PTR(_rx_attn,	\
+		RX_ATTENTION_0_PHY_PPDU_ID_OFFSET)),	\
+		RX_ATTENTION_0_PHY_PPDU_ID_MASK,	\
+		RX_ATTENTION_0_PHY_PPDU_ID_LSB))
+
+/*
+ * hal_rx_attn_phy_ppdu_id_get(): get phy_ppdu_id value
+ * from rx attention
+ * @buf: pointer to rx_pkt_tlvs
+ *
+ * Return: phy_ppdu_id
+ */
+static inline uint16_t
+hal_rx_attn_phy_ppdu_id_get(uint8_t *buf)
+{
+	struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf;
+	struct rx_attention *rx_attn = &pkt_tlvs->attn_tlv.rx_attn;
+	uint16_t phy_ppdu_id;
+
+	phy_ppdu_id = HAL_RX_ATTN_PHY_PPDU_ID_GET(rx_attn);
+
+	return phy_ppdu_id;
+}
+
 /*
  * Get peer_meta_data from RX_MPDU_INFO within RX_MPDU_START
  */

+ 1 - 1
hal/wifi3.0/hal_api_mon.h

@@ -208,7 +208,7 @@ HAL_RX_DESC_GET_80211_HDR(void *hw_desc_addr) {
 }
 
 static inline
-uint32_t HAL_RX_MON_HW_DESC_GET_PPDUID_GET(void *hw_desc_addr)
+uint32_t HAL_RX_HW_DESC_GET_PPDUID_GET(void *hw_desc_addr)
 {
 	struct rx_mpdu_info *rx_mpdu_info;
 	struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)hw_desc_addr;