From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13A6AC25B47 for ; Fri, 27 Oct 2023 09:27:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwJ6L-0003ws-S1; Fri, 27 Oct 2023 05:25:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwJ6K-0003w4-DH; Fri, 27 Oct 2023 05:25:56 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwJ6H-0008Ev-VA; Fri, 27 Oct 2023 05:25:55 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4083cd3917eso14403935e9.3; Fri, 27 Oct 2023 02:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698398752; x=1699003552; darn=nongnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:reply-to:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=omznWtzf1XKHmZ/Z5NbQjoHVHixpWX6ejbkUDaU7VuQ=; b=IH0ZxQQGDGYoqPnwKzGr79QI4TSiucWed/KlDdN+7sK1f09d6MGFlTJSEH74dTKHNK XoR23hvpG6xPc7y0lceAEE4DJx1GQ8OCfUbLdngTJUIMPmuRwLsR/jZI5IApAY7Fst36 c0X136YECvahvrnsPQWiXNvfCxs0aXVVdQ7DV33B0MN7GRE4hgTcjLFvvXEbW5z+mHlI 8kWqr+MR97ir4UfsvFbaw557Zv7UyuPAw6UsEXwQGhuwFcA5CO5oxOif9sIyIenC+FU+ AABT2JzEtDj7iebLwwfYq1sVpRFeDIgQXUPFLpuQeYGE557YC56bWYb+lZ8VUWo2FdmI za5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698398752; x=1699003552; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:reply-to:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=omznWtzf1XKHmZ/Z5NbQjoHVHixpWX6ejbkUDaU7VuQ=; b=XSvBiEUK5smDVtHHxoAWSo8tALi8zIAWsiLJ3xXEBB3jnRNxye7de6fpVtt9Ftr/Zc FD9NoOoz+SxVnxvAa++jK2+N/YmsSg8bZ8O5UusSBlhBq1yyQckWRw+hDc5aIBfkfQ3l 9MOZO0K4Y5nIakVpTjdCbEZVQ3s3J3gI+47k0tiIjOfD9rI6liTrD2reMFUISujk6vmR zYz4QxEQ7jBLk3P/0ItkVBNkGDpjzrrGVhJnTNmjqi2dFNPWeFlSvysEXihoRwYzngdf 8LT0mzKFTvWX1ULj/Eyl/7zCZmEYW1MdGxGbvtytQoT6Bot6uGjKAnHewpDTWi7u43dk DJEw== X-Gm-Message-State: AOJu0YwdqTkRKBpEvqpsjpb3snVc1eZOXxylVi012pDPqScGir2Vu/XJ 3NRPdXJbLFaX3Ycdfjd+pYdwzBneM34iSQ== X-Google-Smtp-Source: AGHT+IHJSsP+G8xwzCbhqRxELYFim76cG7KxRmQWj9AASSXVf0gXlQDLn+wC5l6TMdiRtV9QnIFltg== X-Received: by 2002:a05:600c:468e:b0:408:3739:68fd with SMTP id p14-20020a05600c468e00b00408373968fdmr1901178wmo.6.1698398751572; Fri, 27 Oct 2023 02:25:51 -0700 (PDT) Received: from [192.168.10.177] (54-240-197-227.amazon.com. [54.240.197.227]) by smtp.gmail.com with ESMTPSA id s13-20020a05600c45cd00b004083bc9ac90sm1171371wmo.24.2023.10.27.02.25.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Oct 2023 02:25:51 -0700 (PDT) Message-ID: Date: Fri, 27 Oct 2023 10:25:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 22/28] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info() Content-Language: en-US To: David Woodhouse , qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , Stefano Stabellini , Anthony Perard , Paul Durrant , =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , "Michael S. Tsirkin" , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , Jason Wang , Marcelo Tosatti , qemu-block@nongnu.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org, Bernhard Beschow , Joel Upham References: <20231025145042.627381-1-dwmw2@infradead.org> <20231025145042.627381-23-dwmw2@infradead.org> From: "Durrant, Paul" In-Reply-To: <20231025145042.627381-23-dwmw2@infradead.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=xadimgnik@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: paul@xen.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On 25/10/2023 15:50, David Woodhouse wrote: > From: David Woodhouse > > Most code which directly accesses nd_table[] and nb_nics uses them for > one of two things. Either "I have created a NIC device and I'd like a > configuration for it", or "I will create a NIC device *if* there is a > configuration for it". With some variants on the theme around whether > they actually *check* if the model specified in the configuration is > the right one. > > Provide functions which perform both of those, allowing platforms to > be a little more consistent and as a step towards making nd_table[] > and nb_nics private to the net code. > > Also export the qemu_find_nic_info() helper, as some platforms have > special cases they need to handle. > > Signed-off-by: David Woodhouse > --- > include/net/net.h | 7 ++++++- > net/net.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 57 insertions(+), 1 deletion(-) > Reviewed-by: Paul Durrant