From nobody Tue Apr 01 14:39:12 2025 X-Original-To: dev-commits-src-main@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 4ZRrH50nFdz5rd7r; Tue, 01 Apr 2025 14:39:13 +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 4ZRrH50CXXz3wKj; Tue, 01 Apr 2025 14:39:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1743518353; 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=NBeLtVWfrA2SnfxFXrWR+zaLJreTnqPleotyvgVtwHA=; b=fxjG1D6UhNbG48Lu3I5UOT9lUjzTIJDX3j1DBlFiRe98VSHUwNMrr4IjvKMlaQuYyfe+SU 45n/5LpanJ4BNd6e6kewyeSag97M1dqJRwEndezd2b623A9Utn5erplh84A0BCnZAzs1B7 5KqbZvXZ6NzJSFi//NWw7Kbu6aATsJHr2GzKlkkctNQ0/5xNm2iHpT0S5sqZCVf9U+Mxpn JtkK4KLD1YU8qhqH7IS8N8z2l/z4ZW2906ch2/ui/XNWNRX5yQG8luHnOZGoPATJYnKqbr 8nyHBULngpgOuCHsOImXzmDAFNomoDw9TZ7ZYTGRYAAK2DA5XwurDIoB7SgL5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1743518353; a=rsa-sha256; cv=none; b=C76+leRtAZOzWW1pGjtvaQo4GxcNWOhBVVwaTyO502dpKMxkM8ktpYMUMPsSazHrWVy0wP uDi8V6DvFI0qW7JuUE7o/hFOM7vYbvt2CVaaCUXMKnygmBFVr/+kMlQssVzSHRFoOoA8eb tSh9CuC/YwZGik4PZZheERemJ2Hb3se2ahfO2Axlc1Bdp/Lp45GAwjtUie6IvTMlxHe3rk VDZF3z+V6PMDB46j4ThGaqHS/MAU32PoQCocOVxbR8aiK5ma9qLFPmQq/8/KJ8ceNK66Ny laJnLr92HF9a2R6xUH62CdekQhZjGpP05mqiEw9Esu9m3vgOXrBxlmHwsnG4Yw== 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=1743518353; 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=NBeLtVWfrA2SnfxFXrWR+zaLJreTnqPleotyvgVtwHA=; b=dORewgHOKQgFTz52NCBZtoCsrVfLBQy66VCrnCcnNmf1DRwjqUCPSN+PSBPuopkv1wvynk 3Mox9BVIrECS/r0G1Oh2Tm9S0WYRxUNMJNL1EM95WX5qd+Uz3KYAoThd66XQ9j+ZtS3Dps J1U2HwzE7rQT17AxQUvRwebZ1qFUBHnTzqikfpdeTBAQWdhaa7n53+u+eHy0RrD5n0Vi4q esQ7aAAlMvvFh23qzMeVzjukJ+aW8J2I7IylWI0i+2HKkym2zWqQ9WWHIB5P7ymcz7PXMC xgqc4lzdERvpaPj1oARyMRU+fEKnBoLuY+fWRy7QuhUY5Hy92bdDynR1ixLheA== 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 4ZRrH46dGSzbK6; Tue, 01 Apr 2025 14:39:12 +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 531EdCru098275; Tue, 1 Apr 2025 14:39:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 531EdCPG098272; Tue, 1 Apr 2025 14:39:12 GMT (envelope-from git) Date: Tue, 1 Apr 2025 14:39:12 GMT Message-Id: <202504011439.531EdCPG098272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a12a9c6c5976 - main - LinuxKPI: be more verbose on _bus_dmamap_load_phys failures if debug is on List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: a12a9c6c59764b876f06355f9f857e0018188d91 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a12a9c6c59764b876f06355f9f857e0018188d91 commit a12a9c6c59764b876f06355f9f857e0018188d91 Author: Bjoern A. Zeeb AuthorDate: 2025-03-29 14:31:18 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-04-01 14:37:28 +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 MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D49569 --- 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 a9942a657dce..fa5e3c71fad0 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -1471,14 +1471,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); }