All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wifi: wext: Eliminate log spamming in wireless_warn_cfg80211_wext()
Date: Fri, 24 Feb 2023 15:09:41 +0200	[thread overview]
Message-ID: <87pm9zryzu.fsf@kernel.org> (raw)
In-Reply-To: <93bc48d2-a692-3709-e323-929600f37646@lwfinger.net> (Larry Finger's message of "Thu, 23 Feb 2023 17:09:35 -0600")

Larry Finger <Larry.Finger@lwfinger.net> writes:

> On 2/23/23 02:12, Johannes Berg wrote:
>> On Wed, 2023-02-22 at 14:49 -0600, Larry Finger wrote:
>>> Commit dc09766c755c {"wifi: wireless: warn on most wireless extension
>>> usage") introduces a warning when wireless extensions are used with
>>> cfg80211 drivers. Although such a warning is desirable, the current
>>> implementation overflows the dmesg buffer with thousands of warnings,
>>> all of which are the same.
>>>
>>
>> What are you seeing them from?
>>
>> This is rate-limited, so not sure why you're getting so many?
>>
>>>   A WARN_ONCE() call is sufficient.
>>
>> I think a WARN is inappropriate (it's a userspace 'issue', not an in-
>> kernel consistency problem), but I guess we could pr_once().
>>
>> But that's not great because it only shows a single application that was
>> still using it, not if there are multiple.
>>
>> Hmm. Not sure what to do. Let's start with "why are you getting it so
>> much". Maybe we can somehow print it less, or try to do per application
>> once, or something.
>
> Johannes,
>
> This patch has a magic number, but it does the job:
>
> diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c
> index 13a72b17248e..22a67172a163 100644
> --- a/net/wireless/wext-core.c
> +++ b/net/wireless/wext-core.c
> @@ -637,12 +637,27 @@ void wireless_send_event(struct net_device *      dev,
>  EXPORT_SYMBOL(wireless_send_event);
>
>  #ifdef CONFIG_CFG80211_WEXT
> +
> +#define ARRAY_MAX  15
> +static char name_array[ARRAY_MAX][TASK_COMM_LEN];
> +static int array_count = 0;
> +
>  static void wireless_warn_cfg80211_wext(void)
>  {
>         char name[sizeof(current->comm)];
> +       int i;
>
> -       pr_warn_ratelimited("warning: `%s' uses wireless extensions
> that are deprecated for modern drivers; use nl80211\n",
> -                           get_task_comm(name, current));
> +       get_task_comm(name, current);
> +       for (i = 0; i < array_count; i++) {
> +               if (!strncmp(name, name_array[i], TASK_COMM_LEN))
> +                       return;
> +       }
> +       /* Found new one - print warning and add to array */
> +       strncpy(name_array[array_count], name, TASK_COMM_LEN);
> +       if (array_count < ARRAY_MAX)
> +               array_count++;
> +       pr_warn("warning: `%s' uses wireless extensions that are
> deprecated for modern drivers; use nl80211\n",
> +               name);
>  }
>  #endif

This looks a bit complicated. What about printing the warning once per
boot using pr_warn_once()? That way we would not annoy people too much
but hopefully still motivate the applications to switch to using
nl80211.

> Looking at my log, I do get only one for each application.
>
> finger@localhost:~>dmesg | grep warning | grep nl80211
> [    8.826056] warning: `nspr-2' uses wireless extensions that are
> deprecated for modern drivers; use nl80211
> [   17.212260] warning: `kded5' uses wireless extensions that are
> deprecated for modern drivers; use nl80211
> [   17.252420] warning: `Qt bearer threa' uses wireless extensions
> that are deprecated for modern drivers; use nl80211
> [   22.664380] warning: `akonadi_notes_a' uses wireless extensions
> that are deprecated for modern drivers; use nl80211
> [   23.058001] warning: `akonadi_maildis' uses wireless extensions
> that are deprecated for modern drivers; use nl80211
> [   23.175135] warning: `akonadi_mailmer' uses wireless extensions
> that are deprecated for modern drivers; use nl80211
> [   23.329265] warning: `akonadi_followu' uses wireless extensions
> that are deprecated for modern drivers; use nl80211
> [   24.075119] warning: `akonadi_sendlat' uses wireless extensions
> that are deprecated for modern drivers; use nl80211
>
> I have no idea why most, if not all, of those applications even care
> about wireless. As you can see, I get 8 messages in a relatively short
> time, thus I selected 15 as the size of the array.

Oh man, that's a lot of applications. Are these all KDE or QT
applications, maybe libqt uses Wireless Extensions for something?

Linus also reported that he is seeing spam from google-chrome:

https://lore.kernel.org/all/CAHk-=wjTMgB0=PQt8synf1MRTfetVXAWWLOibnMKvv1ETn_1uw@mail.gmail.com/

So there are a lot more applications using the outdated Wireless
Extension interface as we originally thought. It will take a long time
to get rid of WE usage :(

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

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

  reply	other threads:[~2023-02-24 13:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 20:49 [PATCH] wifi: wext: Eliminate log spamming in wireless_warn_cfg80211_wext() Larry Finger
2023-02-23  8:12 ` Johannes Berg
2023-02-23 16:07   ` Larry Finger
2023-02-24  9:05     ` Nicolas Cavallari
2023-02-23 23:09   ` Larry Finger
2023-02-24 13:09     ` Kalle Valo [this message]
2023-02-24 15:55       ` Larry Finger

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=87pm9zryzu.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /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.