* Is the extra_tx_headroom guarenteed ?
@ 2021-06-07 3:17 Steven Ting
2021-06-10 20:14 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Steven Ting @ 2021-06-07 3:17 UTC (permalink / raw)
To: johannes.berg; +Cc: linux-wireless
Johannes and all mac80211 gurus,
We encountered a problem that we use the extra_tx_headroom to reserve the headroom
which we put the txdesc in.
Current workaround is that we check our needed headroom size by skb_headroom()
in the driver layer.
Is extra_tx_headroom in struct ieee80211_hw always guaranteed?
The header file describes:
* @extra_tx_headroom: headroom to reserve in each transmit skb
* for use by the driver (e.g. for transmit headers.)
But when the skb goes through the ieee80211_amsdu_realloc_pad(), it does not
take care of the extra_tx_headroom, i.e. the original reserved headroom might be
eaten.
Does the ieee80211_amsdu_realloc_pad() lacks some check for extra_tx_headroom
or the extra_tx_headroom in mac80211 is not guaranteed?
Furthermore, for the packet that would not be aggregate in A-MSDU and ndev->needed_headroom
is not guaranteed, in this case whether mac80211 layer still guarantee the extra_tx_headroom ?
Or mac80211 only guarantees the headroom of the skb which is built by itself ?
Steven
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Is the extra_tx_headroom guarenteed ?
2021-06-07 3:17 Is the extra_tx_headroom guarenteed ? Steven Ting
@ 2021-06-10 20:14 ` Johannes Berg
2021-08-16 8:56 ` Pkshih
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2021-06-10 20:14 UTC (permalink / raw)
To: Steven Ting; +Cc: linux-wireless
Hi,
> We encountered a problem that we use the extra_tx_headroom to reserve the headroom
> which we put the txdesc in.
>
> Current workaround is that we check our needed headroom size by skb_headroom()
> in the driver layer.
>
> Is extra_tx_headroom in struct ieee80211_hw always guaranteed?
It _should_ be, IMHO. Having the check in all the drivers would be
pointless.
> The header file describes:
> * @extra_tx_headroom: headroom to reserve in each transmit skb
> * for use by the driver (e.g. for transmit headers.)
>
> But when the skb goes through the ieee80211_amsdu_realloc_pad(), it does not
> take care of the extra_tx_headroom, i.e. the original reserved headroom might be
> eaten.
OK, so I guess that's a bug there.
> Does the ieee80211_amsdu_realloc_pad() lacks some check for extra_tx_headroom
> or the extra_tx_headroom in mac80211 is not guaranteed?
I would say it lacks the checks - want to send a patch?
> Furthermore, for the packet that would not be aggregate in A-MSDU and ndev->needed_headroom
> is not guaranteed, in this case whether mac80211 layer still guarantee the extra_tx_headroom ?
Yes, this case should be handled.
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Is the extra_tx_headroom guarenteed ?
2021-06-10 20:14 ` Johannes Berg
@ 2021-08-16 8:56 ` Pkshih
0 siblings, 0 replies; 3+ messages in thread
From: Pkshih @ 2021-08-16 8:56 UTC (permalink / raw)
To: Johannes Berg, Steven Ting; +Cc: linux-wireless, Gary Chang
> -----Original Message-----
> From: Johannes Berg [mailto:johannes@sipsolutions.net]
> Sent: Friday, June 11, 2021 4:14 AM
> To: Steven Ting
> Cc: linux-wireless@vger.kernel.org
> Subject: Re: Is the extra_tx_headroom guarenteed ?
>
> Hi,
>
> > We encountered a problem that we use the extra_tx_headroom to reserve the headroom
> > which we put the txdesc in.
> >
> > Current workaround is that we check our needed headroom size by skb_headroom()
> > in the driver layer.
> >
> > Is extra_tx_headroom in struct ieee80211_hw always guaranteed?
>
> It _should_ be, IMHO. Having the check in all the drivers would be
> pointless.
>
> > The header file describes:
> > * @extra_tx_headroom: headroom to reserve in each transmit skb
> > * for use by the driver (e.g. for transmit headers.)
> >
> > But when the skb goes through the ieee80211_amsdu_realloc_pad(), it does not
> > take care of the extra_tx_headroom, i.e. the original reserved headroom might be
> > eaten.
>
> OK, so I guess that's a bug there.
>
> > Does the ieee80211_amsdu_realloc_pad() lacks some check for extra_tx_headroom
> > or the extra_tx_headroom in mac80211 is not guaranteed?
>
> I would say it lacks the checks - want to send a patch?
>
> > Furthermore, for the packet that would not be aggregate in A-MSDU and ndev->needed_headroom
> > is not guaranteed, in this case whether mac80211 layer still guarantee the extra_tx_headroom ?
>
> Yes, this case should be handled.
>
We prepare a patchset [1] to fix the bug mentioned in this mail.
[1] https://lore.kernel.org/linux-wireless/20210816085128.10931-1-pkshih@realtek.com/T/#t
--
Ping-Ke
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-16 8:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 3:17 Is the extra_tx_headroom guarenteed ? Steven Ting
2021-06-10 20:14 ` Johannes Berg
2021-08-16 8:56 ` Pkshih
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.