All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Baochen Qiang <quic_bqiang@quicinc.com>
Cc: Jeff Johnson <quic_jjohnson@quicinc.com>,
	 <ath12k@lists.infradead.org>, <linux-wireless@vger.kernel.org>,
	 <kernel@quicinc.com>, <netdev@vger.kernel.org>
Subject: Re: [PATCH] wifi: ath12k: use 128 bytes aligned iova in transmit path for WCN7850
Date: Thu, 01 Aug 2024 18:22:11 +0300	[thread overview]
Message-ID: <871q388dzw.fsf@kernel.org> (raw)
In-Reply-To: <1aad7e68-c2d4-4b77-b526-5580860d7e3e@quicinc.com> (Baochen Qiang's message of "Mon, 22 Jul 2024 15:02:43 +0800")

Baochen Qiang <quic_bqiang@quicinc.com> writes:

> On 7/22/2024 2:54 PM, Baochen Qiang wrote:
>> 
>> 
>> On 7/19/2024 10:10 PM, Jeff Johnson wrote:
>>> On 7/14/2024 7:38 PM, Baochen Qiang wrote:
>>>> In transmit path, it is likely that the iova is not aligned to PCIe TLP
>>>> max payload size, which is 128 for WCN7850. Normally in such cases hardware
>>>> is expected to split the packet into several parts in a manner such that
>>>> they, other than the first one, have aligned iova. However due to hardware
>>>> limitations, WCN7850 does not behave like that properly with some specific
>>>> unaligned iova in transmit path. This easily results in target hang in a
>>>> KPI transmit test: packet send/receive failure, WMI command send timeout
>>>> etc. Also fatal error seen in PCIe level:
>>>>
>>>> 	...
>>>> 	Capabilities: ...
>>>> 		...
>>>> 		DevSta: ... FatalErr+ ...
>>>> 		...
>>>> 	...
>>>>
>>>> Work around this by manually moving/reallocating payload buffer such that
>>>> we can map it to a 128 bytes aligned iova. The moving requires sufficient
>>>> head room or tail room in skb: for the former we can do ourselves a favor
>>>> by asking some extra bytes when registering with mac80211, while for the
>>>> latter we can do nothing.
>>>>
>>>> Moving/reallocating buffer consumes additional CPU cycles, but the good news
>>>> is that an aligned iova increases PCIe efficiency. In my tests on some X86
>>>> platforms the KPI results are almost consistent.
>>>>
>>>> Since this is seen only with WCN7850, add a new hardware parameter to
>>>> differentiate from others.
>>>
>>> I asked for expert opinion on this patch and received the following response.
>>> Baochen, can you take a look at this suggestion?
>>>
>>>> Aligning headers is sometimes done, but it appears the driver
>>>> doesn't support scatter gather? I think the author may want to advertise
>> right, ath12k does not support SG currently.
>> 
>>>> scatter and linearize manually in the driver, to a correct offset.
>> is there an existing skb API or API combinations which can do that
>> for me? I checked __skb_linearize() and it does not take an 'offset'
>> argument.
>
> or do I need to implement it myself from a very low level basis? like
> (if required) allocating skb structure, allocating/aligning payload
> buffer, copying/freeing paged frag/frag list, etc..

I don't know __skb_linearize() well enough to really comment here. I'm
leaning towards we just take this patch to ath-current for v6.11 and, if
needed, optimise it later. Thoughts?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


  reply	other threads:[~2024-08-01 15:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15  2:38 [PATCH] wifi: ath12k: use 128 bytes aligned iova in transmit path for WCN7850 Baochen Qiang
2024-07-19 13:07 ` Mark Pearson
2024-08-01 15:20   ` Kalle Valo
2024-07-19 14:10 ` Jeff Johnson
2024-07-22  6:54   ` Baochen Qiang
2024-07-22  7:02     ` Baochen Qiang
2024-08-01 15:22       ` Kalle Valo [this message]
2024-08-01 15:07 ` Kalle Valo
2024-08-01 18:04   ` Jeff Johnson
2024-08-05  9:36     ` Kalle Valo
2024-08-05  3:20   ` Baochen Qiang
2024-08-05  9:28 ` 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=871q388dzw.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=ath12k@lists.infradead.org \
    --cc=kernel@quicinc.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=quic_bqiang@quicinc.com \
    --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.