qcacld-3.0: Do not aggregate checksum failure packets in FISA

When MSDU fails for checksum validation, do not aggregate those
packets and make sure current flow is flushed. Since checksum
failure packet data is not trust worthy it is not advisable to
build aggregated skb on top of checksum failure packets.

Change-Id: I09d8c4aeb656e6b0b5d268a60d72147534f2a2ab
CRs-Fixed: 3805053
This commit is contained in:
Karthik Kantamneni 2024-04-30 12:45:21 +05:30 committed by Ravindra Konda
parent c660976ec1
commit 00c7b16cd1

View File

@ -1807,6 +1807,11 @@ static bool dp_fisa_aggregation_should_stop(
uint32_t l3_hdr_offset, l4_hdr_offset, l2_l3_hdr_len;
uint32_t cumulative_ip_len_delta = hal_cumulative_ip_len -
fisa_flow->hal_cumultive_ip_len;
uint32_t ip_csum_err = 0;
uint32_t tcp_udp_csum_err = 0;
hal_rx_tlv_csum_err_get(fisa_flow->dp_ctx->hal_soc, rx_tlv_hdr,
&ip_csum_err, &tcp_udp_csum_err);
hal_rx_get_l3_l4_offsets(fisa_flow->dp_ctx->hal_soc, rx_tlv_hdr,
&l3_hdr_offset, &l4_hdr_offset);
@ -1814,6 +1819,12 @@ static bool dp_fisa_aggregation_should_stop(
l2_l3_hdr_len = l3_hdr_offset + l4_hdr_offset;
/**
* If l3/l4 checksum validation failed for MSDU, then data
* is not trust worthy to build aggregated skb, so do not
* allow for aggregation. And also in aggregated case it
* is job of driver to make sure checksum is valid before
* computing partial checksum for final aggregated skb.
*
* kernel network panic if UDP data length < 12 bytes get aggregated,
* no solid conclusion currently, as a SW WAR, only allow UDP
* aggregation if UDP data length >= 16 bytes.
@ -1826,6 +1837,7 @@ static bool dp_fisa_aggregation_should_stop(
* otherwise, current fisa flow aggregation should be stopped.
*/
if (fisa_flow->do_not_aggregate ||
(ip_csum_err || tcp_udp_csum_err) ||
msdu_len < (l2_l3_hdr_len + FISA_MIN_L4_AND_DATA_LEN) ||
hal_cumulative_ip_len <= fisa_flow->hal_cumultive_ip_len ||
cumulative_ip_len_delta > FISA_MAX_SINGLE_CUMULATIVE_IP_LEN ||