Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2036095rwj; Sun, 18 Dec 2022 21:22:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf59wQ5oEi+2xK8TOj4YamFf9dFKjN6//A8bt8vBzK1kXkGfBNM/SkuduKHgPZ2BDA8TGYoT X-Received: by 2002:a17:902:9696:b0:189:cf92:6f5c with SMTP id n22-20020a170902969600b00189cf926f5cmr42531976plp.52.1671427379566; Sun, 18 Dec 2022 21:22:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671427379; cv=none; d=google.com; s=arc-20160816; b=XsSH7MmPhsAZNueaeF6quYUqp0ISPFXORUxLllqhLbS2Lbufq7I94brvv2dsEWnl+I N1NmZtx9iRRTn0DWjQkB4lltAfmhcC+yXpWOb+MA4QurU99EX8IHZ5VcOnifzpX3Lnnt IluWEOotqdWL1t0zK5kc7ZOc6HCmV50xAx6HOOvOdI1tVPqZ8SEMeOwggJ2CXv9mIXQR r2npbJiqq7gUCapyD1D071LNryF9DO/FXFg7owvkLtRapngg4hPfvVwgcYmPPKS51rUk NHNCxFIroeZQ7N9Q2lHaCF1yKymJGvzzZ2aCvpOom8ooeh9WM8BwQHAY0LbGPhl637Be m/KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yLUZjWcghSAP0Jcw1C/k6kbbyQzYb6OIC4BK30LiWEw=; b=oDGzj6xCeaVI1ugNu4FoGVfbgsS6tq9iKJbekV+8dR4jXDDV9+26eUTV9fOYhW4XHV fXN9a5CK7ltfS7Gt79xRkoB4sHGYJ23kSv7d8PsOkyQaiKz5IGrAJ0TI3n7M3D2yqpFF P3leQSGwWN/W93AYyHjSMpb+2LhEKtaugpQdSMiYm+6+DQd28JHy5LvHitSGUSB8jzu8 BfDXLNynJo/c+GJ1nqzij7uV2cALL/ce4zTEOLHT3BoWJfZqiowSVwaH6lG82xyDYuLR qzDrxpmbV5hPw+4UxBndbvUaYs8dH4E4Hh9wY+5BoQLHrJL0X1Zy2BZ9JMUO+VocSQ7j mrCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="P/vBoKQf"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f3-20020a170902860300b0019111dd0568si5466085plo.459.2022.12.18.21.22.50; Sun, 18 Dec 2022 21:22:59 -0800 (PST) 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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="P/vBoKQf"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230470AbiLSEjR (ORCPT + 71 others); Sun, 18 Dec 2022 23:39:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbiLSEjM (ORCPT ); Sun, 18 Dec 2022 23:39:12 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C77B59592 for ; Sun, 18 Dec 2022 20:39:10 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id d20so11337595edn.0 for ; Sun, 18 Dec 2022 20:39:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yLUZjWcghSAP0Jcw1C/k6kbbyQzYb6OIC4BK30LiWEw=; b=P/vBoKQf5XqdFa45bFbzUHUX5rhLqbIrGPk7w5fDus5Cfx8IHPM0XRwWdbbJEJytUR SltFGVjrurR6o4shT433ybEXkqOjxM0aLEwzpSE8ZVbf5tSjeNo3ohzitwQtfXg5My2s UQ1v9fHzjERiR0+UxUf+YJedIAOpXH/8v/q/WccqyVhFTvIlFPq6f5Y1VLEZKiA2adUJ ZsfGABzZ7FFBMhCAgI4dBU0soLw2v4C79ERJU8+1C2RAkP6+KMpZOML26CBchJNk42T2 AeEOc27CcsI+Fhd31n1VBDw2JMrr0q9Ny+TXL1OsyLzhtgOsB6fwGdtLy61gC5Tx0+6K jkag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=yLUZjWcghSAP0Jcw1C/k6kbbyQzYb6OIC4BK30LiWEw=; b=W96bpeJ9Mbb0cQb5zbH4+BC3Ux37PkQnw70VMW7DviIM3/JZ1Pf+d1fp1H8+ehNKW/ rPiuj2HMk5dsKmoLoiyfsvxq+N3BWgDfrsBKis2QOCcaN4O9OO5pVOjNUmGEvyfEHHla ApZP4aunA+GuCQUrT/++PxGP2aQqJGxYJDbToaSB0lk7IxHGXfDyhnMzgX0v244Toz+g Y4oS/H4e8U4x0xW/xYf4VItUljpRL3U7dEvzfhyGbTURLCihKuL8g4fGHNm33mJMDpCZ RaBVCZ0bpAvbhrd+axJ/xNZ2CbJy36qLN4igbX7dG4eGSZCPh9kNk7+u+59CpqcBkOv1 sTLQ== X-Gm-Message-State: ANoB5pkC+K3qTGDsCI4yHv3TxxOvqqXL4Seuh1hYZUh4NbG3Jxz36J3F QOD9dHcJhc/4uP4e+fihXH0Qft2ukhhMoQH8NvGu X-Received: by 2002:a05:6402:230f:b0:46c:dc40:4635 with SMTP id l15-20020a056402230f00b0046cdc404635mr17616087eda.358.1671424749327; Sun, 18 Dec 2022 20:39:09 -0800 (PST) MIME-Version: 1.0 References: <20221205084127.535-1-xieyongji@bytedance.com> <20221205084127.535-4-xieyongji@bytedance.com> In-Reply-To: From: Yongji Xie Date: Mon, 19 Dec 2022 12:38:58 +0800 Message-ID: Subject: Re: [PATCH v2 03/11] vdpa: Add set_irq_affinity callback in vdpa_config_ops To: Jason Wang Cc: "Michael S. Tsirkin" , Thomas Gleixner , Christoph Hellwig , virtualization , linux-kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On Fri, Dec 16, 2022 at 11:58 AM Jason Wang wrote: > > On Mon, Dec 5, 2022 at 4:43 PM Xie Yongji wrote: > > > > This introduces set_irq_affinity callback in > > vdpa_config_ops so that vdpa device driver can > > get the interrupt affinity hint from the virtio > > device driver. The interrupt affinity hint would > > be needed by the interrupt affinity spreading > > mechanism. > > > > Signed-off-by: Xie Yongji > > --- > > drivers/virtio/virtio_vdpa.c | 4 ++++ > > include/linux/vdpa.h | 8 ++++++++ > > 2 files changed, 12 insertions(+) > > > > diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c > > index 08084b49e5a1..4731e4616ee0 100644 > > --- a/drivers/virtio/virtio_vdpa.c > > +++ b/drivers/virtio/virtio_vdpa.c > > @@ -275,9 +275,13 @@ static int virtio_vdpa_find_vqs(struct virtio_device *vdev, unsigned int nvqs, > > struct virtio_vdpa_device *vd_dev = to_virtio_vdpa_device(vdev); > > struct vdpa_device *vdpa = vd_get_vdpa(vdev); > > const struct vdpa_config_ops *ops = vdpa->config; > > + struct irq_affinity default_affd = { 0 }; > > struct vdpa_callback cb; > > int i, err, queue_idx = 0; > > > > + if (ops->set_irq_affinity) > > + ops->set_irq_affinity(vdpa, desc ? desc : &default_affd); > > I wonder if we need to do this in vhost-vDPA. I don't get why we need to do this in vhost-vDPA? Should this be done in VM? > Or it's better to have a > default affinity by the vDPA parent > I think both are OK. But the default value should always be zero, so I put it in a common place. > (Looking at virtio-pci, it doesn't do something like this). > Yes, but we did something like this in the pci layer: pci_alloc_irq_vectors_affinity(). Thanks, Yongji