From: "Nicolas Escande" <nico.escande@gmail.com>
To: "Karthikeyan Periyasamy" <quic_periyasa@quicinc.com>
Cc: <repk@triplefau.lt>, <ath12k@lists.infradead.org>
Subject: Re: Wrong place for rxbaddr/txbaddr to be in struct ath12k_spt_info
Date: Wed, 28 Aug 2024 23:02:47 +0200 [thread overview]
Message-ID: <D3RUKAFELUWP.XTR6V4GB7JXS@gmail.com> (raw)
In-Reply-To: <ce8201cc-f01f-77e1-f5eb-ab0d6e0bd36a@quicinc.com>
On Wed Aug 28, 2024 at 6:58 PM CEST, Karthikeyan Periyasamy wrote:
>
>
> On 8/28/2024 7:34 PM, Nicolas Escande wrote:
> > Hi there,
> >
> > Looking into a problem we have on an ath12k platform at work with a colleague,
> > I stumbled upon something that seems weird.
> >
> > The interresting parts of dh.h:
> >
> > struct ath12k_spt_info {
> > dma_addr_t paddr;
> > u64 *vaddr;
> > struct ath12k_rx_desc_info *rxbaddr[ATH12K_NUM_RX_SPT_PAGES];
> > struct ath12k_tx_desc_info *txbaddr[ATH12K_NUM_TX_SPT_PAGES];
> > };
> >
> > ...
> >
> > struct ath12k_dp {
> > struct ath12k_base *ab;
> > ...
> > struct ath12k_spt_info *spt_info;
> > u32 num_spt_pages;
> > u32 rx_ppt_base;
> > ...
> > };
> >
> > In dp.c we have ath12k_dp_cc_desc_init that allocs arrays of ath12k_rx_desc_info
> > stores the addresses of the individual desc in each of the spt entries using
> > ath12k_dp_cc_get_desc_addr_ptr(), but we also save the address of the whole
> > array for later cleanup by dp->spt_info->rxbaddr[i] = &rx_descs[0];
> >
> > Surely this is wrong, with the current code we always use the first element of
> > dp->spt_info to store all the descriptors arrays. And the same goes for txbaddr.
> > I mean it works, but we loose memory for no purpose & make this part of the
> > driver harder to understand.
> >
> > It should be something like:
> >
...
> >
> > Right ?
> >
>
> Yes, we always use the first element of dp->spt_info to store all the
> descriptors arrays.
Well that was not what I expected. So please enlighten me, what's the rationale
behind deliberately wasting around ATH12K_NUM_SPT_PAGES * sizeof(uintptr_t) *
(ATH12K_NUM_RX_SPT_PAGES + ATH12K_NUM_TX_SPT_PAGES) of memory ? I'm quite
puzzled by this decision... I feel it really doesn't help understanding this
already complicated enough piece of code.
next prev parent reply other threads:[~2024-08-28 21:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-28 14:04 Wrong place for rxbaddr/txbaddr to be in struct ath12k_spt_info Nicolas Escande
2024-08-28 16:58 ` Karthikeyan Periyasamy
2024-08-28 21:02 ` Nicolas Escande [this message]
2024-08-29 0:21 ` Karthikeyan Periyasamy
2024-08-29 7:17 ` Nicolas Escande
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=D3RUKAFELUWP.XTR6V4GB7JXS@gmail.com \
--to=nico.escande@gmail.com \
--cc=ath12k@lists.infradead.org \
--cc=quic_periyasa@quicinc.com \
--cc=repk@triplefau.lt \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox