From: Kalle Valo <kvalo@kernel.org>
To: Jeff Johnson <quic_jjohnson@quicinc.com>
Cc: <linux-wireless@vger.kernel.org>, <ath12k@lists.infradead.org>
Subject: Re: [PATCH 11/50] wifi: ath12k: add dp.c
Date: Fri, 21 Oct 2022 14:43:23 +0300 [thread overview]
Message-ID: <87czaljtb8.fsf@kernel.org> (raw)
In-Reply-To: <65a4750f-1798-a624-0a2e-96930f8ec816@quicinc.com> (Jeff Johnson's message of "Tue, 16 Aug 2022 08:17:19 -0700")
Jeff Johnson <quic_jjohnson@quicinc.com> writes:
> On 8/12/2022 9:09 AM, Kalle Valo wrote:
>> From: Kalle Valo <quic_kvalo@quicinc.com>
>>
>> (Patches split into one patch per file for easier review, but the final
>> commit will be one big patch. See the cover letter for more info.)
>>
>> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
[...]
>> +int ath12k_dp_peer_setup(struct ath12k *ar, int vdev_id, const u8 *addr)
>> +{
>> + struct ath12k_base *ab = ar->ab;
>> + struct ath12k_peer *peer;
>> + u32 reo_dest;
>> + int ret = 0, tid;
>> +
>> + /* NOTE: reo_dest ring id starts from 1 unlike mac_id which starts from 0 */
>> + reo_dest = ar->dp.mac_id + 1;
>> + ret = ath12k_wmi_set_peer_param(ar, addr, vdev_id,
>> + WMI_PEER_SET_DEFAULT_ROUTING,
>> + DP_RX_HASH_ENABLE | (reo_dest << 1));
>> +
>> + if (ret) {
>> + ath12k_warn(ab, "failed to set default routing %d peer :%pM
>> vdev_id :%d\n",
>> + ret, addr, vdev_id);
>> + return ret;
>> + }
>> +
>> + for (tid = 0; tid <= IEEE80211_NUM_TIDS; tid++) {
>> + ret = ath12k_dp_rx_peer_tid_setup(ar, addr, vdev_id, tid, 1, 0,
>> + HAL_PN_TYPE_NONE);
>> + if (ret) {
>> + ath12k_warn(ab, "failed to setup rxd tid queue for tid %d: %d\n",
>> + tid, ret);
>> + goto peer_clean;
>> + }
>> + }
>> +
>> + ret = ath12k_dp_rx_peer_frag_setup(ar, addr, vdev_id);
>> + if (ret) {
>> + ath12k_warn(ab, "failed to setup rx defrag context\n");
>> + return ret;
>
> why does this failure simply return whereas just previously upon the
> failure of ath12k_dp_rx_peer_tid_setup() we goto peer_clean. don't we
> need to do the peer_clean logic here as well to undo the
> ath12k_dp_rx_peer_tid_setup() calls?
Pradeep Kumar fixed this:
7887e032942a wifi: ath12k: fix dp peer setup error handling
>> +static
>> +void ath12k_dp_tx_get_vdev_bank_config(struct ath12k_base *ab,
>> struct ath12k_vif *arvif,
>> + u32 *bank_config)
>
> rather than be a void function with a writable param, why not return
> the bank_config as the function return value?
Pradeep Kumar also fixed this:
6b650b8d9fd3 wifi: ath12k: make bank_config as return value instead of an argument
>> +{
>> + enum hal_encrypt_type encrypt_type = 0;
>
> I would expect an enum initializer to be one of the enumerators.
> 0 is HAL_ENCRYPT_TYPE_WEP_40 -- is that really the correct value?
Also fixed in the above commit.
>> +static int ath12k_dp_tx_get_bank_profile(struct ath12k_base *ab,
>> struct ath12k_vif *arvif,
>> + struct ath12k_dp *dp)
>> +{
>> + int bank_id = DP_INVALID_BANK_ID;
>> + int i;
>> + u32 bank_config = 0;
>
> this initializer would be unnecessary if
> ath12k_dp_tx_get_vdev_bank_config() returns the config as the function
> return value instead of doing so by reference via a function param
Fixed in above commit.
>> +static void ath12k_dp_deinit_bank_profiles(struct ath12k_base *ab)
>> +{
>> + struct ath12k_dp *dp = &ab->dp;
>> +
>> + kfree(dp->bank_profiles);
>
> suggest setting dp->bank_profiles = NULL to avoid dangling pointer to
> freed memory
Pradeep Kumar fixed in:
d09d40c053b3 wifi: ath12k: fix dangling pointer during vdev bank profile cleanup
>> +static void ath12k_dp_srng_common_cleanup(struct ath12k_base *ab)
>> +{
>> + struct ath12k_dp *dp = &ab->dp;
>> + int i;
>> +
>> + ath12k_dp_srng_cleanup(ab, &dp->wbm_desc_rel_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->tcl_cmd_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->tcl_status_ring);
>> + for (i = 0; i < ab->hw_params->max_tx_ring; i++) {
>> + ath12k_dp_srng_cleanup(ab, &dp->tx_ring[i].tcl_data_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->tx_ring[i].tcl_comp_ring);
>> + }
>> + ath12k_dp_srng_cleanup(ab, &dp->reo_reinject_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->rx_rel_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->reo_except_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->reo_cmd_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->reo_status_ring);
>
> i'm used to seeing deinit code do things in reverse order of init
> code, but the above is doing things in the same order. yes it probably
> doesn't matter in this case, but if you consistently deinit in reverse
> order of init then you'll get it right in the cases where it does
> matter
Pradeep Kumar fixed in:
4a033426a7e2 wifi: ath12k: reverse the order of common srng cleanup
>> +int ath12k_dp_service_srng(struct ath12k_base *ab,
>> + struct ath12k_ext_irq_grp *irq_grp,
>> + int budget)
>> +{
>> + struct napi_struct *napi = &irq_grp->napi;
>> + int grp_id = irq_grp->grp_id;
>> + int work_done = 0;
>> + int i = 0, j;
>> + int tot_work_done = 0;
>> + bool flag;
>
> not a fan of a bool named flag.
>
> better would be a name that tells us what it means when the flag is set.
>
> I see this issue throughout the dp_mon functions:
> ath12k_dp_mon_process_ring(...bool flag)
> ath12k_dp_mon_srng_process(...bool flag, ...)
>
> looking further I see:
> #define ATH12K_DP_TX_MONITOR_MODE 0
> #define ATH12K_DP_RX_MONITOR_MODE 1
> (note 0 and 1 are not bool enumerators)
>
> and logic like:
> if (flag == ATH12K_DP_RX_MONITOR_MODE) {
>
> so IMO based upon this kind of logic it would make more sense to have
> either:
>
> an enum ath12k_dp_monitor_mode and use that everywhere, or
> rename bool flag to bool rx_mode and use that everywhere
Pradeep Kumar fixed in:
eaa2ce8b29bd wifi: ath12k: use enum for determining tx or rx monitor mode
>> + while (i < ab->hw_params->max_tx_ring) {
>> + if (ab->hw_params->ring_mask->tx[grp_id] &
>> + BIT(ab->hw_params->hal_ops->tcl_to_wbm_rbm_map[i].wbm_ring_num))
>> + ath12k_dp_tx_completion_handler(ab, i);
>> + i++;
>> + }
>> +
>> + if (ab->hw_params->ring_mask->rx_err[grp_id]) {
>> + work_done = ath12k_dp_rx_process_err(ab, napi, budget);
>> + budget -= work_done;
>> + tot_work_done += work_done;
>> + if (budget <= 0)
>> + goto done;
>> + }
>> +
>> + if (ab->hw_params->ring_mask->rx_wbm_rel[grp_id]) {
>> + work_done = ath12k_dp_rx_process_wbm_err(ab,
>> + napi,
>> + budget);
>> + budget -= work_done;
>> + tot_work_done += work_done;
>> +
>> + if (budget <= 0)
>> + goto done;
>> + }
>> +
>> + if (ab->hw_params->ring_mask->rx[grp_id]) {
>> + i = fls(ab->hw_params->ring_mask->rx[grp_id]) - 1;
>> + work_done = ath12k_dp_rx_process(ab, i, napi,
>> + budget);
>> + budget -= work_done;
>> + tot_work_done += work_done;
>> + if (budget <= 0)
>> + goto done;
>> + }
>> +
>> + if (ab->hw_params->ring_mask->rx_mon_dest[grp_id]) {
>> + for (i = 0; i < ab->num_radios; i++) {
>> + for (j = 0; j < ab->hw_params->num_rxmda_per_pdev; j++) {
>> + int id = i * ab->hw_params->num_rxmda_per_pdev + j;
>> + > + flag = ATH12K_DP_RX_MONITOR_MODE;
>
> this is invariant so it should be assigned outside the loops. yes, the
> compiler will probably do that for you, but why not do it yourself?
>
>> +
>> + if (ab->hw_params->ring_mask->rx_mon_dest[grp_id] &
>
> isn't ab->hw_params->ring_mask->rx_mon_dest[grp_id] also invariant?
>
>> + BIT(id)) {
>
> indentation the same as the code that follows makes it difficult to
> distinguish the condition from the conditional code
>
>> + work_done =
>> + ath12k_dp_mon_process_ring(ab, id, napi, budget,
>
> descendant is not indented from the first line, making it difficult to
> see the code structure
Pradeep Kumar fixed in:
8589ba1261da wifi: ath12k: cleanup monitor interrupt processing
>> + flag);
>> + budget -= work_done;
>> + tot_work_done += work_done;
>> +
>> + if (budget <= 0)
>> + goto done;
>> + }
>> + }
>> + }
>> + }
>> +
>> + if (ab->hw_params->ring_mask->tx_mon_dest[grp_id]) {
>
> this block of code has the same issues as the RX block. in fact it
> seems that this block is identical to the block above other than the
> flag and the tx_mon_desc vs rx_mon_desc, so I'm curious if it could be
> refactored into a single function that could be used by both tx and rx
> instead of duplicating code
No refactoring but the commit above also cleaned up this one.
>> +int ath12k_dp_pdev_alloc(struct ath12k_base *ab)
>> +{
>> + struct ath12k *ar;
>> + int ret;
>> + int i;
>> +
>> + ret = ath12k_dp_rx_htt_setup(ab);
>> + if (ret)
>> + goto out;
>> +
>> + /* TODO: Per-pdev rx ring unlike tx ring which is mapped to different AC's */
>> + for (i = 0; i < ab->num_radios; i++) {
>> + ar = ab->pdevs[i].ar;
>> + ret = ath12k_dp_rx_pdev_alloc(ab, i);
>> + if (ret) {
>> + ath12k_warn(ab, "failed to allocate pdev rx for pdev_id :%d\n",
>> + i);
>> + goto err;
>> + }
>> + ret = ath12k_dp_rx_pdev_mon_attach(ar);
>> + if (ret) {
>> + ath12k_warn(ab, "failed to initialize mon pdev %d\n",
>> + i);
>
> nit: unnecssary line break
Pradeep Kumar fixed in:
54ea2140eb0f wifi: ath12k: avoid using memset for initializing structure
>> +int ath12k_dp_htt_connect(struct ath12k_dp *dp)
>> +{
>> + struct ath12k_htc_svc_conn_req conn_req;
>> + struct ath12k_htc_svc_conn_resp conn_resp;
>> + int status;
>> +
>> + memset(&conn_req, 0, sizeof(conn_req));
>> + memset(&conn_resp, 0, sizeof(conn_resp));
>
> consider using = {} initializers
Fixed in the above commit.
>> +static void ath12k_dp_cc_cleanup(struct ath12k_base *ab)
>> +{
>> + struct ath12k_rx_desc_info *desc_info, *tmp;
>> + struct ath12k_tx_desc_info *tx_desc_info, *tmp1;
>> + struct ath12k_dp *dp = &ab->dp;
>> + struct sk_buff *skb;
>> + int i;
>> +
>> + if (!dp->spt_info)
>> + return;
>> +
>> + /* RX Descriptor cleanup */
>> + spin_lock_bh(&dp->rx_desc_lock);
>> +
>> + list_for_each_entry_safe(desc_info, tmp, &dp->rx_desc_used_list, list) {
>> + list_del(&desc_info->list);
>> + skb = desc_info->skb;
>> +
>> + if (!skb)
>> + continue;
>> +
>> + dma_unmap_single(ab->dev, ATH12K_SKB_RXCB(skb)->paddr,
>> + skb->len + skb_tailroom(skb), DMA_FROM_DEVICE);
>> + dev_kfree_skb_any(skb);
>> + }
>> +
>> + spin_unlock_bh(&dp->rx_desc_lock);
>> +
>> + /* TX Descriptor cleanup */
>> + for (i = 0; i < ATH12K_HW_MAX_QUEUES; i++) {
>> + spin_lock_bh(&dp->tx_desc_lock[i]);
>> +
>> + list_for_each_entry_safe(tx_desc_info, tmp1,
>> &dp->tx_desc_used_list[i],
>> + list) {
>> + list_del(&tx_desc_info->list);
>> + skb = tx_desc_info->skb;
>> +
>> + if (!skb)
>> + continue;
>> +
>> + dma_unmap_single(ab->dev, ATH12K_SKB_RXCB(skb)->paddr,
>
> why RXCB() in the TX path?
That's a good question, I added it to my todo list.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
--
ath12k mailing list
ath12k@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/ath12k
WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@kernel.org>
To: Jeff Johnson <quic_jjohnson@quicinc.com>
Cc: <linux-wireless@vger.kernel.org>, <ath12k@lists.infradead.org>
Subject: Re: [PATCH 11/50] wifi: ath12k: add dp.c
Date: Fri, 21 Oct 2022 14:43:23 +0300 [thread overview]
Message-ID: <87czaljtb8.fsf@kernel.org> (raw)
In-Reply-To: <65a4750f-1798-a624-0a2e-96930f8ec816@quicinc.com> (Jeff Johnson's message of "Tue, 16 Aug 2022 08:17:19 -0700")
Jeff Johnson <quic_jjohnson@quicinc.com> writes:
> On 8/12/2022 9:09 AM, Kalle Valo wrote:
>> From: Kalle Valo <quic_kvalo@quicinc.com>
>>
>> (Patches split into one patch per file for easier review, but the final
>> commit will be one big patch. See the cover letter for more info.)
>>
>> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
[...]
>> +int ath12k_dp_peer_setup(struct ath12k *ar, int vdev_id, const u8 *addr)
>> +{
>> + struct ath12k_base *ab = ar->ab;
>> + struct ath12k_peer *peer;
>> + u32 reo_dest;
>> + int ret = 0, tid;
>> +
>> + /* NOTE: reo_dest ring id starts from 1 unlike mac_id which starts from 0 */
>> + reo_dest = ar->dp.mac_id + 1;
>> + ret = ath12k_wmi_set_peer_param(ar, addr, vdev_id,
>> + WMI_PEER_SET_DEFAULT_ROUTING,
>> + DP_RX_HASH_ENABLE | (reo_dest << 1));
>> +
>> + if (ret) {
>> + ath12k_warn(ab, "failed to set default routing %d peer :%pM
>> vdev_id :%d\n",
>> + ret, addr, vdev_id);
>> + return ret;
>> + }
>> +
>> + for (tid = 0; tid <= IEEE80211_NUM_TIDS; tid++) {
>> + ret = ath12k_dp_rx_peer_tid_setup(ar, addr, vdev_id, tid, 1, 0,
>> + HAL_PN_TYPE_NONE);
>> + if (ret) {
>> + ath12k_warn(ab, "failed to setup rxd tid queue for tid %d: %d\n",
>> + tid, ret);
>> + goto peer_clean;
>> + }
>> + }
>> +
>> + ret = ath12k_dp_rx_peer_frag_setup(ar, addr, vdev_id);
>> + if (ret) {
>> + ath12k_warn(ab, "failed to setup rx defrag context\n");
>> + return ret;
>
> why does this failure simply return whereas just previously upon the
> failure of ath12k_dp_rx_peer_tid_setup() we goto peer_clean. don't we
> need to do the peer_clean logic here as well to undo the
> ath12k_dp_rx_peer_tid_setup() calls?
Pradeep Kumar fixed this:
7887e032942a wifi: ath12k: fix dp peer setup error handling
>> +static
>> +void ath12k_dp_tx_get_vdev_bank_config(struct ath12k_base *ab,
>> struct ath12k_vif *arvif,
>> + u32 *bank_config)
>
> rather than be a void function with a writable param, why not return
> the bank_config as the function return value?
Pradeep Kumar also fixed this:
6b650b8d9fd3 wifi: ath12k: make bank_config as return value instead of an argument
>> +{
>> + enum hal_encrypt_type encrypt_type = 0;
>
> I would expect an enum initializer to be one of the enumerators.
> 0 is HAL_ENCRYPT_TYPE_WEP_40 -- is that really the correct value?
Also fixed in the above commit.
>> +static int ath12k_dp_tx_get_bank_profile(struct ath12k_base *ab,
>> struct ath12k_vif *arvif,
>> + struct ath12k_dp *dp)
>> +{
>> + int bank_id = DP_INVALID_BANK_ID;
>> + int i;
>> + u32 bank_config = 0;
>
> this initializer would be unnecessary if
> ath12k_dp_tx_get_vdev_bank_config() returns the config as the function
> return value instead of doing so by reference via a function param
Fixed in above commit.
>> +static void ath12k_dp_deinit_bank_profiles(struct ath12k_base *ab)
>> +{
>> + struct ath12k_dp *dp = &ab->dp;
>> +
>> + kfree(dp->bank_profiles);
>
> suggest setting dp->bank_profiles = NULL to avoid dangling pointer to
> freed memory
Pradeep Kumar fixed in:
d09d40c053b3 wifi: ath12k: fix dangling pointer during vdev bank profile cleanup
>> +static void ath12k_dp_srng_common_cleanup(struct ath12k_base *ab)
>> +{
>> + struct ath12k_dp *dp = &ab->dp;
>> + int i;
>> +
>> + ath12k_dp_srng_cleanup(ab, &dp->wbm_desc_rel_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->tcl_cmd_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->tcl_status_ring);
>> + for (i = 0; i < ab->hw_params->max_tx_ring; i++) {
>> + ath12k_dp_srng_cleanup(ab, &dp->tx_ring[i].tcl_data_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->tx_ring[i].tcl_comp_ring);
>> + }
>> + ath12k_dp_srng_cleanup(ab, &dp->reo_reinject_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->rx_rel_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->reo_except_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->reo_cmd_ring);
>> + ath12k_dp_srng_cleanup(ab, &dp->reo_status_ring);
>
> i'm used to seeing deinit code do things in reverse order of init
> code, but the above is doing things in the same order. yes it probably
> doesn't matter in this case, but if you consistently deinit in reverse
> order of init then you'll get it right in the cases where it does
> matter
Pradeep Kumar fixed in:
4a033426a7e2 wifi: ath12k: reverse the order of common srng cleanup
>> +int ath12k_dp_service_srng(struct ath12k_base *ab,
>> + struct ath12k_ext_irq_grp *irq_grp,
>> + int budget)
>> +{
>> + struct napi_struct *napi = &irq_grp->napi;
>> + int grp_id = irq_grp->grp_id;
>> + int work_done = 0;
>> + int i = 0, j;
>> + int tot_work_done = 0;
>> + bool flag;
>
> not a fan of a bool named flag.
>
> better would be a name that tells us what it means when the flag is set.
>
> I see this issue throughout the dp_mon functions:
> ath12k_dp_mon_process_ring(...bool flag)
> ath12k_dp_mon_srng_process(...bool flag, ...)
>
> looking further I see:
> #define ATH12K_DP_TX_MONITOR_MODE 0
> #define ATH12K_DP_RX_MONITOR_MODE 1
> (note 0 and 1 are not bool enumerators)
>
> and logic like:
> if (flag == ATH12K_DP_RX_MONITOR_MODE) {
>
> so IMO based upon this kind of logic it would make more sense to have
> either:
>
> an enum ath12k_dp_monitor_mode and use that everywhere, or
> rename bool flag to bool rx_mode and use that everywhere
Pradeep Kumar fixed in:
eaa2ce8b29bd wifi: ath12k: use enum for determining tx or rx monitor mode
>> + while (i < ab->hw_params->max_tx_ring) {
>> + if (ab->hw_params->ring_mask->tx[grp_id] &
>> + BIT(ab->hw_params->hal_ops->tcl_to_wbm_rbm_map[i].wbm_ring_num))
>> + ath12k_dp_tx_completion_handler(ab, i);
>> + i++;
>> + }
>> +
>> + if (ab->hw_params->ring_mask->rx_err[grp_id]) {
>> + work_done = ath12k_dp_rx_process_err(ab, napi, budget);
>> + budget -= work_done;
>> + tot_work_done += work_done;
>> + if (budget <= 0)
>> + goto done;
>> + }
>> +
>> + if (ab->hw_params->ring_mask->rx_wbm_rel[grp_id]) {
>> + work_done = ath12k_dp_rx_process_wbm_err(ab,
>> + napi,
>> + budget);
>> + budget -= work_done;
>> + tot_work_done += work_done;
>> +
>> + if (budget <= 0)
>> + goto done;
>> + }
>> +
>> + if (ab->hw_params->ring_mask->rx[grp_id]) {
>> + i = fls(ab->hw_params->ring_mask->rx[grp_id]) - 1;
>> + work_done = ath12k_dp_rx_process(ab, i, napi,
>> + budget);
>> + budget -= work_done;
>> + tot_work_done += work_done;
>> + if (budget <= 0)
>> + goto done;
>> + }
>> +
>> + if (ab->hw_params->ring_mask->rx_mon_dest[grp_id]) {
>> + for (i = 0; i < ab->num_radios; i++) {
>> + for (j = 0; j < ab->hw_params->num_rxmda_per_pdev; j++) {
>> + int id = i * ab->hw_params->num_rxmda_per_pdev + j;
>> + > + flag = ATH12K_DP_RX_MONITOR_MODE;
>
> this is invariant so it should be assigned outside the loops. yes, the
> compiler will probably do that for you, but why not do it yourself?
>
>> +
>> + if (ab->hw_params->ring_mask->rx_mon_dest[grp_id] &
>
> isn't ab->hw_params->ring_mask->rx_mon_dest[grp_id] also invariant?
>
>> + BIT(id)) {
>
> indentation the same as the code that follows makes it difficult to
> distinguish the condition from the conditional code
>
>> + work_done =
>> + ath12k_dp_mon_process_ring(ab, id, napi, budget,
>
> descendant is not indented from the first line, making it difficult to
> see the code structure
Pradeep Kumar fixed in:
8589ba1261da wifi: ath12k: cleanup monitor interrupt processing
>> + flag);
>> + budget -= work_done;
>> + tot_work_done += work_done;
>> +
>> + if (budget <= 0)
>> + goto done;
>> + }
>> + }
>> + }
>> + }
>> +
>> + if (ab->hw_params->ring_mask->tx_mon_dest[grp_id]) {
>
> this block of code has the same issues as the RX block. in fact it
> seems that this block is identical to the block above other than the
> flag and the tx_mon_desc vs rx_mon_desc, so I'm curious if it could be
> refactored into a single function that could be used by both tx and rx
> instead of duplicating code
No refactoring but the commit above also cleaned up this one.
>> +int ath12k_dp_pdev_alloc(struct ath12k_base *ab)
>> +{
>> + struct ath12k *ar;
>> + int ret;
>> + int i;
>> +
>> + ret = ath12k_dp_rx_htt_setup(ab);
>> + if (ret)
>> + goto out;
>> +
>> + /* TODO: Per-pdev rx ring unlike tx ring which is mapped to different AC's */
>> + for (i = 0; i < ab->num_radios; i++) {
>> + ar = ab->pdevs[i].ar;
>> + ret = ath12k_dp_rx_pdev_alloc(ab, i);
>> + if (ret) {
>> + ath12k_warn(ab, "failed to allocate pdev rx for pdev_id :%d\n",
>> + i);
>> + goto err;
>> + }
>> + ret = ath12k_dp_rx_pdev_mon_attach(ar);
>> + if (ret) {
>> + ath12k_warn(ab, "failed to initialize mon pdev %d\n",
>> + i);
>
> nit: unnecssary line break
Pradeep Kumar fixed in:
54ea2140eb0f wifi: ath12k: avoid using memset for initializing structure
>> +int ath12k_dp_htt_connect(struct ath12k_dp *dp)
>> +{
>> + struct ath12k_htc_svc_conn_req conn_req;
>> + struct ath12k_htc_svc_conn_resp conn_resp;
>> + int status;
>> +
>> + memset(&conn_req, 0, sizeof(conn_req));
>> + memset(&conn_resp, 0, sizeof(conn_resp));
>
> consider using = {} initializers
Fixed in the above commit.
>> +static void ath12k_dp_cc_cleanup(struct ath12k_base *ab)
>> +{
>> + struct ath12k_rx_desc_info *desc_info, *tmp;
>> + struct ath12k_tx_desc_info *tx_desc_info, *tmp1;
>> + struct ath12k_dp *dp = &ab->dp;
>> + struct sk_buff *skb;
>> + int i;
>> +
>> + if (!dp->spt_info)
>> + return;
>> +
>> + /* RX Descriptor cleanup */
>> + spin_lock_bh(&dp->rx_desc_lock);
>> +
>> + list_for_each_entry_safe(desc_info, tmp, &dp->rx_desc_used_list, list) {
>> + list_del(&desc_info->list);
>> + skb = desc_info->skb;
>> +
>> + if (!skb)
>> + continue;
>> +
>> + dma_unmap_single(ab->dev, ATH12K_SKB_RXCB(skb)->paddr,
>> + skb->len + skb_tailroom(skb), DMA_FROM_DEVICE);
>> + dev_kfree_skb_any(skb);
>> + }
>> +
>> + spin_unlock_bh(&dp->rx_desc_lock);
>> +
>> + /* TX Descriptor cleanup */
>> + for (i = 0; i < ATH12K_HW_MAX_QUEUES; i++) {
>> + spin_lock_bh(&dp->tx_desc_lock[i]);
>> +
>> + list_for_each_entry_safe(tx_desc_info, tmp1,
>> &dp->tx_desc_used_list[i],
>> + list) {
>> + list_del(&tx_desc_info->list);
>> + skb = tx_desc_info->skb;
>> +
>> + if (!skb)
>> + continue;
>> +
>> + dma_unmap_single(ab->dev, ATH12K_SKB_RXCB(skb)->paddr,
>
> why RXCB() in the TX path?
That's a good question, I added it to my todo list.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2022-10-21 11:43 UTC|newest]
Thread overview: 265+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-12 16:09 [PATCH 00/50] wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 01/50] wifi: ath12k: add Kconfig Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 02/50] wifi: ath12k: add Makefile Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 03/50] wifi: ath12k: add ce.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-09-13 4:28 ` Ping-Ke Shih
2022-09-13 4:28 ` Ping-Ke Shih
2022-10-04 11:08 ` Karthikeyan Periyasamy (QUIC)
2022-10-04 11:08 ` Karthikeyan Periyasamy (QUIC)
2022-08-12 16:09 ` [PATCH 04/50] wifi: ath12k: add ce.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 05/50] wifi: ath12k: add core.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-09-13 6:18 ` Ping-Ke Shih
2022-09-13 6:18 ` Ping-Ke Shih
2022-10-12 23:12 ` Sriram R (QUIC)
2022-10-12 23:12 ` Sriram R (QUIC)
2022-10-21 8:32 ` Kalle Valo
2022-10-21 8:32 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 06/50] wifi: ath12k: add core.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-13 0:16 ` Jeff Johnson
2022-08-13 0:16 ` Jeff Johnson
2022-10-21 10:58 ` Kalle Valo
2022-10-21 10:58 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 07/50] wifi: ath12k: add dbring.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-15 19:55 ` Jeff Johnson
2022-10-21 11:06 ` Kalle Valo
2022-10-21 11:06 ` Kalle Valo
2022-11-09 9:12 ` Kalle Valo
2022-11-09 9:12 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 08/50] wifi: ath12k: add dbring.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-15 19:59 ` Jeff Johnson
2022-10-21 11:07 ` Kalle Valo
2022-10-21 11:07 ` Kalle Valo
2022-10-21 11:12 ` Kalle Valo
2022-10-21 11:12 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 09/50] wifi: ath12k: add debug.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 10/50] wifi: ath12k: add debug.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-15 20:11 ` Jeff Johnson
2022-10-21 11:18 ` Kalle Valo
2022-10-21 11:18 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 11/50] wifi: ath12k: add dp.c Kalle Valo
2022-10-11 19:20 ` Pradeep Kumar Chitrapu
2022-08-12 16:09 ` Kalle Valo
2022-08-16 15:17 ` Jeff Johnson
2022-08-16 15:17 ` Jeff Johnson
[not found] ` <CH0PR02MB82123C176B0E05156B66C9F1F6229@CH0PR02MB8212.namprd02.prod.outlook.com>
[not found] ` <94e894a8-a262-959e-a6ab-869dcba9e0fa@quicinc.com>
2022-10-13 16:37 ` Pradeep Kumar Chitrapu
2022-10-13 16:37 ` Pradeep Kumar Chitrapu
2022-10-13 20:17 ` Jeff Johnson
2022-10-13 20:17 ` Jeff Johnson
2022-10-21 11:43 ` Kalle Valo [this message]
2022-10-21 11:43 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 12/50] wifi: ath12k: add dp.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-15 1:56 ` Ping-Ke Shih
2022-08-15 1:56 ` Ping-Ke Shih
2022-09-05 17:27 ` Kalle Valo
2022-09-05 17:27 ` Kalle Valo
2022-10-21 11:45 ` Kalle Valo
2022-10-21 11:45 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 13/50] wifi: ath12k: add dp_mon.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-16 20:13 ` Jeff Johnson
2022-08-16 20:13 ` Jeff Johnson
2022-10-21 13:07 ` Kalle Valo
2022-10-21 13:07 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 14/50] wifi: ath12k: add dp_mon.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 15/50] wifi: ath12k: add dp_rx.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-17 0:37 ` Jeff Johnson
2022-08-17 0:37 ` Jeff Johnson
2022-10-12 23:29 ` Sriram R (QUIC)
2022-10-12 23:29 ` Sriram R (QUIC)
2022-10-13 6:48 ` Jeff Johnson
2022-10-13 6:48 ` Jeff Johnson
2022-10-14 2:43 ` Sriram R (QUIC)
2022-10-14 2:43 ` Sriram R (QUIC)
2022-10-14 3:01 ` Sriram R (QUIC)
2022-10-14 3:01 ` Sriram R (QUIC)
2022-10-21 13:13 ` Kalle Valo
2022-10-21 13:13 ` Kalle Valo
2022-08-17 23:19 ` Jeff Johnson
2022-08-17 23:19 ` Jeff Johnson
2022-10-12 23:27 ` Sriram R (QUIC)
2022-10-12 23:27 ` Sriram R (QUIC)
2022-10-12 23:39 ` Sriram R (QUIC)
2022-10-12 23:39 ` Sriram R (QUIC)
2022-10-13 6:50 ` Jeff Johnson
2022-10-13 6:50 ` Jeff Johnson
2022-10-14 2:43 ` Sriram R (QUIC)
2022-10-14 2:43 ` Sriram R (QUIC)
2022-10-13 5:54 ` Sriram R (QUIC)
2022-10-13 5:54 ` Sriram R (QUIC)
2022-10-21 13:30 ` Kalle Valo
2022-10-21 13:30 ` Kalle Valo
2022-10-21 13:52 ` Kalle Valo
2022-10-21 13:52 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 16/50] wifi: ath12k: add dp_rx.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 17/50] wifi: ath12k: add dp_tx.c Kalle Valo
2022-10-11 19:20 ` Pradeep Kumar Chitrapu
2022-08-12 16:09 ` Kalle Valo
2022-08-17 23:35 ` Jeff Johnson
2022-08-17 23:35 ` Jeff Johnson
[not found] ` <CH0PR02MB821206158809DF78955A0EC8F6249@CH0PR02MB8212.namprd02.prod.outlook.com>
2022-10-14 7:49 ` Pradeep Kumar Chitrapu
2022-10-14 7:49 ` Pradeep Kumar Chitrapu
2022-11-08 13:14 ` Kalle Valo
2022-11-08 13:14 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 18/50] wifi: ath12k: add dp_tx.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 19/50] wifi: ath12k: add hal.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-17 23:52 ` Jeff Johnson
2022-08-17 23:52 ` Jeff Johnson
2022-10-04 11:13 ` Karthikeyan Periyasamy (QUIC)
2022-10-04 11:13 ` Karthikeyan Periyasamy (QUIC)
2022-08-12 16:09 ` [PATCH 20/50] wifi: ath12k: add hal.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 21/50] wifi: ath12k: add hal_desc.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 22/50] wifi: ath12k: add hal_rx.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 23/50] wifi: ath12k: add hal_rx.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-18 0:21 ` Jeff Johnson
2022-08-18 0:21 ` Jeff Johnson
2022-10-04 11:15 ` Karthikeyan Periyasamy (QUIC)
2022-10-04 11:15 ` Karthikeyan Periyasamy (QUIC)
2022-08-12 16:09 ` [PATCH 24/50] wifi: ath12k: add hal_tx.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-18 17:21 ` Jeff Johnson
2022-08-18 17:21 ` Jeff Johnson
2022-10-04 11:20 ` Karthikeyan Periyasamy (QUIC)
2022-10-04 11:20 ` Karthikeyan Periyasamy (QUIC)
2022-08-12 16:09 ` [PATCH 25/50] wifi: ath12k: add hal_tx.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 26/50] wifi: ath12k: add hif.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 27/50] wifi: ath12k: add htc.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-18 19:33 ` Jeff Johnson
2022-08-18 19:33 ` Jeff Johnson
2022-10-04 11:23 ` Karthikeyan Periyasamy (QUIC)
2022-10-04 11:23 ` Karthikeyan Periyasamy (QUIC)
2022-08-12 16:09 ` [PATCH 28/50] wifi: ath12k: add htc.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-18 21:10 ` Jeff Johnson
2022-08-18 21:10 ` Jeff Johnson
2022-10-04 11:27 ` Karthikeyan Periyasamy (QUIC)
2022-10-04 11:27 ` Karthikeyan Periyasamy (QUIC)
2022-08-12 16:09 ` [PATCH 29/50] wifi: ath12k: add hw.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-18 21:31 ` Jeff Johnson
2022-08-18 21:31 ` Jeff Johnson
2022-10-04 11:28 ` Karthikeyan Periyasamy (QUIC)
2022-10-04 11:28 ` Karthikeyan Periyasamy (QUIC)
2022-08-12 16:09 ` [PATCH 30/50] wifi: ath12k: add hw.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-18 22:30 ` Jeff Johnson
2022-08-18 22:30 ` Jeff Johnson
2022-11-08 13:27 ` Kalle Valo
2022-11-08 13:27 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 31/50] wifi: ath12k: add mac.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-15 6:09 ` Ping-Ke Shih
2022-08-15 6:09 ` Ping-Ke Shih
2022-09-05 17:31 ` Kalle Valo
2022-09-05 17:31 ` Kalle Valo
2022-08-16 18:09 ` Jeff Johnson
2022-08-16 18:09 ` Jeff Johnson
2022-11-08 13:55 ` Kalle Valo
2022-11-08 13:55 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 32/50] wifi: ath12k: add mac.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 33/50] wifi: ath12k: add mhi.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-18 22:25 ` Jeff Johnson
2022-08-18 22:25 ` Jeff Johnson
2022-08-19 18:56 ` Jeff Johnson
2022-08-19 18:56 ` Jeff Johnson
2022-11-08 14:00 ` Kalle Valo
2022-11-08 14:00 ` Kalle Valo
2022-11-09 16:49 ` Jeff Johnson
2022-11-09 16:49 ` Jeff Johnson
2022-08-12 16:09 ` [PATCH 34/50] wifi: ath12k: add mhi.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-18 22:30 ` Jeff Johnson
2022-08-18 22:30 ` Jeff Johnson
2022-11-08 14:01 ` Kalle Valo
2022-11-08 14:01 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 35/50] wifi: ath12k: add pci.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-18 23:02 ` Jeff Johnson
2022-08-18 23:02 ` Jeff Johnson
2022-11-08 14:45 ` Kalle Valo
2022-11-08 14:45 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 36/50] wifi: ath12k: add pci.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-18 23:18 ` Jeff Johnson
2022-08-18 23:18 ` Jeff Johnson
2022-11-08 14:56 ` Kalle Valo
2022-11-08 14:56 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 37/50] wifi: ath12k: add peer.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-18 23:34 ` Jeff Johnson
2022-08-18 23:34 ` Jeff Johnson
2022-10-04 11:30 ` Karthikeyan Periyasamy (QUIC)
2022-10-04 11:30 ` Karthikeyan Periyasamy (QUIC)
2022-08-12 16:09 ` [PATCH 38/50] wifi: ath12k: add peer.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-17 19:25 ` Jeff Johnson
2022-08-17 19:25 ` Jeff Johnson
2022-10-12 23:13 ` Sriram R (QUIC)
2022-10-12 23:13 ` Sriram R (QUIC)
2022-08-12 16:09 ` [PATCH 39/50] wifi: ath12k: add qmi.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-22 17:14 ` Jeff Johnson
2022-08-22 17:14 ` Jeff Johnson
2022-11-08 14:59 ` Kalle Valo
2022-11-08 14:59 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 40/50] wifi: ath12k: add qmi.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-19 0:25 ` Jeff Johnson
2022-08-19 0:25 ` Jeff Johnson
2022-11-08 15:06 ` Kalle Valo
2022-11-08 15:06 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 41/50] wifi: ath12k: add reg.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 42/50] wifi: ath12k: add reg.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 43/50] wifi: ath12k: add rx_desc.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 44/50] wifi: ath12k: add trace.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 45/50] wifi: ath12k: add trace.h Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-12 16:09 ` [PATCH 46/50] wifi: ath12k: add wmi.c Kalle Valo
2022-08-12 16:09 ` Kalle Valo
2022-08-19 20:45 ` Jeff Johnson
2022-08-19 20:45 ` Jeff Johnson
2022-09-07 7:36 ` Ping-Ke Shih
2022-09-07 7:36 ` Ping-Ke Shih
2022-11-08 15:40 ` Kalle Valo
2022-11-08 15:40 ` Kalle Valo
2022-08-12 16:10 ` [PATCH 47/50] wifi: ath12k: add wmi.h Kalle Valo
2022-08-12 16:10 ` Kalle Valo
2022-08-19 1:11 ` Jeff Johnson
2022-08-19 1:11 ` Jeff Johnson
2022-11-08 15:43 ` Kalle Valo
2022-11-08 15:43 ` Kalle Valo
2022-08-12 16:10 ` [PATCH 48/50] wifi: ath: add ath12k to Makefile Kalle Valo
2022-08-12 16:10 ` Kalle Valo
2022-08-12 16:10 ` [PATCH 49/50] wifi: ath: add ath12k to Kconfig Kalle Valo
2022-08-12 16:10 ` Kalle Valo
2022-08-12 16:10 ` [PATCH 50/50] MAINTAINERS: add ath12k Kalle Valo
2022-08-12 16:10 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87czaljtb8.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=ath12k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_jjohnson@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.