From nobody Fri Apr 18 14:36:52 2025 X-Original-To: dev-commits-src-branches@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 4ZfHQY137Nz5stbN; Fri, 18 Apr 2025 14:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZfHQX2N3cz3Jnx; Fri, 18 Apr 2025 14:36:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744987012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ow3xRhuhf8xRfEUgzG7XSuYIzWPsfbuS3zbuege2r78=; b=JORspgY2BpCOK7iOudfxiSZLkBEabXchnXsLn2ykdyE6hAug80kqh0TLuGuV5K/K3es4xE lM5fmJgoZPHjMLNqCWktVDFyPqoXbjuZ46N5sNFxm/4KwqARtEJxPymYIMKHi6lf7vd4QE KkzozZqW4VHVGO5eb9HenOaSShhBCdRXlU+kGS/sqhh9DBFNcr3y8aR++kzYvHPd8z1vgX +bEd2N8/rjbaTNTbMYi++03+tktddMG3BBXf3TFrDF69dlBJtDaIYoqgjDr9rklrLs78Sn i7GPj047VF/X3pNK7WE2CT3JJfZ5tYdIzwzBMVdsndBtuGVfP9cIBWubz7fxoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744987012; a=rsa-sha256; cv=none; b=KYhL/xNugDkCrTLNhVPjIpOL30ChXY90i04ZkfmBr3yYaLaRvpVdKg/DNZiEPNwTbOAziX Z2l14X+tr0KAj937GcY9GGAeGdj419KH/lD+VS1UQOwV/L/MwV2plf9xU/ncytIp2tgpFy Mn4kuDTmEyqP0H5Ad/nTrxyxYCjPbMsLzetsRSje7oPsI32pNgAbVnJDjEvqphZzlWp/qx 3tBkBCOmU+oVIR2/QXQdGwYmKjnJEkkuit9O4Fr0ut268Edxtk1PGFB8VGfmldWhZZn/jv xTcRQgNsDYnrQhs0H6C4kiHr/3rZeY13OaV2xHwSAdQzoYhraqjL7krySV+DCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744987012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ow3xRhuhf8xRfEUgzG7XSuYIzWPsfbuS3zbuege2r78=; b=cRVJYjEqSCZDdjRxAQDsuyoxDD/725w1CdTC3KHH6tNcdiraDzQblTn4PvcPbGHmEq5mFs 4JI7Jf1wy3Bzi/9dmbemUEIbMe9I9xzkoLc4S4xUVZ8tvI8IlSxEP2fRRnt0s+42fOWJsB TTz20os+QNkSViG1gEICXK3Ll5P2biBrvCNrwILQ3dGYiIEFmXuwH65OmMZYa8mr9uxyT3 ba9qLIwMSYyUq99uTKPNu2DU4+nvaau76h2waqT2fcW5BpYOArE5JBOob/oxPIJmXHmezw LPgDNTgQWoFbGH/gEE/5WyIGOCy9AvgNdGTToURfhuivYwuqEWlGC0yg2gQsHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ZfHQX1yV6zf3m; Fri, 18 Apr 2025 14:36:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 53IEaqY7091102; Fri, 18 Apr 2025 14:36:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53IEaqCl091099; Fri, 18 Apr 2025 14:36:52 GMT (envelope-from git) Date: Fri, 18 Apr 2025 14:36:52 GMT Message-Id: <202504181436.53IEaqCl091099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4fc30b0186b6 - stable/14 - LinuxKPI: be more verbose on _bus_dmamap_load_phys failures if debug is on List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4fc30b0186b628013ef566d376526e427644cf94 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4fc30b0186b628013ef566d376526e427644cf94 commit 4fc30b0186b628013ef566d376526e427644cf94 Author: Bjoern A. Zeeb AuthorDate: 2025-03-29 14:31:18 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-04-18 14:35:57 +0000 LinuxKPI: be more verbose on _bus_dmamap_load_phys failures if debug is on With the [k]malloc adjustments in switching skbuff from using a tunable and conditional contigmalloc with boundries to using __kmalloc as allocator should just work. The allocations are now physically contiguous and nseg=1 should be fine even if we have to bounce. The problem now coming back is that busdma bounce code cannot deal with larger contiguous nseg=1 allocations. I originally found that on arm64 more than two years ago but I am also seeing it for amd64 now. Improve the debugging beyond the dump_stack() call and print the busdma error (so we know if it is EFBIG or else), print the physical address so we can see better if we should bounce and print the length so we have an idea on what lengths we are failing. D45813 has some observations and rtw88 seems to be a good driver to test with. Sponsored by: The FreeBSD Foundation Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D49569 (cherry picked from commit a12a9c6c59764b876f06355f9f857e0018188d91) --- sys/compat/linuxkpi/common/src/linux_pci.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index ce7f91cd15ac..36dbac24496b 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -1452,14 +1452,19 @@ linux_dma_map_phys_common(struct device *dev, vm_paddr_t phys, size_t len, } nseg = -1; - if (_bus_dmamap_load_phys(obj->dmat, obj->dmamap, phys, len, - BUS_DMA_NOWAIT, &seg, &nseg) != 0) { + error = _bus_dmamap_load_phys(obj->dmat, obj->dmamap, phys, len, + BUS_DMA_NOWAIT, &seg, &nseg); + if (error != 0) { bus_dmamap_destroy(obj->dmat, obj->dmamap); DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); counter_u64_add(lkpi_pci_nseg1_fail, 1); - if (linuxkpi_debug) + if (linuxkpi_debug) { + device_printf(dev->bsddev, "%s: _bus_dmamap_load_phys " + "error %d, phys %#018jx len %zu\n", __func__, + error, (uintmax_t)phys, len); dump_stack(); + } return (0); }