From nobody Sat Apr 26 15:36:04 2025 X-Original-To: freebsd-wireless@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZlDMT1WPYz5vKfp for ; Sat, 26 Apr 2025 15:36:21 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZlDMS5vYVz3mTb; Sat, 26 Apr 2025 15:36:20 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-30bfc79ad97so47590461fa.1; Sat, 26 Apr 2025 08:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745681778; x=1746286578; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nEGPeMDz/Tsc9SpKeVb8jXRLDvQV4oanNFvPLCuA41Q=; b=MojS207PORkE9aRxiGO0iXV2ZeV98hhlC8t+Rrht914C0kIB4rGO1JUUmIeKQY20pj vNMpAZqu0L+ztLSjkOUz5FhO+djCclvDpfxx1KWiE/WK42kEIHxlsZqFk0+NwWiSOVcS Ea3snObvcRfkLZfftgsi1Ks79B2SwCDM+mx61VA+DDsQhC1PT8cHx9X0BhkA/zOHt036 KD4mAWJBxjMduXQJq0djmxmg5rd6W+5+pqmwykx+CzN0+7OmCWa+dMBrx2/y+Xo34Uhu 7OK9+CenjAsRADIb0Tbfp7Yyy61HQgTiFy4KBgVLz/I5bAmI9lLOgUx/avFcadSWYhZU 5twg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745681778; x=1746286578; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nEGPeMDz/Tsc9SpKeVb8jXRLDvQV4oanNFvPLCuA41Q=; b=AeVLsF2TUHAHhdHmiQ70HyrSYhxft7vfYnBOG2wL+wW9oWS9RCf+V3EJ3wu/LcvJlZ hibHVRPP8IRheExGXtXhJBniBNdcDQHBUKOnJe5hG5phI4VBBGz1O4ah8oqXBX2s/SPV v4d5yBjjvqykud69TV5ma6BDjn5AyYla5ngPkDIWjTtQMJnBOfe/UbHi0FaM/0KglODH dgeHgeoW2KqeaIvSEpV4HAsjOi53uemGTwR4fSEGNjjUuCUntzNW/sgNlXFT7X2LAmRF 03hpNKk/oxvyblHYkqb3ZY/v5kTba2V6TZcZaaQoYV6JmDsSQWxW0k96Vp6U0dMW2ENm 3sSQ== X-Gm-Message-State: AOJu0Ywqo/A/zpHNuzEQfWGhNACfnHzQ5eQ64P6L+SMUOj+rNyLdq9WO X5Q463tTZandIsOMWhWCiTiqOThjVSRBoDTQHPAz5wRgJ3T1PkkwenmKgwS18DqchEMdOJ+EQwF VlBexFgdxHrynqwdd6Xg0YSL+YXlpvA== X-Gm-Gg: ASbGncum36pzSn8FMW5LZgY0zD5ybeGxJAw+VLllveI1YQGCUVmaGD0qgM4f5mKs9eW ZVPyNRbdbtwEqkBfNpRYvSp7QEPmtQO8jJsgyjc8c7cOvMGjHwOqyhJjgmpnSQEZ+iBFEMoMWSs Rm1ghlNapGeRVaMM30snRX+sk= X-Google-Smtp-Source: AGHT+IFFZCrx55DUEQOER6jeZVa8F6Iew0Ljilgmj/qVacUE+ye89AQ0qF1VK+Pzf1IjZreW+febI+8yq17dQ0KJ0MI= X-Received: by 2002:a05:6512:689:b0:54d:3ed9:1fea with SMTP id 2adb3069b0e04-54e7da0e522mr3320358e87.25.1745681777598; Sat, 26 Apr 2025 08:36:17 -0700 (PDT) List-Id: Discussions List-Archive: https://lists.freebsd.org/archives/freebsd-wireless List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-wireless@freebsd.org Sender: owner-freebsd-wireless@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Adrian Chadd Date: Sat, 26 Apr 2025 08:36:04 -0700 X-Gm-Features: ATxdqUGEPK_wMAvBO50WBeHqEH6vvdxQ73_mQ-t3xLSCFeXdyBZmyWr1Ap84Mjo Message-ID: Subject: Re: rtwn0: rtwn_rx_copy_to_mbuf: could not allocate RX mbuf To: Nuno Teixeira Cc: freebsd-wireless@freebsd.org Content-Type: multipart/alternative; boundary="0000000000003ea8460633b03617" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4ZlDMS5vYVz3mTb X-Spamd-Bar: ---- --0000000000003ea8460633b03617 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Oh, and would you mind filing a bug at bugs.freebsd.org ? I'd like to track this as a normal honest to god bug. -adrian On Sat, 26 Apr 2025 at 08:33, Nuno Teixeira wrote: > (...) > > Found stability and no warnings/errors to report on usb nics: > > RTL8821AU 11ac @aarch64 > RTL8811AU 11ac @amd64 > > Cheers! > > Nuno Teixeira escreveu (s=C3=A1bado, 26/04/2025 =C3= =A0(s) > 08:58): > > > > Hello! > > > > > Ok, that is interesting. We're not keeping counters in m_get2() for > when the buffer requested is too large; it only returns NULL. > > > I guess it's bailing if it's above a page size (4kbytes.) > > > > > > Try changing the m_get2() call there to m_get3(); let's see if that > improves things. > > > (m_get3() will fail above 16kbytes; and if it can't allocate a buffer > < 16kbytes then we should get some UMA error counted somehwere.) > > > > iperf3 -R is happy, and git pull --rebase completed OK and fast: > > > > Connecting to host hp, port 5201 > > Reverse mode, remote host hp is sending > > [ 5] local 192.168.1.82 port 39601 connected to 192.168.1.100 port 520= 1 > > [ ID] Interval Transfer Bitrate > > [ 5] 0.00-1.06 sec 6.00 MBytes 47.4 Mbits/sec > > [ 5] 1.06-2.06 sec 15.9 MBytes 134 Mbits/sec > > [ 5] 2.06-3.06 sec 16.1 MBytes 135 Mbits/sec > > [ 5] 3.06-4.06 sec 16.4 MBytes 137 Mbits/sec > > [ 5] 4.06-5.00 sec 15.0 MBytes 134 Mbits/sec > > [ 5] 5.00-6.06 sec 16.4 MBytes 129 Mbits/sec > > [ 5] 6.06-7.06 sec 15.2 MBytes 128 Mbits/sec > > [ 5] 7.06-8.06 sec 14.8 MBytes 124 Mbits/sec > > [ 5] 8.06-9.06 sec 15.8 MBytes 132 Mbits/sec > > [ 5] 9.06-10.06 sec 16.1 MBytes 135 Mbits/sec > > - - - - - - - - - - - - - - - - - - - - - - - - - > > [ ID] Interval Transfer Bitrate Retr > > [ 5] 0.00-10.08 sec 148 MBytes 123 Mbits/sec 0 > sender > > [ 5] 0.00-10.06 sec 148 MBytes 123 Mbits/sec > receiver > > > > iperf Done. > > > > I will use this dongle on amd64 for further testing, I will patch > aarch64 soon. > > > > ``` > > diff --git a/sys/dev/rtwn/usb/rtwn_usb_rx.c > b/sys/dev/rtwn/usb/rtwn_usb_rx.c > > index 657d6bdeb9e4..54869fe336bd 100644 > > --- a/sys/dev/rtwn/usb/rtwn_usb_rx.c > > +++ b/sys/dev/rtwn/usb/rtwn_usb_rx.c > > @@ -124,10 +124,10 @@ rtwn_rx_copy_to_mbuf(struct rtwn_softc *sc, > > struct rtwn_rx_stat_common *stat, > > if (rtwn_rx_check_pre_alloc(sc, stat) !=3D 0) > > goto fail; > > > > - m =3D m_get2(totlen, M_NOWAIT, MT_DATA, M_PKTHDR); > > + m =3D m_get3(totlen, M_NOWAIT, MT_DATA, M_PKTHDR); > > if (__predict_false(m =3D=3D NULL)) { > > - device_printf(sc->sc_dev, "%s: could not allocate RX > mbuf\n", > > - __func__); > > + device_printf(sc->sc_dev, "%s: could not allocate RX > > mbuf (%d bytes)\n", > > + __func__, totlen); > > goto fail; > > } > > ``` > > > > Thanks! > > > > > > -- > > Nuno Teixeira > > FreeBSD UNIX: Web: https://FreeBSD.org > > > > -- > Nuno Teixeira > FreeBSD UNIX: Web: https://FreeBSD.org > --0000000000003ea8460633b03617 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Oh, and would you mind filing a bug at bugs.freebsd.org ? I'd like to track this as = a normal honest to god bug.



-adrian


On Sat, 26 Apr 20= 25 at 08:33, Nuno Teixeira <eduar= do@freebsd.org> wrote:
(...)

Found stability and no warnings/errors to report on usb nics:

RTL8821AU 11ac @aarch64
RTL8811AU 11ac @amd64

Cheers!

Nuno Teixeira <= eduardo@freebsd.org> escreveu (s=C3=A1bado, 26/04/2025 =C3=A0(s) 08:= 58):
>
> Hello!
>
> > Ok, that is interesting. We're not keeping counters in m_get2= () for when the buffer requested is too large; it only returns NULL.
> > I guess it's bailing if it's above a page size (4kbytes.)=
> >
> > Try changing the m_get2() call there to m_get3(); let's see i= f that improves things.
> > (m_get3() will fail above 16kbytes; and if it can't allocate = a buffer < 16kbytes then we should get some UMA error counted somehwere.= )
>
> iperf3 -R is happy, and git pull --rebase completed OK and fast:
>
> Connecting to host hp, port 5201
> Reverse mode, remote host hp is sending
> [=C2=A0 5] local 192.168.1.82 port 39601 connected to 192.168.1.100 po= rt 5201
> [ ID] Interval=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Transfer=C2=A0 = =C2=A0 =C2=A0Bitrate
> [=C2=A0 5]=C2=A0 =C2=A00.00-1.06=C2=A0 =C2=A0sec=C2=A0 6.00 MBytes=C2= =A0 47.4 Mbits/sec
> [=C2=A0 5]=C2=A0 =C2=A01.06-2.06=C2=A0 =C2=A0sec=C2=A0 15.9 MBytes=C2= =A0 =C2=A0134 Mbits/sec
> [=C2=A0 5]=C2=A0 =C2=A02.06-3.06=C2=A0 =C2=A0sec=C2=A0 16.1 MBytes=C2= =A0 =C2=A0135 Mbits/sec
> [=C2=A0 5]=C2=A0 =C2=A03.06-4.06=C2=A0 =C2=A0sec=C2=A0 16.4 MBytes=C2= =A0 =C2=A0137 Mbits/sec
> [=C2=A0 5]=C2=A0 =C2=A04.06-5.00=C2=A0 =C2=A0sec=C2=A0 15.0 MBytes=C2= =A0 =C2=A0134 Mbits/sec
> [=C2=A0 5]=C2=A0 =C2=A05.00-6.06=C2=A0 =C2=A0sec=C2=A0 16.4 MBytes=C2= =A0 =C2=A0129 Mbits/sec
> [=C2=A0 5]=C2=A0 =C2=A06.06-7.06=C2=A0 =C2=A0sec=C2=A0 15.2 MBytes=C2= =A0 =C2=A0128 Mbits/sec
> [=C2=A0 5]=C2=A0 =C2=A07.06-8.06=C2=A0 =C2=A0sec=C2=A0 14.8 MBytes=C2= =A0 =C2=A0124 Mbits/sec
> [=C2=A0 5]=C2=A0 =C2=A08.06-9.06=C2=A0 =C2=A0sec=C2=A0 15.8 MBytes=C2= =A0 =C2=A0132 Mbits/sec
> [=C2=A0 5]=C2=A0 =C2=A09.06-10.06=C2=A0 sec=C2=A0 16.1 MBytes=C2=A0 = =C2=A0135 Mbits/sec
> - - - - - - - - - - - - - - - - - - - - - - - - -
> [ ID] Interval=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Transfer=C2=A0 = =C2=A0 =C2=A0Bitrate=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Retr
> [=C2=A0 5]=C2=A0 =C2=A00.00-10.08=C2=A0 sec=C2=A0 =C2=A0148 MBytes=C2= =A0 =C2=A0123 Mbits/sec=C2=A0 =C2=A0 0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 sender
> [=C2=A0 5]=C2=A0 =C2=A00.00-10.06=C2=A0 sec=C2=A0 =C2=A0148 MBytes=C2= =A0 =C2=A0123 Mbits/sec=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 receiver
>
> iperf Done.
>
> I will use this dongle on amd64 for further testing, I will patch aarc= h64 soon.
>
> ```
> diff --git a/sys/dev/rtwn/usb/rtwn_usb_rx.c b/sys/dev/rtwn/usb/rtwn_us= b_rx.c
> index 657d6bdeb9e4..54869fe336bd 100644
> --- a/sys/dev/rtwn/usb/rtwn_usb_rx.c
> +++ b/sys/dev/rtwn/usb/rtwn_usb_rx.c
> @@ -124,10 +124,10 @@ rtwn_rx_copy_to_mbuf(struct rtwn_softc *sc,
> struct rtwn_rx_stat_common *stat,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (rtwn_rx_check_pre_alloc(sc, stat)= !=3D 0)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail= ;
>
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0m =3D m_get2(totlen, M_NOWAIT, MT_DATA, M_= PKTHDR);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0m =3D m_get3(totlen, M_NOWAIT, MT_DATA, M_= PKTHDR);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (__predict_false(m =3D=3D NULL)) {=
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0device_printf(= sc->sc_dev, "%s: could not allocate RX mbuf\n",
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= __func__);
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0device_printf(= sc->sc_dev, "%s: could not allocate RX
> mbuf (%d bytes)\n",
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= __func__, totlen);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail= ;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
> ```
>
> Thanks!
>
>
> --
> Nuno Teixeira
> FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0= https= ://FreeBSD.org



--
Nuno Teixeira
FreeBSD UNIX:=C2=A0 <eduardo@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://Fr= eeBSD.org
--0000000000003ea8460633b03617--