Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7116101rwl; Wed, 22 Mar 2023 22:33:42 -0700 (PDT) X-Google-Smtp-Source: AK7set+NRz/938gGA6zDu1kzZo74ULD+RSzEeltQe1F+jz1gwt+c2M8lmEWOooafOEL29Rb8umxE X-Received: by 2002:a05:6a20:ce22:b0:d3:c972:9a83 with SMTP id ic34-20020a056a20ce2200b000d3c9729a83mr1901849pzb.56.1679549621961; Wed, 22 Mar 2023 22:33:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679549621; cv=none; d=google.com; s=arc-20160816; b=JqgFtzZV8FefPj2CNdJtgBGqjRSsLI5sg0Eiq52k0bWdwualmWxJEpQcLqOgH+J1YG f+FE7SvbZ5iSmpMDAbbMQv8VeixYKnwiPBLHsAgxrt6Lo7DjlvsFKlBR8LLgJpMUVuh4 PHbRRYw176FCFoLL6tz6AR2zNyoaMSsqWbsKeJMz1Ya99FEQ4q5UR6qzk6KcAu2cIUy/ eiNry76Rhap4CaxEvCIZvmp+ukAcS84YYdB7Hhb5/wFCUXKIKWpHm5uNEkb+IRKVZTwb 3aGfu1mqvRjw28bfcoiHB5LpnD0Vkd8syP4g0RqvUZH13EjdKwRuPvlwCeR+ANtes/G7 VIcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0GCcooak9WK1xh4TRDY1XJvbDD37iAfzUGzKvOhf7XM=; b=qaIRVA4VI7My5RQuzCcWLGduLlqG5UfnhBEpIstWHkYzqtlx158Wjp2LgyQlc3Tf0s r6zbpNoL02aDh8qJ3//b6PPvSr7MYk8H64MzlvudzLmJNzKxFlXdAGayoRgvUoRFvAIa zl4SMy6080tXiaB2YGlhNWQ2CFx1v0OkZWcqPIaI3vVE8p9gdz2F6eKxk+h2vqfMV+nB jTgh+yXzzNFfhNpzmXonGZM5g/dHKMhZTfCSpBxxUKCv6azCB6l0OxfHLSuwMyJR9lyG /0yM+IJxB5IxratmnpInwDZMe+yVZICCXoXVyGU7LafDPAas85xkit1kNgLXAUqaxtOC 8Xmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=P8Dro5H8; 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=QUARANTINE sp=QUARANTINE 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 38-20020a631766000000b005030a59a818si16968812pgx.402.2023.03.22.22.33.30; Wed, 22 Mar 2023 22:33:41 -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=@bytedance.com header.s=google header.b=P8Dro5H8; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbjCWFc6 (ORCPT + 99 others); Thu, 23 Mar 2023 01:32:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230429AbjCWFc1 (ORCPT ); Thu, 23 Mar 2023 01:32:27 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB19431E3D for ; Wed, 22 Mar 2023 22:31:33 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id qe8-20020a17090b4f8800b0023f07253a2cso903257pjb.3 for ; Wed, 22 Mar 2023 22:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1679549491; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0GCcooak9WK1xh4TRDY1XJvbDD37iAfzUGzKvOhf7XM=; b=P8Dro5H8Ds+eHTQPRptLcDET6KgNFGOLOsOaZgHItGzVIwsDQbEDQHhqVh23D00GXH HnzW7+BQkt71sZwJ/XlUBHjudQ94Mwd5jv9FwG4Dmcs1fS1hbZXb+1v6DqiU5o/A/yBt 9/uPwzL79/8g3AADp/fbvuLKnxCGZ7kJbDa4LJAJuTQDjI4beHCDDRg58firhEcJVtyJ bBsPYaUy2sHGBA6PRnDm86gUQ1ftjUweQi+YfoNvKZz2TEMMmfZ+OlFsJbGcwL2IfbKf 8+4Rwmt0Tk6LOuVkwAiUQvyulo+njqjFRmiZaIHYLrUmmDoBhDvaJ95JoMKqf5dvc28r 1GGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679549491; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0GCcooak9WK1xh4TRDY1XJvbDD37iAfzUGzKvOhf7XM=; b=2gyxE7/3GL6TMop3MRKyo/fGmsjU4r+dOeGiXx9tl9odyyTLL6HqwAQTh0M2Uf4Rft YpHMo7Ftt4irezvn51gLDfODmFN/oUCo7Lj5B8qzAe5qzkzumwkOTyMZiYzayFDe2L4b Ig+ZnhpjVUTUZw6z8OiCyFcDvF+NS/bD2exHLRsqZix5HrQUrnPC73hrpWXIyU5eprJf gcrOqY3VHiYC6TFWAUtsj0NsWM6ub7O6NmtGolqW8PQtiF8Qw+SLMU8E6fl4B/FiPpzD JMEpZQke8T4Y6NLUE1NURgmHN3RqDmEbbaQP9QUdKOscg4Dkzork9ZpdkLEjDNPO6cvd SOKw== X-Gm-Message-State: AO0yUKWVY1cvFQTNT3bnIz6dQQHNxn/3WpheG79ouyIlbkqWyeIMZUAK cFwHhuYowOTIg6LRg+hQWl3R X-Received: by 2002:a05:6a20:6048:b0:d7:4339:fad9 with SMTP id s8-20020a056a20604800b000d74339fad9mr1864404pza.7.1679549491654; Wed, 22 Mar 2023 22:31:31 -0700 (PDT) Received: from localhost ([139.177.225.255]) by smtp.gmail.com with ESMTPSA id x5-20020aa784c5000000b006262520ac59sm10741817pfn.127.2023.03.22.22.31.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 22:31:31 -0700 (PDT) From: Xie Yongji To: mst@redhat.com, jasowang@redhat.com, tglx@linutronix.de, hch@lst.de Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 06/11] vduse: Support get_vq_affinity callback Date: Thu, 23 Mar 2023 13:30:38 +0800 Message-Id: <20230323053043.35-7-xieyongji@bytedance.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230323053043.35-1-xieyongji@bytedance.com> References: <20230323053043.35-1-xieyongji@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 This implements get_vq_affinity callback so that the virtio-blk driver can build the blk-mq queues based on the irq callback affinity. Signed-off-by: Xie Yongji --- drivers/vdpa/vdpa_user/vduse_dev.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c index 45aa8703c4b5..cefabd0dab9c 100644 --- a/drivers/vdpa/vdpa_user/vduse_dev.c +++ b/drivers/vdpa/vdpa_user/vduse_dev.c @@ -722,6 +722,14 @@ static int vduse_vdpa_set_vq_affinity(struct vdpa_device *vdpa, u16 idx, return 0; } +static const struct cpumask * +vduse_vdpa_get_vq_affinity(struct vdpa_device *vdpa, u16 idx) +{ + struct vduse_dev *dev = vdpa_to_vduse(vdpa); + + return &dev->vqs[idx]->irq_affinity; +} + static int vduse_vdpa_set_map(struct vdpa_device *vdpa, unsigned int asid, struct vhost_iotlb *iotlb) @@ -773,6 +781,7 @@ static const struct vdpa_config_ops vduse_vdpa_config_ops = { .set_config = vduse_vdpa_set_config, .get_generation = vduse_vdpa_get_generation, .set_vq_affinity = vduse_vdpa_set_vq_affinity, + .get_vq_affinity = vduse_vdpa_get_vq_affinity, .reset = vduse_vdpa_reset, .set_map = vduse_vdpa_set_map, .free = vduse_vdpa_free, -- 2.20.1