From nobody Wed Nov 27 13:02:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1699300574; cv=none; d=zohomail.com; s=zohoarc; b=KW6ymbbig8RJcCa8whW2XtYhwKo65zamt1HnYu+cXxIZw9WYIiAKId99qmcyUn02Rn88Cm1zA8233tjopc56ocvvk1dE5l0l6W/HE8RwKGaW4qAEqq3ZYhda5YdHLhwjKA+OhATTUUqIHZ9uNCVBJiPr2SxxsCogAKReuiaDimA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699300574; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MtsxthwV/XHTVMI8Ph+V2vIGIyQmamq03UN301HMpX4=; b=OebjAKXC/srs6fUcS9yqOPXn1/cKYapkxYQiRHJ3wWfATiTsF0DUBssAbwII+xP2Ak8OBr6ywmLC++HAeg64U+5G6hkLWa0oFRsZ1p7Vczhccg2C/HvxQ1U4WCOAuwitEikUGV5dX45RCKqhbEZPpFfR0lj0b/s9HFtePVeiT5g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1699300574622526.5573784900199; Mon, 6 Nov 2023 11:56:14 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.628296.979654 (Exim 4.92) (envelope-from ) id 1r05hM-0004Dt-3r; Mon, 06 Nov 2023 19:55:48 +0000 Received: by outflank-mailman (output) from mailman id 628296.979654; Mon, 06 Nov 2023 19:55:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r05hL-000476-FZ; Mon, 06 Nov 2023 19:55:47 +0000 Received: by outflank-mailman (input) for mailman id 628296; Mon, 06 Nov 2023 19:55:43 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r05hG-0001Ig-PO for xen-devel@lists.xenproject.org; Mon, 06 Nov 2023 19:55:42 +0000 Received: from desiato.infradead.org (desiato.infradead.org [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 760c71ff-7cde-11ee-9b0e-b553b5be7939; Mon, 06 Nov 2023 20:55:40 +0100 (CET) Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1r05fb-00AkFf-2g; Mon, 06 Nov 2023 19:54:00 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.96.2 #2 (Red Hat Linux)) id 1r05fa-001GNL-1G; Mon, 06 Nov 2023 19:53:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list X-Inumbo-ID: 760c71ff-7cde-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=MtsxthwV/XHTVMI8Ph+V2vIGIyQmamq03UN301HMpX4=; b=DAx/R55kK7r8sP6AD0SSADmu8W 6mv00cH13ry/O54Sp8qxXE34rxLnhofaOJUW1qGtQ/qsfuhzcqJUVr9I7hQJBodwJhYyKbuRvwIP0 mhghhgHKbon1H8aYLpaHHe3QpOzgK09XrLyS83jLgmxFf3wl63b2Mble6kSsVzMwp00NGKftWyDy2 67oJ3dnffyFdKhWF4GFw5dn6n5g3AbZO7tcWFsi2ouv9N9AhqXxKbDrhkDzjRtGNT9HPUn8OpRyY8 nuuQRVH7hiUNbcQiAdIayce9GCd6MAsp19CIW5rrY9YWCRZRUENfxq9jw/TX254Mmyw5fP+Z53IvD Jyu/YTnQ==; From: David Woodhouse To: qemu-devel@nongnu.org Cc: Richard Henderson , Beniamino Galvani , Peter Maydell , Strahinja Jankovic , Niek Linnenbank , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Andrew Jeffery , Joel Stanley , Igor Mitsyanko , Jean-Christophe Dubois , Andrey Smirnov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rob Herring , Subbaraya Sundeep , Jan Kiszka , Tyrone Ting , Hao Wu , Radoslaw Biernacki , Leif Lindholm , Marcin Juszkiewicz , "Edgar E. Iglesias" , Alistair Francis , Helge Deller , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Eduardo Habkost , Song Gao , Thomas Huth , Laurent Vivier , Huacai Chen , Jiaxun Yang , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aleksandar Rikalo , Aurelien Jarno , Jason Wang , Jia Liu , Stafford Horne , Mark Cave-Ayland , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Bin Meng , Palmer Dabbelt , Weiwei Li , Liu Zhiwei , David Hildenbrand , Ilya Leoshkevich , Halil Pasic , Christian Borntraeger , Eric Farman , Yoshinori Sato , Magnus Damm , Artyom Tarasenko , Stefano Stabellini , Anthony Perard , Paul Durrant , Max Filippov , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, xen-devel@lists.xenproject.org Subject: [PATCH for-8.3 v2 12/46] hw/mips/fuloong2e: use pci_init_nic_devices() Date: Mon, 6 Nov 2023 19:49:17 +0000 Message-ID: <20231106195352.301038-13-dwmw2@infradead.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106195352.301038-1-dwmw2@infradead.org> References: <20231106195352.301038-1-dwmw2@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by desiato.infradead.org. See http://www.infradead.org/rpr.html X-ZohoMail-DKIM: pass (identity @infradead.org) X-ZM-MESSAGEID: 1699300576633100011 Content-Type: text/plain; charset="utf-8" From: David Woodhouse The previous behaviour was: *if* the first NIC specified on the command line was an RTL8139 (or unspecified model) then it gets assigned to PCI slot 7, which is where the Fuloong board had an RTL8139. All other devices (including the first, if it was specified a anything other then an rtl8319) get dynamically assigned on the bus. The new behaviour is subtly different: If the first NIC was given a specific model *other* than rtl8139, and a subsequent NIC was not, then the rtl8139 (or unspecified) NIC will go to slot 7 and the rest will be dynamically assigned. Signed-off-by: David Woodhouse --- hw/mips/fuloong2e.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index 97b2c8ed8e..a45aac368c 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -201,19 +201,9 @@ static void main_cpu_reset(void *opaque) /* Network support */ static void network_init(PCIBus *pci_bus) { - int i; - - for (i =3D 0; i < nb_nics; i++) { - NICInfo *nd =3D &nd_table[i]; - const char *default_devaddr =3D NULL; - - if (i =3D=3D 0 && (!nd->model || strcmp(nd->model, "rtl8139") =3D= =3D 0)) { - /* The Fuloong board has a RTL8139 card using PCI SLOT 7 */ - default_devaddr =3D "07"; - } - - pci_nic_init_nofail(nd, pci_bus, "rtl8139", default_devaddr); - } + /* The Fuloong board has a RTL8139 card using PCI SLOT 7 */ + pci_init_nic_in_slot(pci_bus, "rtl8139", NULL, "07"); + pci_init_nic_devices(pci_bus, "rtl8139"); } =20 static void mips_fuloong2e_init(MachineState *machine) --=20 2.41.0