Ver Fonte

qcacmn: Strip additional bytes from skb containing Rx payload

In existing code, the RX payload buffer for M-copy mode contained
RX MSDU payload followed by additional TLV data.

Add change to strip the skb and only provide MSDU payload

Change-Id: I9834fabfb0e26404a620d8419e7c570fff68f182
Soumya Bhat há 7 anos atrás
pai
commit
dc8aca8501
2 ficheiros alterados com 15 adições e 5 exclusões
  1. 7 3
      dp/wifi3.0/dp_rx_mon_status.c
  2. 8 2
      hal/wifi3.0/hal_api_mon.h

+ 7 - 3
dp/wifi3.0/dp_rx_mon_status.c

@@ -216,7 +216,7 @@ dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
 {
 	uint8_t size = 0;
 
-	if (ppdu_info->first_msdu_payload == NULL)
+	if (ppdu_info->msdu_info.first_msdu_payload == NULL)
 		return QDF_STATUS_SUCCESS;
 
 	if (pdev->m_copy_id.rx_ppdu_id == ppdu_info->com_info.ppdu_id)
@@ -225,12 +225,16 @@ dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
 	pdev->m_copy_id.rx_ppdu_id = ppdu_info->com_info.ppdu_id;
 
 	/* Include 2 bytes of reserved space appended to the msdu payload */
-	size = (ppdu_info->first_msdu_payload - qdf_nbuf_data(nbuf)) + 2;
-	ppdu_info->first_msdu_payload = NULL;
+	size = (ppdu_info->msdu_info.first_msdu_payload -
+				qdf_nbuf_data(nbuf)) + 2;
+	ppdu_info->msdu_info.first_msdu_payload = NULL;
 
 	if (qdf_nbuf_pull_head(nbuf, size) == NULL)
 		return QDF_STATUS_SUCCESS;
 
+	/* only retain RX MSDU payload in the skb */
+	qdf_nbuf_trim_tail(nbuf, qdf_nbuf_len(nbuf) -
+				ppdu_info->msdu_info.payload_len);
 	dp_wdi_event_handler(WDI_EVENT_RX_DATA, soc,
 			nbuf, HTT_INVALID_PEER, WDI_NO_VAL, pdev->pdev_id);
 	return QDF_STATUS_E_ALREADY;

+ 8 - 2
hal/wifi3.0/hal_api_mon.h

@@ -440,11 +440,16 @@ struct hal_rx_ppdu_common_info {
 	uint32_t mpdu_cnt_fcs_err;
 };
 
+struct hal_rx_msdu_payload_info {
+	uint8_t *first_msdu_payload;
+	uint32_t payload_len;
+};
+
 struct hal_rx_ppdu_info {
 	struct hal_rx_ppdu_common_info com_info;
 	struct hal_rx_ppdu_user_info user_info[HAL_MAX_UL_MU_USERS];
 	struct mon_rx_status rx_status;
-	uint8_t *first_msdu_payload;
+	struct hal_rx_msdu_payload_info msdu_info;
 };
 
 static inline uint32_t
@@ -994,7 +999,8 @@ hal_rx_status_get_tlv_info(void *rx_tlv, struct hal_rx_ppdu_info *ppdu_info)
 		break;
 	}
 	case WIFIRX_HEADER_E:
-		ppdu_info->first_msdu_payload = rx_tlv;
+		ppdu_info->msdu_info.first_msdu_payload = rx_tlv;
+		ppdu_info->msdu_info.payload_len = tlv_len;
 		break;
 	case 0:
 		return HAL_TLV_STATUS_PPDU_DONE;