From nobody Sat Nov 22 11:45:11 2025 X-Original-To: net@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 4dD9Hq29bCz6Gxbj for ; Sat, 22 Nov 2025 11:45:11 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dD9Hq1VHXz3WKq for ; Sat, 22 Nov 2025 11:45:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763811911; 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: in-reply-to:in-reply-to:references:references; bh=sG5Xc3vrZ5yhW7SVgXSEERyPYCyQYM9izxs+23++Cfw=; b=FZy+SrgzUGOg5G8+WuZt1UNwDAXcyqjUYRA047clVe2oKpwrDR+d9U+r96K90iNrVYNjte r7JaG8bL26srAJGPnqguJvV1TmGsnH4a6mf+XgElQcy4wsdBA/kwtHn2KRWS+0oBuIwF+y OM6zkaSGTUbNyDYQ1vdOA2s9GsFfTZRrRyt7duAlaxtEb/h5Q4pi+Ll6VN1aVOp/jFXEGK tkG8jGcORkMnb/UaDUNF4nntkLty4Bg4VFTx2QcCpnRbMjT47Z5E/8HjsIj/hxvNfDQb/N jHdJ8i7LcfhBU8U4hqk3xSGb4PVhcJE5hhmlFi7JtIijZZo3Nnc5LECX5s+5mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763811911; 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: in-reply-to:in-reply-to:references:references; bh=sG5Xc3vrZ5yhW7SVgXSEERyPYCyQYM9izxs+23++Cfw=; b=MgTRKVAYpqGPh7B04oWJe2eOrAb4fa7igq2LcTBhKY9b5xDtcIIaDP+/mWTW5QGQZjp3w5 QpTi6GPmS8AKM7o3bqzmVS8XolndxtKnqaFDISbxlakighQoNXlLXpvPTFFh/oWhThNac9 qMOKeshPflVGSZQVrW6C6hP9tyjiYUxD7GPxGdlWFjKLD1Bz1bWk5ol9shaq3gRaUFSYB3 wNH0nMqV4zKp84PX5fqx+Uou5ckeR7oIK7Ewqcyvw9FOibydts4QoQzWE6SIJnXlYMQ2as ibc9b4u4p6WWaRq5lIx0sRPmuCn7sonF/v6x9jW+tcqNRmtQn9x9lJEeCCbHew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763811911; a=rsa-sha256; cv=none; b=nlFC7y/h8FY/6eArWcThaMom1+xAX1BM/A3o5j52lNaLzG8rJ+aBc8YTBhqQQf2dOajAyc YIDyF8Cj8pJzcUEpKUD0gzk7ykxRaUpwFzi0INbPJaHrpOCLM8Y/RBBQyOO3YUurTjC3eO yvn8J4neB/lhz5vZX8k2qERcP00v+6+VUL9SPb8imjgTcxdfp4+6buPYeFLsv1rlV6G2j6 g/7HTK3CXGeOx6+1OamiBcqnWE5SXM3phTjzOwK2DRt1Q9lgrqkwraD0Fx98y9x69xOl9R Yhautks9HzrxWG09NoeqfkbKm/+sCNDc64oclRvt9jkx5C6Ue4ZiYWKMqDW9BA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4dD9Hq0jyqzx6P for ; Sat, 22 Nov 2025 11:45:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 5AMBjASI026923 for ; Sat, 22 Nov 2025 11:45:10 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 5AMBjAG3026922 for net@FreeBSD.org; Sat, 22 Nov 2025 11:45:10 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 290793] iovctl on mlx5en won't work Date: Sat, 22 Nov 2025 11:45:11 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jcduss13@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D290793 --- Comment #7 from David BOYER --- (In reply to David BOYER from comment #3) What's the call graph into this? I had answered yesterday but just gor a message reading that a collision occured. I can only find mlx5_core/mlx5_main.c::request_bar -> pci_request_regions() which ends up at the end of a loop in lkpi_pci_request_region(). =3D=3D> The same for me You made me actually look at Linux code and there you end up in __pci_request_region() which has the same checks at the beginning it seems: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/dri= vers/pci/pci.c#n3935 So the problem is likely elsewhere in the LinuxKPI emulation or in mlx5. My understanding is that pci_resource_len may return 0 on FreeBSD while lin= ux reports the right size. Then, on FreeBSD, pci_request_region exits because pci_resource_len =3D=3D = 0, bus_alloc_resource_any is not called and the memory is not allocated. Why linux reports the right size ?=20 https://wiki.osdev.org/PCI reads "To determine the amount of address space needed by a PCI device, you must save the original value of the BAR, write a value of all 1's to the register, then read it back. The amount of memory c= an then be determined by masking the information bits, performing a bitwise NOT ('~' in C), and incrementing the value by 1. The original value of the BAR should then be restored". If I read correctly, this is done by pci_read_bases, found in "drivers/pci/probe.c". It purpose is to find the BAR memory size. Also the error logged: mlx5_core2: lkpi_pci_request_region: failed to alloc bar 0 type 3 rid 16 comes from after that check? So if it would fail and return we would not s= ee this? Is that a secondary problem? Yes, it comes after. Because the memory allocation step did not run (pci_resource_len =3D=3D 0). If you say "On FreeBSD, the BAR size of VFs can temporarily be 0 and." Would we assume mlx5core to only call pci_request_regions() once they are properly initialized? I guess we can say they are not properly initialized because it is done by = the kernel (on linux) not by the driver itself. Please note that I am not an expert at all and had not read sourcecode of l= inux and FreeBSD before, so I may be wrong somewhere, especially in my wording. --=20 You are receiving this mail because: You are the assignee for the bug.=