Sfoglia il codice sorgente

qcacmn: Adjust frag len in Mon mode considering l2 hdr offset

In Monitor mode, frag len is not adjusted taking l2 hdr
padding into consideration. This will result in inclusion
of l2 hdr padding length twice in skb len and would cause
skb expansion due to length exceeding 2048 bytes.

Fix is to adjust frag len taking l2 hdr padding into
consideration.

Change-Id: I31d57621bc71c51ff581a30adb654cd7b9448443
CRs-Fixed: 2781177
Yeshwanth Sriram Guntuka 4 anni fa
parent
commit
9c4530907a
1 ha cambiato i file con 19 aggiunte e 15 eliminazioni
  1. 19 15
      dp/wifi3.0/dp_rx_mon.h

+ 19 - 15
dp/wifi3.0/dp_rx_mon.h

@@ -289,12 +289,15 @@ dp_rx_mon_link_desc_return(struct dp_pdev *dp_pdev,
  *
  * @total_len: pointer to remaining data length.
  * @frag_len: pointer to data length in this fragment.
-*/
+ * @l2_hdr_pad: l2 header padding
+ */
 static inline void dp_mon_adjust_frag_len(uint32_t *total_len,
-					  uint32_t *frag_len)
+					  uint32_t *frag_len,
+					  uint16_t l2_hdr_pad)
 {
 	if (*total_len >= (RX_MONITOR_BUFFER_SIZE - RX_PKT_TLVS_LEN)) {
-		*frag_len = RX_MONITOR_BUFFER_SIZE - RX_PKT_TLVS_LEN;
+		*frag_len = RX_MONITOR_BUFFER_SIZE - RX_PKT_TLVS_LEN -
+					l2_hdr_pad;
 		*total_len -= *frag_len;
 	} else {
 		*frag_len = *total_len;
@@ -702,30 +705,31 @@ dp_rx_mon_parse_desc_buffer(struct dp_soc *dp_soc,
 			    qdf_frag_t rx_desc_tlv,
 			    bool *is_frag_non_raw_p, void *data)
 {
+	/*
+	 * HW structures call this L3 header padding
+	 * -- even though this is actually the offset
+	 * from the buffer beginning where the L2
+	 * header begins.
+	 */
+	*l2_hdr_offset_p =
+	hal_rx_msdu_end_l3_hdr_padding_get(dp_soc->hal_soc, data);
+
 	if (msdu_info->msdu_flags & HAL_MSDU_F_MSDU_CONTINUATION) {
 		if (!*(is_frag_p)) {
 			*total_frag_len_p = msdu_info->msdu_len;
 			*is_frag_p = true;
 		}
-		dp_mon_adjust_frag_len(total_frag_len_p, frag_len_p);
+		dp_mon_adjust_frag_len(total_frag_len_p, frag_len_p,
+				       *l2_hdr_offset_p);
 	} else {
 		if (*is_frag_p) {
-			dp_mon_adjust_frag_len(
-				total_frag_len_p, frag_len_p);
+			dp_mon_adjust_frag_len(total_frag_len_p, frag_len_p,
+					       *l2_hdr_offset_p);
 		} else {
 			*frag_len_p = msdu_info->msdu_len;
 		}
 		*is_frag_p = false;
 	}
-
-	/*
-	 * HW structures call this L3 header padding
-	 * -- even though this is actually the offset
-	 * from the buffer beginning where the L2
-	 * header begins.
-	 */
-	*l2_hdr_offset_p =
-	hal_rx_msdu_end_l3_hdr_padding_get(dp_soc->hal_soc, data);
 }
 
 static inline void dp_rx_mon_buffer_set_pktlen(qdf_nbuf_t msdu, uint32_t size)