From b8b1b51f32fa2956d07715043bcf9bfcd629bd63 Mon Sep 17 00:00:00 2001 From: Huashan Qu Date: Wed, 29 Dec 2021 17:40:28 +0800 Subject: [PATCH 1/3] qcacmn: Give SAE-PK AP more score to pass SAE-5.7.3 certification When do SAE-5.7.3 certification test case, STA will choose non SAE-PK AP to connect which is wrong expected result, non SAE-PK AP beacon will carry with QBSS IE that contributes more score than SAE-PK AP score config. Fix is to give SAE-PK AP more score to pass SAE-5.7.3 certification case. Change-Id: Ib3e516ccfa673e19f9bf0869aeffe4f5b1862a71 CRs-Fixed: 3101317 --- umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c | 2 +- .../dispatcher/inc/cfg_mlme_score_params.h | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c b/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c index 10b0805bbae6..843c042f6cc9 100644 --- a/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c +++ b/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c @@ -88,7 +88,7 @@ #define CM_OCE_WAN_WEIGHTAGE 2 #define CM_OCE_AP_TX_POWER_WEIGHTAGE 5 #define CM_OCE_SUBNET_ID_WEIGHTAGE 3 -#define CM_SAE_PK_AP_WEIGHTAGE 3 +#define CM_SAE_PK_AP_WEIGHTAGE 30 #define CM_BEST_CANDIDATE_MAX_WEIGHT 200 #define CM_MAX_PCT_SCORE 100 #define CM_MAX_INDEX_PER_INI 4 diff --git a/umac/mlme/connection_mgr/dispatcher/inc/cfg_mlme_score_params.h b/umac/mlme/connection_mgr/dispatcher/inc/cfg_mlme_score_params.h index 44cc92f4eeb0..1e1e4a522723 100644 --- a/umac/mlme/connection_mgr/dispatcher/inc/cfg_mlme_score_params.h +++ b/umac/mlme/connection_mgr/dispatcher/inc/cfg_mlme_score_params.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2021 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 @@ -384,8 +385,8 @@ * * sae_pk_ap_weightage - update scoring param based on SAE PK ap weightage * @Min: 0 - * @Max: 10 - * @Default: 3 + * @Max: 30 + * @Default: 30 * * This ini is used to calculate SAE PK ap weightage in roam score. SAE Public * Key (SAE-PK) authentication is an extension of SAE that is intended for use @@ -405,8 +406,8 @@ #define CFG_SAE_PK_AP_WEIGHTAGE CFG_INI_UINT( \ "sae_pk_ap_weightage", \ 0, \ - 10, \ - PLATFORM_VALUE(3, 0), \ + 30, \ + PLATFORM_VALUE(30, 0), \ CFG_VALUE_OR_DEFAULT,\ "SAE-PK AP weightage") From f581e7107b62b0825fe83cdef561545660c28a5b Mon Sep 17 00:00:00 2001 From: Ananya Gupta Date: Tue, 20 Sep 2022 12:20:07 +0530 Subject: [PATCH 2/3] qcacmn: Pause Tx HW enqueue when bus suspend in progress In SAP due to intrabss forwarding, Tx ring update is going through when WOW enable command has been sent to FW. This results in crash. To fix this, do not update HP when apps suspend is in progress. Change-Id: Id4176224563bdd759828397fa1cd23de1598192e CRs-Fixed: 3294407 --- dp/inc/cdp_txrx_cmn.h | 26 +++++++++++++++++++++++++- dp/inc/cdp_txrx_ops.h | 5 ++++- dp/wifi3.0/dp_main.c | 18 +++++++++++++++++- dp/wifi3.0/dp_types.h | 3 ++- 4 files changed, 48 insertions(+), 4 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index 5bd16a267db6..0fda782b97e4 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 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 @@ -2047,6 +2047,30 @@ cdp_txrx_set_pdev_status_down(ol_txrx_soc_handle soc, is_pdev_down); } +/** + * cdp_set_tx_pause() - Pause or resume tx path + * @soc_hdl: Datapath soc handle + * @flag: set or clear is_tx_pause + * + * Return: None. + */ +static inline +void cdp_set_tx_pause(ol_txrx_soc_handle soc, bool flag) +{ + if (!soc || !soc->ops) { + QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, + "%s: Invalid Instance:", __func__); + QDF_BUG(0); + return; + } + + if (!soc->ops->cmn_drv_ops || + !soc->ops->cmn_drv_ops->set_tx_pause) + return; + + soc->ops->cmn_drv_ops->set_tx_pause(soc, flag); +} + /** * cdp_tx_send() - enqueue frame for transmission * @soc: soc opaque handle diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 70f69eaa8582..d857ba819ed3 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 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 @@ -519,6 +519,9 @@ struct cdp_cmn_ops { uint32_t value); ol_txrx_tx_fp tx_send; + + void (*set_tx_pause)(ol_txrx_soc_handle soc, bool flag); + /** * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev * to deliver pkt to stack. diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 4451f5f47a76..7016cfacc9e6 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 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 @@ -11339,6 +11339,21 @@ dp_set_pkt_capture_mode(struct cdp_soc_t *soc_handle, bool val) } #endif +/** + * dp_set_tx_pause() - Pause or resume tx path + * @soc_hdl: Datapath soc handle + * @flag: set or clear is_tx_pause + * + * Return: None. + */ +static inline +void dp_set_tx_pause(struct cdp_soc_t *soc_hdl, bool flag) +{ + struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); + + soc->is_tx_pause = flag; +} + static struct cdp_cmn_ops dp_ops_cmn = { .txrx_soc_attach_target = dp_soc_attach_target_wifi3, .txrx_vdev_attach = dp_vdev_attach_wifi3, @@ -11411,6 +11426,7 @@ static struct cdp_cmn_ops dp_ops_cmn = { .txrx_set_ba_aging_timeout = dp_set_ba_aging_timeout, .txrx_get_ba_aging_timeout = dp_get_ba_aging_timeout, .tx_send = dp_tx_send, + .set_tx_pause = dp_set_tx_pause, .txrx_peer_reset_ast = dp_wds_reset_ast_wifi3, .txrx_peer_reset_ast_table = dp_wds_reset_ast_table_wifi3, .txrx_peer_flush_ast_table = dp_wds_flush_ast_table_wifi3, diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 637801776a70..ed8306bc8b3b 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 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 @@ -1926,6 +1926,7 @@ struct dp_soc { qdf_spinlock_t reo_desc_deferred_freelist_lock; bool reo_desc_deferred_freelist_init; #endif + bool is_tx_pause; }; #ifdef IPA_OFFLOAD From 38c775e7857b625805566d1bc32b430844b04a2e Mon Sep 17 00:00:00 2001 From: Venkateswara Naralasetty Date: Tue, 6 Dec 2022 18:50:16 +0530 Subject: [PATCH 3/3] qcacmn: Remove skip HP update logic during tx pause flag is set Currently HP update can skip for few packets if the system suspend is happening in parallel with tx. This could lead to SMMU fault if the skipped HP update goes after tx desc force free. Remove the tx pause check in HP updates and have the check before calling dp_tx_send in case of intra-bss forward case. No special handling is needed for non intra-bss case as we don't expect packets from network stack after suspend. Change-Id: Id4f2cefcc0a14e7c16438b9bda5cb1d55eb05050 CRs-Fixed: 3327818 --- dp/wifi3.0/dp_rx.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index 352832d0b6c4..2ad820e6703a 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 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 @@ -643,7 +643,8 @@ dp_rx_intrabss_fwd(struct dp_soc *soc, } } - if (!dp_tx_send((struct cdp_soc_t *)soc, + if (!soc->is_tx_pause && + !dp_tx_send((struct cdp_soc_t *)soc, ta_peer->vdev->vdev_id, nbuf)) { DP_STATS_INC_PKT(ta_peer, rx.intra_bss.pkts, 1, len); @@ -684,17 +685,18 @@ dp_rx_intrabss_fwd(struct dp_soc *soc, /* Set cb->ftype to intrabss FWD */ qdf_nbuf_set_tx_ftype(nbuf_copy, CB_FTYPE_INTRABSS_FWD); - if (dp_tx_send((struct cdp_soc_t *)soc, - ta_peer->vdev->vdev_id, nbuf_copy)) { + + if (!soc->is_tx_pause && !dp_tx_send((struct cdp_soc_t *)soc, + ta_peer->vdev->vdev_id, + nbuf_copy)) { + DP_STATS_INC_PKT(ta_peer, rx.intra_bss.pkts, 1, len); + tid_stats->intrabss_cnt++; + } else { DP_STATS_INC_PKT(ta_peer, rx.intra_bss.fail, 1, len); tid_stats->fail_cnt[INTRABSS_DROP]++; qdf_nbuf_free(nbuf_copy); - } else { - DP_STATS_INC_PKT(ta_peer, rx.intra_bss.pkts, 1, len); - tid_stats->intrabss_cnt++; } } - end: /* return false as we have to still send the original pkt * up the stack