From: Randy Dunlap <rdunlap@infradead•org>
To: Bert Karwatzki <spasswolf@web•de>, linux-wireless@vger•kernel.org
Cc: linux-kernel@vger•kernel.org, linux-next@vger•kernel.org,
Johannes Berg <johannes.berg@intel•com>,
Jason Xing <kerneljasonxing@gmail•com>
Subject: Re: [PATCH] wifi: add sk_requests_wifi_status()
Date: Tue, 20 May 2025 15:57:07 -0700 [thread overview]
Message-ID: <8cc4c232-c7cd-4dec-97c8-3573b5e471c2@infradead.org> (raw)
In-Reply-To: <20250520223430.6875-1-spasswolf@web.de>
Hi--
On 5/20/25 3:34 PM, Bert Karwatzki wrote:
> Checking the SOCK_WIFI_STATUS flag bit in sk_flags, may give a wrong result
> since sk_flags are part of a union and the union is used otherwise. Add
> a sk_requests_wifi_status() which checks if sk is non-NULL, sk is a full socket
> and checks the flag bit.
>
> Fixes: 76a853f86c97 ("wifi: free SKBTX_WIFI_STATUS skb tx_flags flag")
> Idea-by: Johannes Berg <johannes.berg@intel•com>
That is usually spelled
Suggested-by:
> Signed-off-by: Bert Karwatzki <spasswolf@web•de>
> ---
> drivers/net/wireless/ath/wil6210/txrx.h | 3 +--
> drivers/net/wireless/marvell/mwifiex/main.c | 3 +--
> include/net/sock.h | 7 +++++++
> net/mac80211/mesh.c | 2 +-
> net/mac80211/tx.c | 6 +++---
> 5 files changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/wil6210/txrx.h b/drivers/net/wireless/ath/wil6210/txrx.h
> index 33ccd0b248d4..fff8b7f8abc5 100644
> --- a/drivers/net/wireless/ath/wil6210/txrx.h
> +++ b/drivers/net/wireless/ath/wil6210/txrx.h
> @@ -617,8 +617,7 @@ static inline bool wil_need_txstat(struct sk_buff *skb)
> {
> const u8 *da = wil_skb_get_da(skb);
>
> - return is_unicast_ether_addr(da) && skb->sk &&
> - sock_flag(skb->sk, SOCK_WIFI_STATUS);
> + return is_unicast_ether_addr(da) && sk_requests_wifi_status(skb->sk);
> }
>
> static inline void wil_consume_skb(struct sk_buff *skb, bool acked)
> diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
> index 1485f949ad4e..7b50a88a18e5 100644
> --- a/drivers/net/wireless/marvell/mwifiex/main.c
> +++ b/drivers/net/wireless/marvell/mwifiex/main.c
> @@ -913,8 +913,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
>
> multicast = is_multicast_ether_addr(skb->data);
>
> - if (unlikely(!multicast && skb->sk &&
> - sock_flag(skb->sk, SOCK_WIFI_STATUS) &&
> + if (unlikely(!multicast && sk_requests_wifi_status(skb->sk) &&
> priv->adapter->fw_api_ver == MWIFIEX_FW_V15))
> skb = mwifiex_clone_skb_for_tx_status(priv,
> skb,
> diff --git a/include/net/sock.h b/include/net/sock.h
> index 3e15d7105ad2..2da289ec4c17 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -2822,6 +2822,13 @@ sk_is_refcounted(struct sock *sk)
> return !sk_fullsock(sk) || !sock_flag(sk, SOCK_RCU_FREE);
> }
>
> +static inline bool
> +sk_requests_wifi_status(struct sock *sk)
> +{
> + return sk && sk_fullsock(sk) && sock_flag(sk,
> +SOCK_WIFI_STATUS);
Missing indentation on the line above.
> +}
> +
> /* Checks if this SKB belongs to an HW offloaded socket
> * and whether any SW fallbacks are required based on dev.
> * Check decrypted mark in case skb_orphan() cleared socket.
--
~Randy
next prev parent reply other threads:[~2025-05-20 22:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 22:34 [PATCH] wifi: add sk_requests_wifi_status() Bert Karwatzki
2025-05-20 22:57 ` Randy Dunlap [this message]
2025-05-21 7:02 ` Johannes Berg
2025-05-21 7:23 ` Jason Xing
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=8cc4c232-c7cd-4dec-97c8-3573b5e471c2@infradead.org \
--to=rdunlap@infradead$(echo .)org \
--cc=johannes.berg@intel$(echo .)com \
--cc=kerneljasonxing@gmail$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=linux-wireless@vger$(echo .)kernel.org \
--cc=spasswolf@web$(echo .)de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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