Received: by 2002:a19:711a:0:0:0:0:0 with SMTP id m26csp1186712lfc; Wed, 27 May 2020 08:46:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrc+opkU/+2JM3sMp9TEpBNMmbYd8UOQ3mxTmhLh6LxkCzCFwujzMLA+QwlUPUgQc8HwSD X-Received: by 2002:ac8:31f3:: with SMTP id i48mr4931019qte.128.1590594409347; Wed, 27 May 2020 08:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590594409; cv=none; d=google.com; s=arc-20160816; b=Ug5SGgM9E4rumO3TjNSj0d9irSdcZn2slZkju7kDrUz96nf+oBuPn/g+rbaeDtpEAo +98lnFubm/eWZ9yuBHHoSCIZ5wG0wljQ5Zxcrad8H1kD4BW9JHdqxXCU0n/Q10VEuYO2 EAV/T/8sWR0tg+HkIwbqoTozAS2FuQ1MlTMkdsI++I8OorOdW9iBsN2iSBb3eOIXya1z 5w3lqTEGsy+gGTmzDJxoezcR2jcAREfrIdzx7wb4rXlH2NUbLOY59DQHnv/MGQRYcyOO khCXJKSwqS7B+R3opjoGlRU9mObTO3bg/i6diaQmf42rog3R4sMIJ30y5L+7F1ptV6i3 gYMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=HqnYX+YGGCx7h6fdWbWJO3IQFBbMrWtGhF1yIAlV0j0=; b=hzsfbuFu8OZHK/FIfc5q25/f/tiN+O6rFOhJd0tN3SULhBwj7XgH/jWOqgOwb92Pu6 FwE1QZZGNJCjOwn1AyDulC67aJJeQYtypsPFntpWXyuhFNPa6CYZDHw5TOd+LWav+Jmj OvvDJHSnXdyLkD/awaIwwjZo/F8/07JdtZcO97QeRgc829e7plYH3G4rrq5xCD8GQ1tg Qc2XRGLXc31KcWkKLRaZCbtOoqp3enJ5xEIV52WK8YuxXY5vWgU8dER/5/Y0aL5k3dft K0oaBkVxJ2cw/K4ghWB+7aR1CKeTNarHv2+cuCk5lUNOMY208B9fU62xzs9eE9pysNfZ NYCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p3si1805139qtj.164.2020.05.27.08.46.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 May 2020 08:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1]:42030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdyGW-0006uZ-O5 for alex.bennee@linaro.org; Wed, 27 May 2020 11:46:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdyGO-0006qj-Im for qemu-arm@nongnu.org; Wed, 27 May 2020 11:46:40 -0400 Received: from 8.mo69.mail-out.ovh.net ([46.105.56.233]:52332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdyGM-0002tU-KZ for qemu-arm@nongnu.org; Wed, 27 May 2020 11:46:40 -0400 Received: from player787.ha.ovh.net (unknown [10.110.115.231]) by mo69.mail-out.ovh.net (Postfix) with ESMTP id D93008A1F4 for ; Wed, 27 May 2020 17:46:34 +0200 (CEST) Received: from kaod.org (82-64-250-170.subs.proxad.net [82.64.250.170]) (Authenticated sender: clg@kaod.org) by player787.ha.ovh.net (Postfix) with ESMTPSA id 7B4AD12F3CB20; Wed, 27 May 2020 15:46:26 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-96R00189d38435-8926-46dd-8a79-012d20428b63,A19C442F5A36D79893466B97850BD964E95F9B50) smtp.auth=clg@kaod.org Subject: Re: [PATCH v3] arm/aspeed: Rework NIC attachment To: Markus Armbruster References: <20200527124406.329503-1-clg@kaod.org> <87lfldzehq.fsf@dusky.pond.sub.org> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Message-ID: Date: Wed, 27 May 2020 17:46:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <87lfldzehq.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 10041338322796055331 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduhedruddvgedgkeefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeffhfffudegjeeggedugeefgeeifffhueethefhfeekkedvkefggfelteefuddvteenucffohhmrghinhepohiilhgrsghsrdhorhhgnecukfhppedtrddtrddtrddtpdekvddrieegrddvhedtrddujedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepphhlrgihvghrjeekjedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdprhgtphhtthhopehqvghmuhdqrghrmhesnhhonhhgnhhurdhorhhg Received-SPF: pass client-ip=46.105.56.233; envelope-from=clg@kaod.org; helo=8.mo69.mail-out.ovh.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/27 11:46:36 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Andrew Jeffery , qemu-devel@nongnu.org, qemu-arm@nongnu.org, Joel Stanley , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: 9IiKN110g3yp On 5/27/20 3:36 PM, Markus Armbruster wrote: > Cédric Le Goater writes: > >> The number of MACs supported by an Aspeed SoC is defined by "macs_num" >> under the SoC model, that is two for the AST2400 and AST2500 and four >> for the AST2600. The model initializes the maximum number of supported >> MACs but the number of realized devices is capped by the number of >> network device back-ends defined on the command line. This can leave >> unrealized devices hanging around in the QOM composition tree. >> >> Modify the machine initialization to define which MACs are attached to >> a network device back-end using a bit-field property "macs-mask" and >> let the SoC realize all network devices. >> >> The default setting of "macs-mask" is "use MAC0" only, which works for >> all our AST2400 and AST2500 machines. The AST2600 machines have >> different configurations. The AST2600 EVB machine activates MAC1, MAC2 >> and MAC3 and the Tacoma BMC machine activates MAC2. > > Let's be more clear on what this means, and "This is actually a device > modelling fix for these two machines." Okay? Well, I guess so. It's a fix in the way we attach network backends to the MACs of the machines. On the tacoma-bmc, we had to use '-nic -nic -nic ' to configure the MAC2 in use by the machine. Which was dubious. Now, a single -nic is enough. >> Inactive MACs will have no peer and QEMU may warn the user with : >> >> qemu-system-arm: warning: nic ftgmac100.0 has no peer >> qemu-system-arm: warning: nic ftgmac100.1 has no peer >> qemu-system-arm: warning: nic ftgmac100.3 has no peer >> >> Signed-off-by: Cédric Le Goater >> Reviewed-by: Markus Armbruster > > Here's the "info qom-tree" change for tacoma-bmc: > > /machine (tacoma-bmc-machine) > /peripheral (container) > /peripheral-anon (container) > /soc (ast2600-a1) > [...] > /ftgmac100[0] (ftgmac100) > /ftgmac100[0] (qemu:memory-region) > /ftgmac100[1] (ftgmac100) > + /ftgmac100[0] (qemu:memory-region) > /ftgmac100[2] (ftgmac100) > + /ftgmac100[0] (qemu:memory-region) > /ftgmac100[3] (ftgmac100) > + /ftgmac100[0] (qemu:memory-region) Yes. All are realized now. > [...] > /mii[0] (aspeed-mmi) > /aspeed-mmi[0] (qemu:memory-region) > /mii[1] (aspeed-mmi) > + /aspeed-mmi[0] (qemu:memory-region) > /mii[2] (aspeed-mmi) > + /aspeed-mmi[0] (qemu:memory-region) > /mii[3] (aspeed-mmi) > + /aspeed-mmi[0] (qemu:memory-region) Same for the MMI interfaces on AST2600. > These changes are due to realizing MAC1, MAC2, MAC3. Looks good. > > Here's "info qtree": > > dev: ftgmac100, id "" > gpio-out "sysbus-irq" 1 > aspeed = true > - mac = "52:54:00:12:34:56" > - netdev = "hub0port0" > + mac = "52:54:00:12:34:57" > + netdev = "" > mmio 000000001e660000/0000000000002000 > dev: ftgmac100, id "" > - aspeed = false > - mac = "00:00:00:00:00:00" > + gpio-out "sysbus-irq" 1 > + aspeed = true > + mac = "52:54:00:12:34:58" > netdev = "" > + mmio 000000001e680000/0000000000002000 > dev: ftgmac100, id "" > - aspeed = false > - mac = "00:00:00:00:00:00" > - netdev = "" > + gpio-out "sysbus-irq" 1 > + aspeed = true > + mac = "52:54:00:12:34:56" > + netdev = "hub0port0" > + mmio 000000001e670000/0000000000002000 > dev: ftgmac100, id "" > - aspeed = false > - mac = "00:00:00:00:00:00" > + gpio-out "sysbus-irq" 1 > + aspeed = true > + mac = "52:54:00:12:34:59" > netdev = "" > + mmio 000000001e690000/0000000000002000 > [...] > dev: aspeed-mmi, id "" > mmio 000000001e650000/0000000000000008 > dev: aspeed-mmi, id "" > + mmio 000000001e650008/0000000000000008 > dev: aspeed-mmi, id "" > + mmio 000000001e650010/0000000000000008 > dev: aspeed-mmi, id "" > + mmio 000000001e650018/0000000000000008 > > Here we can see the network backend now gets connected to MAC2 instead > of MAC0. yes. With only one nic on the command line, the backend was attached to the first (unused) MAC0 of the machine and now it is attached to the first active MAC2 of the machine. > > This is without any networking-related options, i.e. we get just the > single default network backend. > >> --- >> >> To be applied on top of patch : >> >> "arm/aspeed: Compute the number of CPUs from the SoC definition" >> http://patchwork.ozlabs.org/project/qemu-devel/patch/20200519091631.1006073-1-clg@kaod.org/ >> >> Markus, do you mind taking this patch in your QOM series also ? > > On the contrary! > > I'll work my "info qom-tree" and "info qtree" diffs into the commit > message, if you don't mind. Sure. Thanks, C.