Search Linux Wireless

Re: [PATCH] wifi: wext: Eliminate log spamming in wireless_warn_cfg80211_wext()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/24/23 07:09, Kalle Valo wrote:
Larry Finger <Larry.Finger@xxxxxxxxxxxx> 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@xxxxxxxxxxxxxx/

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 :(

Kalle,

Yes, my patch is a bit complicated, but it provides information that can be sent upstream to get proper fixes for all applications - a "feature" lacking if a simple pr_warn_once() is used. As I told Johannes and Linus in my previous E-mail, I will keep my patch locally to accumulate usage info for more than the first instance of this warning.

I do not know anything about Akonadi internals, but the rest of the warnings seem to come from KDE or QT. I agree that libqt is a likely culprit.

Larry


Larry






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux