Message ID | 20231230045105.91351-6-sergeantsagara@protonmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-13333-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp2930831dyb; Fri, 29 Dec 2023 20:53:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IH7cRhs3h2uqO+O8WiYgObGanFbW8S94iRrYZlbEfclW5dXStwVy1z736nLvAFtmyvmH1j9 X-Received: by 2002:a05:620a:c86:b0:781:1dc9:452c with SMTP id q6-20020a05620a0c8600b007811dc9452cmr13476689qki.155.1703912030626; Fri, 29 Dec 2023 20:53:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703912030; cv=none; d=google.com; s=arc-20160816; b=z8JazQAbVDMyFRPNT3Qgi66GDLfHGBDgD7SDeAR1JvurWYjljTBYmWe3nQIPlKqB2j tI+N4dohitJzna7MUdu79BgB4/RS/CrOFWx+N8BlapKyGGNtGChzPzpY1m4PNZyUNO0I wk1eCJJVQgt0n/FVDpwhYNRIl8F+8M0jQ2JxEyW/l3wLu6/2cHlEkAm4lo91IDjM1ic0 ArqlR4Eb+Ft43zTuYiwP6M3L19nhsNswGnmifPbz1Zz++xZ+lntLd6/s61hXyLbBc+1o REaT1mGT7LdEk2IVJ6N6GhMPeSeXtBfHvm464RhMKN/KAmN3G5YLsT9NogMEZ73B22cg NVbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=mpfS2FF753ZSOUmOzhDiJSInHt5JGm319qqgU/Wo+a4=; fh=+21FHHkXcWPzhlDv3RJju/ybCufC5jSccWkxzweibX0=; b=MTtXS2EXmgJwpseqppKW05rwnsEuTxoKelsIIs0eG7FJW0yQF7s2ra/1M95cKAI1cV V9UE8hgpJ0sqlTBtg75hWKHwO01106k06R4IA5Dvm2fTY6weHnSsqoUx+P6CgnDxLt+x ip5vfnj+lM9Ai3d0jWBvZGOFPVgK9W9jmC+3KMyb6bRdMhPCx48wr/eN4HVyIzvihDhY fzTb0fxuYmWQkIRqmjOshdf5z6oLDFwWg0T2I/oTBfqZdrtxQjbdYZexqoG/Fo2+Qw8B xhBb2NNKJtU3Pn5WmZRSyoLaJBhIPhWfhvL2n+skac/WgjFiHjYacQ0bFcXscxwRPWts hDkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=SBjnCyE9; spf=pass (google.com: domain of linux-kernel+bounces-13333-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13333-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id m16-20020a05620a221000b00781711c6a09si5317613qkh.189.2023.12.29.20.53.50 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 20:53:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13333-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=SBjnCyE9; spf=pass (google.com: domain of linux-kernel+bounces-13333-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13333-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6BB111C21231 for <ouuuleilei@gmail.com>; Sat, 30 Dec 2023 04:53:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42E97AD31; Sat, 30 Dec 2023 04:52:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="SBjnCyE9" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46F3B187E for <linux-kernel@vger.kernel.org>; Sat, 30 Dec 2023 04:52:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1703911925; x=1704171125; bh=mpfS2FF753ZSOUmOzhDiJSInHt5JGm319qqgU/Wo+a4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=SBjnCyE94BXerPC1PUjPsFByxySTEa5qI51gVNbc9JHxX6ZCqpN3B0AaJWl4I3O7z MtmOrOlga0M7rzSpR0Y04YAxCn2TfxGim7xrzU7qGRdkgxZyFTFpD2qqTIoDhP61l2 3jfL7oIQZBfbi5vF6lnmyVx64Bq333HGGfV5htqFulmf5QeJOBotW1P8ReTCkNZy0k M9DcZnEv7kIYcQ2xqiXw6dvVTVP9Z/ktLDG12+wZMRJMPZzUphcc9AEET99Rz8sGCJ IGy+4CKqOC+ReLeDj92E4XPYPSKcQFt508g5N+qaY5BvVlBJzeBN06FDH8l1PFjM18 Kt4u8oLfT2pXg== Date: Sat, 30 Dec 2023 04:51:51 +0000 To: Kalle Valo <kvalo@kernel.org> From: Rahul Rameshbabu <sergeantsagara@protonmail.com> Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, linux-kernel@vger.kernel.org, Rahul Rameshbabu <sergeantsagara@protonmail.com> Subject: [PATCH wireless 5/5] wifi: b43: Support advertising lack of QoS capability Message-ID: <20231230045105.91351-6-sergeantsagara@protonmail.com> In-Reply-To: <20231230045105.91351-1-sergeantsagara@protonmail.com> References: <20231230045105.91351-1-sergeantsagara@protonmail.com> Feedback-ID: 26003777:user:proton Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786681261333822176 X-GMAIL-MSGID: 1786681261333822176 |
Series |
wifi: b43: Various QoS-related fixes
|
|
Commit Message
Rahul Rameshbabu
Dec. 30, 2023, 4:51 a.m. UTC
Add b43_qos_not_supported functionality for disabling QoS. Currently, the
function checks an array to see if the chip id matches a value in the
array. If so, disable QoS.
bcm4331 appears to lack QoS support. When queues that are not of the
default "best effort" priority are selected, traffic appears to not
transmit out of the hardware while no errors are returned. This behavior is
present among all the other priority queues: video, voice, and background.
While this can be worked around by setting a kernel parameter, the default
behavior is problematic for most users and may be difficult to debug. This
patch offers a working out-of-box experience for bcm4331 users.
Log of the issue (using ssh low-priority traffic as an example):
ssh -T -vvvv git@github.com
OpenSSH_9.6p1, OpenSSL 3.0.12 24 Oct 2023
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: checking match for 'host * exec "/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash -c '/nix/store/c015armnkhr6v18za0rypm7sh1i8js8w-gnupg-2.4.1/bin/gpg-connect-agent --quiet updatestartuptty /bye >/dev/null 2>&1'"' host github.com originally github.com
debug3: /etc/ssh/ssh_config line 5: matched 'host "github.com"'
debug1: Executing command: '/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash -c '/nix/store/c015armnkhr6v18za0rypm7sh1i8js8w-gnupg-2.4.1/bin/gpg-connect-agent --quiet updatestartuptty /bye >/dev/null 2>&1''
debug3: command returned status 0
debug3: /etc/ssh/ssh_config line 5: matched 'exec "/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash -c '/nix/store/c015armnkhr6v18za0r"'
debug2: match found
debug1: /etc/ssh/ssh_config line 9: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/binary-eater/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/binary-eater/.ssh/known_hosts2'
debug2: resolving "github.com" port 22
debug3: resolve_host: lookup github.com:22
debug3: channel_clear_timeouts: clearing
debug3: ssh_connect_direct: entering
debug1: Connecting to github.com [192.30.255.113] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
Fixes: e6f5b934fba8 ("b43: Add QOS support")
Signed-off-by: Rahul Rameshbabu <sergeantsagara@protonmail.com>
---
drivers/net/wireless/broadcom/b43/main.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
Comments
On Sat, 30 Dec 2023 04:51:51 +0000 Rahul Rameshbabu <sergeantsagara@protonmail.com> wrote: > bcm4331 appears to lack QoS support. I think that's rather unlikely. The firmware probably is just too old for this device. > +static const u16 b43_no_qos_chip_ids[] = { > + BCMA_CHIP_ID_BCM4331, > + 0, > +}; > + > +static bool b43_qos_not_supported(struct b43_wldev *dev) > +{ > + int idx; > + > + for (idx = 0; b43_no_qos_chip_ids[idx]; idx++) > + if (dev->dev->chip_id == b43_no_qos_chip_ids[idx]) > + return true; > + > + return false; > +} > + > static void b43_wireless_core_exit(struct b43_wldev *dev); > static int b43_wireless_core_init(struct b43_wldev *dev); > static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev); > @@ -2587,7 +2603,7 @@ static void b43_request_firmware(struct work_struct *work) > > start_ieee80211: > wl->hw->queues = B43_QOS_QUEUE_NUM; > - if (!modparam_qos || dev->fw.opensource) > + if (!modparam_qos || dev->fw.opensource || b43_qos_not_supported(wl->current_dev)) This looks a bit over-engineered to me. Can we just instead do it like this, please? if (!modparam_qos || dev->fw.opensource || dev->dev->chip_id == BCMA_CHIP_ID_BCM4331) > wl->hw->queues = 1; > > err = ieee80211_register_hw(wl->hw);
On Sat, 30 Dec, 2023 14:45:23 +0100 Michael Büsch <m@bues.ch> wrote: > [[PGP Signed Part:Undecided]] > On Sat, 30 Dec 2023 04:51:51 +0000 > Rahul Rameshbabu <sergeantsagara@protonmail.com> wrote: > >> bcm4331 appears to lack QoS support. > > I think that's rather unlikely. > The firmware probably is just too old for this device. I just retested with newer firmware released on 2012-08-15. I still see the same issue with QoS. This appears to be the newest firmware I can acquire from http://lwfinger.com/b43-firmware/, which I extract from broadcom-wl-6.30.163.46. [ 11.661972] b43-phy0: Loading firmware version 784.2 (2012-08-15 21:35:19) [ 11.919942] b43-phy0: Loading firmware version 784.2 (2012-08-15 21:35:19) [ 13.717460] [drm] amdgpu kernel modesetting enabled. [ 13.717705] amdgpu: Virtual CRAT table created for CPU [ 13.717719] amdgpu: Topology: Add CPU node [ 13.776896] NET: Registered PF_PACKET protocol family [ 15.234058] b43-phy0: Loading firmware version 784.2 (2012-08-15 21:35:19) [ 15.319388] wlp3s0b1: authenticate with 1c:87:2c:6f:f4:e0 [ 15.333239] wlp3s0b1: send auth to 1c:87:2c:6f:f4:e0 (try 1/3) [ 15.341672] wlp3s0b1: authenticated [ 15.341921] wlp3s0b1: associate with 1c:87:2c:6f:f4:e0 (try 1/3) [ 15.346912] wlp3s0b1: RX AssocResp from 1c:87:2c:6f:f4:e0 (capab=0x411 status=0 aid=3) [ 15.347255] wlp3s0b1: associated > >> +static const u16 b43_no_qos_chip_ids[] = { >> + BCMA_CHIP_ID_BCM4331, >> + 0, >> +}; >> + >> +static bool b43_qos_not_supported(struct b43_wldev *dev) >> +{ >> + int idx; >> + >> + for (idx = 0; b43_no_qos_chip_ids[idx]; idx++) >> + if (dev->dev->chip_id == b43_no_qos_chip_ids[idx]) >> + return true; >> + >> + return false; >> +} >> + >> static void b43_wireless_core_exit(struct b43_wldev *dev); >> static int b43_wireless_core_init(struct b43_wldev *dev); >> static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev); >> @@ -2587,7 +2603,7 @@ static void b43_request_firmware(struct work_struct *work) >> >> start_ieee80211: >> wl->hw->queues = B43_QOS_QUEUE_NUM; >> - if (!modparam_qos || dev->fw.opensource) >> + if (!modparam_qos || dev->fw.opensource || b43_qos_not_supported(wl->current_dev)) > > This looks a bit over-engineered to me. > Can we just instead do it like this, please? > > if (!modparam_qos || dev->fw.opensource || dev->dev->chip_id == BCMA_CHIP_ID_BCM4331) > Ack. >> wl->hw->queues = 1; >> >> err = ieee80211_register_hw(wl->hw); -- Thanks, Rahul Rameshbabu
On Sat, 30 Dec 2023 17:10:26 +0000 Rahul Rameshbabu <sergeantsagara@protonmail.com> wrote: > > The firmware probably is just too old for this device. > > I just retested with newer firmware released on 2012-08-15. I still see > the same issue with QoS. This appears to be the newest firmware I can > acquire from http://lwfinger.com/b43-firmware/, which I extract from > broadcom-wl-6.30.163.46. It's still pretty old. Nobody has worked on getting a newer version extracted for a long time. But I'm fine with just disabling QoS on this device. Upgrading to a newer firmware probably is a bigger change. That could be done later.
diff --git a/drivers/net/wireless/broadcom/b43/main.c b/drivers/net/wireless/broadcom/b43/main.c index b6ac1526c0e8..39906bebef7b 100644 --- a/drivers/net/wireless/broadcom/b43/main.c +++ b/drivers/net/wireless/broadcom/b43/main.c @@ -359,6 +359,22 @@ static struct ieee80211_supported_band b43_band_2ghz_limited = { .n_bitrates = b43_g_ratetable_size, }; +static const u16 b43_no_qos_chip_ids[] = { + BCMA_CHIP_ID_BCM4331, + 0, +}; + +static bool b43_qos_not_supported(struct b43_wldev *dev) +{ + int idx; + + for (idx = 0; b43_no_qos_chip_ids[idx]; idx++) + if (dev->dev->chip_id == b43_no_qos_chip_ids[idx]) + return true; + + return false; +} + static void b43_wireless_core_exit(struct b43_wldev *dev); static int b43_wireless_core_init(struct b43_wldev *dev); static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev); @@ -2587,7 +2603,7 @@ static void b43_request_firmware(struct work_struct *work) start_ieee80211: wl->hw->queues = B43_QOS_QUEUE_NUM; - if (!modparam_qos || dev->fw.opensource) + if (!modparam_qos || dev->fw.opensource || b43_qos_not_supported(wl->current_dev)) wl->hw->queues = 1; err = ieee80211_register_hw(wl->hw);