Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp939442rwd; Thu, 1 Jun 2023 08:24:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ66ILCdz7dykUwS2ZYfgyH5SOTHg9e6hbpmcd51h3zAt89LfoPBX8VO2qAANR+A3xaZ7R/b X-Received: by 2002:a17:902:d386:b0:1af:e302:123 with SMTP id e6-20020a170902d38600b001afe3020123mr2243034pld.3.1685633074708; Thu, 01 Jun 2023 08:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685633074; cv=none; d=google.com; s=arc-20160816; b=OmONRAiKx2OTQgR6ohBtH6a0vy1I/zwlib3Mt8cBljv1UiqMpjSc40bArKXlDkyLxQ w8Mo2MDGYUrFim135mztM2GaIxF6lshNcGuP/dLofrB03cAQkyKd0/IprQiaJk1oT0fE RGn7GA4/xq+T/0xGctlqfdw4wQK/LiiRM9fmKH+km+X1ETtFF7TFOP7FcuXPle+FEyIn tavc/23AqEavYiSFkQjI+PSDI7jL03lM0NMMK5fuagoH4UlvcNy1uFxmtdqqBnkD0d32 0rjKmfz1rROKDl3BFYzZfWvoeU/IG9F2JCp898T1cGORKheMM/ke8jsGBu6H25Mq4HU9 vSNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Dqfj7XT7ypNuOm5Zdn1QVpcZDvXLZqNRb5KEDxhoVAE=; b=LHEiQUmpTuZjHUysh1YtghMblJIAJ59m0WQg4aupzl07M6cOsGAX3IPLIRi+nHIsHQ 802F3csTcI14ZfuhWlnE0OdfVxSU5fMNx7Wc8fHRh1Cxnh6GDn+3zQfa6ueGSYvN8KF9 pZeDWC8yYx3HRg5Yz0iS0JUpPhbPzTIHG+5LCpkh68PUASZTMA5OwGgLMclm1TeZagZU kmYjN9Oc1lf2HPlZPDbLZumojiFI2dCeAJ+dmyJ8t/AF8hGU74ixcsdA2WwOffRa3tE5 k0Jy4wgdsOL4ZSZ/WGzBWb4CToicdRbQiqXCl5HAB35w1CztmcYJGWx0xSoBlHwogh8c rdwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=cN5aaBEv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a170903028300b001b0559c58d4si3067397plr.138.2023.06.01.08.24.22; Thu, 01 Jun 2023 08:24:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=cN5aaBEv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234131AbjFAPT2 (ORCPT + 99 others); Thu, 1 Jun 2023 11:19:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjFAPTH (ORCPT ); Thu, 1 Jun 2023 11:19:07 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DEB3FC for ; Thu, 1 Jun 2023 08:18:59 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-96f8d485ef3so135121466b.0 for ; Thu, 01 Jun 2023 08:18:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685632737; x=1688224737; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Dqfj7XT7ypNuOm5Zdn1QVpcZDvXLZqNRb5KEDxhoVAE=; b=cN5aaBEvgj50xDP9QJ/O48t98czXZVlgqoDh97w6f91k9kTWAQKpbSvTek/AOedAjh OBNOys9mp7nvLS/eDF2YEDcb0frrQSJoLRgdbx65elgL/OF7szfY98Z+UeTl177NIpyb lYkIqm/WRbrD4E4Q5x7PULuHG41eaJAim/FgPkNwO//u0G+0Q82/vkgnRJSGDqd0sNRr WzXMPMNY5qUGiy4Zs63b2Oi3EVPhkDIsJbvFWMYAwdbV82ad9UIOnDqffv8+wiW3N40S nu6kDfE+qfur9PoB3Gyh9pC0vv39dTRX07Y+f/lUOtsgn/bVSZKWTeni2Tw+Vb6rckGi wv0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685632737; x=1688224737; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dqfj7XT7ypNuOm5Zdn1QVpcZDvXLZqNRb5KEDxhoVAE=; b=MjSVOYJa/zID9GA22zN/0JLyeUOubmBsGu9cNbrWvu+SdYxAKWQMvhgkAT1kPZQmfu cY82WWeBcSGGb8OnSTqAy78y9BQbRRwuRal7nan5ApKm0KzAUirWb+IT6n0/xuRy0aDN UVKsBrTtWa/u14BDzXcrpyKnc/gHvxCCWWURIwcOQcWyJnExYoKg6Gv07oVXcmzVOyJN Z0LkeEPJUVF0xjDJus1aKdpHDjXijW5Idxj6wZsx1JNsNfRHYP/oLKV8/YBgCBSjSC3i tSR9U8a6xf4egNyjCRhoJ6hL6MP6x5eGSEcu8Lnoo6tfKHeoE+3lsvLPzmoZvxGurbOF B7PA== X-Gm-Message-State: AC+VfDynaQm+MunNBVvX2naVM2kM27k7UyBWjiYu1CfztcsDPAikLj3Y jJqZAAy7iUjC7npjc97pTML9cnCyQ/HGp2pRPK8= X-Received: by 2002:a17:907:7285:b0:96b:e92:4feb with SMTP id dt5-20020a170907728500b0096b0e924febmr8235977ejc.60.1685632737163; Thu, 01 Jun 2023 08:18:57 -0700 (PDT) MIME-Version: 1.0 References: <87zg5lj1yb.ffs@tglx> In-Reply-To: <87zg5lj1yb.ffs@tglx> From: Huacai Chen Date: Thu, 1 Jun 2023 23:18:44 +0800 Message-ID: Subject: Re: [PATCH 1/2] genirq/msi, platform-msi: Adjust return value of msi_domain_prepare_irqs() To: Thomas Gleixner Cc: Marc Zyngier , Huacai Chen , Bjorn Helgaas , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, Xuefeng Li , Jiaxun Yang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thomas, On Tue, May 30, 2023 at 11:03=E2=80=AFPM Thomas Gleixner wrote: > > On Tue, May 30 2023 at 16:34, Huacai Chen wrote: > > On Tue, May 30, 2023 at 4:19=E2=80=AFAM Thomas Gleixner wrote: > >> Let's take a step back and look at the larger picture: > >> > >> 1) A PCI/MSI irqdomain is attached to a PCI bus > >> > >> 2) The number of PCI devices on that PCI bus is usually known at boot > >> time _before_ the first device driver is probed. > >> > >> That's not entirely true for PCI hotplug devices, but that's hardl= y > >> relevant for an architecture which got designed less than 10 years > >> ago and the architects decided that 256 MSI vectors are good enoug= h > >> for up to 256 CPUs. The concept of per CPU queues was already know= n > >> at that time, no? > > Does this solution depend on the per-device msi domain? Can we do that > > if we use the global msi domain? > > In principle it should not depend on per-device MSI domains, but I > really don't want to add new functionality to the old operating models > as that does not create an incentive for people to convert their stuff > over. Thank you for your advice, but for our scenario, its effect is no better than this patch (because not all devices are aggressive devices), so we give up. :) And as Jason said in another thread, this problem can be solved by simply reducing the number of queues by ethtool. So let's ignore this patch since it is not acceptable. Huacai > > >> So the irqdomain can tell the PCI/MSI core the maximum number of vecto= rs > >> available for a particular bus, right? > >> > >> The default, i.e if the irqdomain does not expose that information, > >> would be "unlimited", i.e. ULONG_MAX. > > OK, thanks, but how to expose? By msi_domain_info::hwsize? > > Probably. Needs a proper helper around it. > > Thanks, > > tglx