qcacld-3.0: stop fisa aggregation if cumulative_ip_len not match msdu_len

If current msdu length - l4 header offset value is not matched with
cumulative IP length delta fetched from HW TLV, stop current fisa
aggregation.

Change-Id: Ia686a638a698d705db3c6bda58e85e4d94f323a1
CRs-Fixed: 2727291
This commit is contained in:
Jinwei Chen
2020-07-08 06:49:13 -07:00
committed by nshrivas
parent baca2a3950
commit ebda2c45c3

View File

@@ -904,26 +904,35 @@ static void dp_rx_fisa_flush_flow(struct dp_vdev *vdev,
* @fisa_flow: Handle SW flow entry
* @hal_aggr_count: current aggregate count from RX PKT TLV
* @hal_cumulative_ip_len: current cumulative ip length from RX PKT TLV
* @rx_tlv_hdr: current msdu RX PKT TLV
*
* Return: true - current flow aggregation should stop,
false - continue to aggregate.
*/
static inline bool dp_fisa_aggregation_should_stop(
static bool dp_fisa_aggregation_should_stop(
struct dp_fisa_rx_sw_ft *fisa_flow,
uint32_t hal_aggr_count,
uint16_t hal_cumulative_ip_len)
uint16_t hal_cumulative_ip_len,
uint8_t *rx_tlv_hdr)
{
uint32_t msdu_len = hal_rx_msdu_start_msdu_len_get(rx_tlv_hdr);
uint32_t l4_hdr_offset = HAL_RX_TLV_GET_IP_OFFSET(rx_tlv_hdr) +
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;
/**
* current cumulative ip length should > last cumulative_ip_len
* and <= last cumulative_ip_len + 1478, also current aggregate
* count should be equal to last aggregate count + 1,
* cumulative_ip_len delta should be equal to current msdu length
* - l4 header offset,
* otherwise, current fisa flow aggregation should be stopped.
*/
if (fisa_flow->do_not_aggregate ||
hal_cumulative_ip_len <= fisa_flow->hal_cumultive_ip_len ||
(hal_cumulative_ip_len - fisa_flow->hal_cumultive_ip_len)
> FISA_MAX_SINGLE_CUMULATIVE_IP_LEN ||
(fisa_flow->last_hal_aggr_count + 1) != hal_aggr_count)
cumulative_ip_len_delta > FISA_MAX_SINGLE_CUMULATIVE_IP_LEN ||
(fisa_flow->last_hal_aggr_count + 1) != hal_aggr_count ||
cumulative_ip_len_delta != (msdu_len - l4_hdr_offset))
return true;
return false;
@@ -980,7 +989,8 @@ static int dp_add_nbuf_to_fisa_flow(struct dp_rx_fst *fisa_hdl,
} else if (qdf_unlikely(dp_fisa_aggregation_should_stop(
fisa_flow,
hal_aggr_count,
hal_cumulative_ip_len))) {
hal_cumulative_ip_len,
rx_tlv_hdr))) {
/* Either HW cumulative ip length is wrong, or packet is missed
* Flush the flow and do not aggregate until next start new
* aggreagtion