From 40ef76f8a24c48c2b81dc67d05798dc519f0ccec Mon Sep 17 00:00:00 2001 From: Karthik Kantamneni Date: Tue, 30 Apr 2024 12:45:21 +0530 Subject: [PATCH] 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 --- core/dp/txrx3.0/dp_fisa_rx.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/dp/txrx3.0/dp_fisa_rx.c b/core/dp/txrx3.0/dp_fisa_rx.c index 83d48b50c989..d0d84e40a9ce 100644 --- a/core/dp/txrx3.0/dp_fisa_rx.c +++ b/core/dp/txrx3.0/dp_fisa_rx.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -1607,7 +1607,16 @@ static bool dp_fisa_aggregation_should_stop( HAL_RX_TLV_GET_TCP_OFFSET(rx_tlv_hdr); uint32_t cumulative_ip_len_delta = hal_cumulative_ip_len - fisa_flow->hal_cumultive_ip_len; + bool ip_csum_err = hal_rx_attn_ip_cksum_fail_get(rx_tlv_hdr); + bool tcp_udp_csum_er = hal_rx_attn_tcp_udp_cksum_fail_get(rx_tlv_hdr); + /** + * 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. @@ -1620,6 +1629,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_er) || msdu_len < (l4_hdr_offset + 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 ||