From nobody Tue May 14 17:05:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1688291266; cv=none; d=zohomail.com; s=zohoarc; b=iaEvfNog9l3/vB2n586V6ZXBJ7shZ2Gn3Uke52rsKVH3KTVbJKnM7aw+gwdAxUDu2iTOjLZeppd+wNNtLVUVGAB2SLrJqUgWsGgk2m50kpb5R+img+OBPtjyD+WsdM0b6lDTA47PZ3VlzRhRDR7ZNrlwEgN3cqqXyuW/buJzriA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688291266; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=IJPRtuvbHAsqaGR1Ln6VUbGyabvHfWSFqdv+KVApqEU=; b=fp5R+b9g7mlKiNZ9OpKlabTl8P06Hgu6AzVVZ1jG1yqmv4j30U1u/s9mgmbI5QPimTVvvOU+bUNqC7dmB8rYpSYxK9krNxTkj3TBVx4MTY2OoT4xQ71mcDqDsV+fLaDKcz/7FfUQdnwJKNDcNo7YP7o+84X6JrJLK4F3DWsLbHc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688291266631948.9502311091608; Sun, 2 Jul 2023 02:47:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFtfJ-0003lZ-KP; Sun, 02 Jul 2023 05:46:45 -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 1qFtfI-0003jm-1z for qemu-devel@nongnu.org; Sun, 02 Jul 2023 05:46:44 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFtfG-0007gf-Lb for qemu-devel@nongnu.org; Sun, 02 Jul 2023 05:46:43 -0400 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-54f75f85a17so1796273a12.0 for ; Sun, 02 Jul 2023 02:46:42 -0700 (PDT) Received: from alarm.. ([157.82.204.253]) by smtp.gmail.com with ESMTPSA id i1-20020a635841000000b005348af1b84csm12934067pgm.74.2023.07.02.02.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jul 2023 02:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1688291201; x=1690883201; 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=IJPRtuvbHAsqaGR1Ln6VUbGyabvHfWSFqdv+KVApqEU=; b=SZ6DxrzDPRFD6yltfqE+fWhle8GDnGDeHxTH06+MZgfXVuMfzPKwXiHSXRlnFX7qvY BzxQ0Cm+MHM/+jUyDi6sP7JPB+h/QKt1Cjkmpoaivgnlr0aWq4pgseYcDJvHx7gfxT6U aL+T1+Lmjt7J8j/ox9PzYmYd2LoXW2uGiZ7U2qajumMYPolvUIqltOufvPVDkUkX5WBc U+uMFL3DJs9qrNjFlnDcLrIuL3aNGSUVjn/6I64nu9Z/5R9E2dEruq36GSmnpuxTzsE/ uycU4iwMaSV3XLnI0pCAXdDv+wVI7lyOU0lnsM4YSSOPUqo3tcKJJ7sU5ISYG5RvdIJU eRwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688291201; x=1690883201; 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=IJPRtuvbHAsqaGR1Ln6VUbGyabvHfWSFqdv+KVApqEU=; b=ESNCa0FcmvMrhJaWhm69l/dDSFw4TIvnNl+IzFBWTO8ss282lsdx2dSEU/gYVxpN2i pFF3R17psAbg+gfEnp6HUoEaKoVqD2wW85P8ohNObC2c4lpxhAY8+avY9DTbBvTpkbey 7pPJ7RiR0e2GoMw3ijJLqeDsUezcBEcmzgkY0XZ8UOA6ppTOwonG1t4T2SD8AbNBm8bY Qy1PkEUCg5EnQ7ARwGMjxfCOkb+dy6RqL2eMufAyEikHQXx//RcrvrEiFe4IrXYiMY3D P4FMk31JzO4jEg01uHSlgrySgYmTDe8jCox6Wp42kr8QE+Ttng539hUuadk2vQEjrxGY HrdA== X-Gm-Message-State: ABy/qLY/wFAwmL9Dtc68QiV74F6d6HMD1gaDWqT8gDONAW7/+GVNYkrv GpHelZvUd+eRDFw2SBR2Rna7UWqV27VyuSdaFsw= X-Google-Smtp-Source: APBJJlH2QbdS0xQp+mMf2VxJ2dmwE7z9oMUZnMKiQb4iG3LEkvCAG80X3eufyeNNWP07NPyYX+e5gQ== X-Received: by 2002:a05:6a20:8e0b:b0:12e:7d41:b2f with SMTP id y11-20020a056a208e0b00b0012e7d410b2fmr417256pzj.46.1688291201074; Sun, 02 Jul 2023 02:46:41 -0700 (PDT) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Ani Sinha , "Michael S . Tsirkin" , Marcel Apfelbaum , Sriram Yagnaraman , Jason Wang , Keith Busch , Klaus Jensen , Akihiko Odaki Subject: [PATCH v2 1/4] docs: Fix next function numbers in SR/IOV documentation Date: Sun, 2 Jul 2023 18:46:25 +0900 Message-ID: <20230702094631.39111-2-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230702094631.39111-1-akihiko.odaki@daynix.com> References: <20230702094631.39111-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::531; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x531.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1688291268890100007 Content-Type: text/plain; charset="utf-8" The ARI next function number field is undefined for VF so the PF should end the linked list formed with the field by specifying 0. This also changes the value of the field for VF; it seems to imply the value has some meaning if it differs from one of the PF, but it doesn't. Fixes: 2503461691 ("pcie: Add some SR/IOV API documentation in docs/pcie_sr= iov.txt") Signed-off-by: Akihiko Odaki --- docs/pcie_sriov.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pcie_sriov.txt b/docs/pcie_sriov.txt index 7eff7f2703..2b7094dc47 100644 --- a/docs/pcie_sriov.txt +++ b/docs/pcie_sriov.txt @@ -48,7 +48,7 @@ setting up a BAR for a VF. ... int ret =3D pcie_endpoint_cap_init(d, 0x70); ... - pcie_ari_init(d, 0x100, 1); + pcie_ari_init(d, 0x100, 0); ... =20 /* Add and initialize the SR/IOV capability */ @@ -78,7 +78,7 @@ setting up a BAR for a VF. ... int ret =3D pcie_endpoint_cap_init(d, 0x60); ... - pcie_ari_init(d, 0x100, 1); + pcie_ari_init(d, 0x100, 0); ... memory_region_init(mr, ... ) pcie_sriov_vf_register_bar(d, bar_nr, mr); --=20 2.41.0 From nobody Tue May 14 17:05:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1688291291; cv=none; d=zohomail.com; s=zohoarc; b=lPDuxutY2ytazExx2m8tea0eAUq0wuUFz4BjJ1X001CoRcyTnUyumE2gZBZsLpmeNku6IJxMO4F7DezHtyC3AbKpvp9xzB+6vRIIOzydBqwd8qnqHmWYy7hIwYLhLpOp8m28gxL58GqnPx9h2Elp5Yy5Y5rsdQEjL2yGokLeArQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688291291; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=rynjAUP6lxRQ+wMlciGvKUU8H/YrNM/NmVpo+UCvFLI=; b=h1Ejtipg0C1ypFaFMXa3A1x801Uj4JEqBZFK4rDZJIqVkwv4FpVhwwB19xuNMHp6FWKFbq97WGhcrq32bbiXle7pD8+5KBm171DZG4qaUjMWsTydmfyv6pFTdRQ3+FoXPWwaxIfwC5xwm7KPNed488g3ZgeIE9eMtZ6vGuSDC6A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688291291214107.62153996140103; Sun, 2 Jul 2023 02:48:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFtfT-0003mY-1T; Sun, 02 Jul 2023 05:46:55 -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 1qFtfK-0003m9-G1 for qemu-devel@nongnu.org; Sun, 02 Jul 2023 05:46:46 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFtfI-0007hC-WB for qemu-devel@nongnu.org; Sun, 02 Jul 2023 05:46:46 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-666e5f0d60bso1753171b3a.3 for ; Sun, 02 Jul 2023 02:46:44 -0700 (PDT) Received: from alarm.. ([157.82.204.253]) by smtp.gmail.com with ESMTPSA id i1-20020a635841000000b005348af1b84csm12934067pgm.74.2023.07.02.02.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jul 2023 02:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1688291203; x=1690883203; 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=rynjAUP6lxRQ+wMlciGvKUU8H/YrNM/NmVpo+UCvFLI=; b=B612EM/a3WVZrH9RXFziPekzNdgf+ikv0zlJdQfb52yMHVV84Dwom/ODLgUnwqJtYu bIx7IhMP56WJaeSAjtxGQF47FyyfU9u/LCQwT6VBM3o9ZUgk8oVBr87xJqUArbxFEwWg UMyaMiC+g+wENgLN7hDZSs/JaKtwCw9ukfCmzXeQC6z2fA9LWvrWfsOWcv/bvWNGb/BD 6GWMHkf1esw627Tr4Z8aY3JANRy7hHn4+k4VBaGnGxuJlivvD4CJPxoF5o3wtKpF1otL fCy+/PUUWkKW+GLuozaZrXz+2cHwvqgtQVUWCd7LPvibUaH+wZ2y3RWT6MYJEihS4v/7 Q4mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688291203; x=1690883203; 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=rynjAUP6lxRQ+wMlciGvKUU8H/YrNM/NmVpo+UCvFLI=; b=TN331p0we2S7g9iaF7jJW8QjsEktLpKqI7FcaLOkboKDrTCMQ+Dn5CzUWIQ/Nlru2c E0C4HUpY5lMgeqIrcspYg61ooGHM21Pl+0tisDC4z2RX1R+nqwfAVBYn8QIw1I6bMDC8 zvjr1a9sUtiJVMCNUGm2ekF2aWfUoZTGXdKMKQ6Y7s73mR6xpbJfKimTkt1V6lFHEbZX mm8e/VK5rMSsmPuQVrlXZqQkjroe3sCs/ER+5J46gEUzm7c6Zhq8CfP3EqkvQ227HFcN Yn+v3lCDhVQlBNOD9kXMRe6uNhP48v8abQt97YfEyAUakQCswuAe3K884yoY8+mbrKb6 NzZw== X-Gm-Message-State: ABy/qLaKH5EAfFCeYHKXd5z4FB5bwvShYBrv4XsqpsPfbbyghcYR4xOH XhQPYHVuVP/6WFhU/qsWTZnGwK6RGbTVkrsvM8Y= X-Google-Smtp-Source: APBJJlGYx0zHr5rAT4MElCApMVKMqDnTweJ5MkKsuQDp8ASdjoFtmYdlueFoS9hV/AuFE2B4gF142w== X-Received: by 2002:a05:6a20:3ca7:b0:12d:7555:a62d with SMTP id b39-20020a056a203ca700b0012d7555a62dmr6175250pzj.33.1688291203687; Sun, 02 Jul 2023 02:46:43 -0700 (PDT) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Ani Sinha , "Michael S . Tsirkin" , Marcel Apfelbaum , Sriram Yagnaraman , Jason Wang , Keith Busch , Klaus Jensen , Akihiko Odaki Subject: [PATCH v2 2/4] hw/nvme: Fix ARI next function numbers Date: Sun, 2 Jul 2023 18:46:26 +0900 Message-ID: <20230702094631.39111-3-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230702094631.39111-1-akihiko.odaki@daynix.com> References: <20230702094631.39111-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::42e; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42e.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1688291292424100005 Content-Type: text/plain; charset="utf-8" The ARI next function number field is undefined for VF. The PF should end the linked list formed with the field by specifying 0. Fixes: 44c2c09488 ("hw/nvme: Add support for SR-IOV") Signed-off-by: Akihiko Odaki --- hw/nvme/nvme.h | 1 + hw/core/machine.c | 1 + hw/nvme/ctrl.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/nvme/nvme.h b/hw/nvme/nvme.h index 209e8f5b4c..c2ba6755ab 100644 --- a/hw/nvme/nvme.h +++ b/hw/nvme/nvme.h @@ -515,6 +515,7 @@ typedef struct NvmeParams { uint16_t sriov_vi_flexible; uint8_t sriov_max_vq_per_vf; uint8_t sriov_max_vi_per_vf; + bool ari_nextfn_1; } NvmeParams; =20 typedef struct NvmeCtrl { diff --git a/hw/core/machine.c b/hw/core/machine.c index 46f8f9a2b0..f984a767a2 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -41,6 +41,7 @@ =20 GlobalProperty hw_compat_8_0[] =3D { { "migration", "multifd-flush-after-each-section", "on"}, + { "nvme", "ari-nextfn-1", "on"}, }; const size_t hw_compat_8_0_len =3D G_N_ELEMENTS(hw_compat_8_0); =20 diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index fd917fcda1..4bbafc66b5 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -8088,7 +8088,7 @@ static bool nvme_init_pci(NvmeCtrl *n, PCIDevice *pci= _dev, Error **errp) pcie_endpoint_cap_init(pci_dev, 0x80); pcie_cap_flr_init(pci_dev); if (n->params.sriov_max_vfs) { - pcie_ari_init(pci_dev, 0x100, 1); + pcie_ari_init(pci_dev, 0x100, n->params.ari_nextfn_1 ? 1 : 0); } =20 /* add one to max_ioqpairs to account for the admin queue pair */ @@ -8406,6 +8406,7 @@ static Property nvme_props[] =3D { params.sriov_max_vi_per_vf, 0), DEFINE_PROP_UINT8("sriov_max_vq_per_vf", NvmeCtrl, params.sriov_max_vq_per_vf, 0), + DEFINE_PROP_BOOL("ari-nextfn-1", NvmeCtrl, params.ari_nextfn_1, false), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.41.0 From nobody Tue May 14 17:05:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1688291266; cv=none; d=zohomail.com; s=zohoarc; b=cPG+PbbaZ5W5r91dDgUMMU3e87mpJDjYBMY5VV4wDFUp6iwEhgJPh7F0ZKhgJvYDg0O3ZDoisl8MBcc9u6yNQ4j+JCEIsM4nz+H1/yotHfT8vRT5g0aRoxEdyehqEWhhcGN7vQkRk3+sbPuv+/Q12mPPUMM2YBEF9AbUx4OvwRw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688291266; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=P46Fz3KmMMoBs0YAqCjAY4+LmuCjaIetWje4x1NrkhE=; b=a92w6ypuS3nAntR8EIHbWa+d1EntCc2ZL7++OY48kbtwtnmQU4pgsyR1f/5ZEN7UpNCvxmBLf5+kUWnPYnSPv2u9EzL8FlylehSG0MjcKcyOzZSgQ21etzZMl1+dELdbcmFbnsHe9N7RXt7o5oCOZXhEHb3TkY+4oCHlcORsLa8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688291266561559.9436682940417; Sun, 2 Jul 2023 02:47:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFtfU-0003oE-7k; Sun, 02 Jul 2023 05:46:56 -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 1qFtfN-0003mc-2b for qemu-devel@nongnu.org; Sun, 02 Jul 2023 05:46:54 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFtfL-0007j1-KP for qemu-devel@nongnu.org; Sun, 02 Jul 2023 05:46:48 -0400 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-55b1238a013so2411218a12.3 for ; Sun, 02 Jul 2023 02:46:47 -0700 (PDT) Received: from alarm.. ([157.82.204.253]) by smtp.gmail.com with ESMTPSA id i1-20020a635841000000b005348af1b84csm12934067pgm.74.2023.07.02.02.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jul 2023 02:46:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1688291206; x=1690883206; 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=P46Fz3KmMMoBs0YAqCjAY4+LmuCjaIetWje4x1NrkhE=; b=d3qQdDjR8S0Hnhn36eoNzp93CZjdAIkIMuphKMSAXl3JTy14soC+hQjE2cbrdDUf2h 70bG6mDciTkSA3ZEz1u2bzYZvukBnhWESUC9Wmz2Pw+mXw4cSYbk6GAM71a+LRwk9xCp InYFpCciyr3iEbjjENn37HLBreRvTTJcgRn9QH9eG69Q0NY7Q9WDV4VrhBQuzS1G7YWs n8gkBYWAwQNqi09yPlxrx7RKm9l4312WZP3Yod4pwo/90ms8Q6DtlAJcFqtPF9vYY4M3 hf8Z62vKskoNcTKtSveZQ5DIR7WUluadxh5aQZVpQVO/gCJ9iHP8n6UX3tUaCQ6DXty6 3tvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688291206; x=1690883206; 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=P46Fz3KmMMoBs0YAqCjAY4+LmuCjaIetWje4x1NrkhE=; b=dJBBzdzy0fEi1ZawLEbAJQL7F65PzoKo55d0+lPnC4kd9WlPlTJ3WoTOhFN1FAeOvh dKbJN6RSslvT8igbxuobofLiDrTEJuXeau+EfFB1zC9zv1EP53HYYZ3r/i5Ou/Mq8BA+ B1FlohaGbzc5527t9mSEx3fKBL7K8xSJZ853bUKDefmKG4MLD85P9JHme+9nR7GfKo7Z OpdH8fcr/qIwcTSbhupBkaf9WiUYzKHdt/VtCrqPFQrwINprY4EIgcwWW+MnvybI75C9 Jz8HzWjhO3mYQEFB1WiWstuBZcSSm4EgLpaTVvWDSZi/vSBo0/3TLe1RVvUBRoZ2XX2+ QX8w== X-Gm-Message-State: AC+VfDxUJMMrpClc1XBrSQXMEjp17ilw8bdJY8ysUcn2m5SjtTpDNidl XZaJcKuK0Cp7f2KSDEVEIO7KJTlJXlkV5JWio8w= X-Google-Smtp-Source: ACHHUZ6Uf++OHPCnA2v76oL/AeCODLF+njIckP51dz9vHvgXneBO9bezUbEi0NrGrWUmTFA0VmTaQw== X-Received: by 2002:a05:6a20:8f07:b0:122:a808:dbbe with SMTP id b7-20020a056a208f0700b00122a808dbbemr10254632pzk.29.1688291206198; Sun, 02 Jul 2023 02:46:46 -0700 (PDT) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Ani Sinha , "Michael S . Tsirkin" , Marcel Apfelbaum , Sriram Yagnaraman , Jason Wang , Keith Busch , Klaus Jensen , Akihiko Odaki Subject: [PATCH v2 3/4] igb: Fix ARI next function numbers Date: Sun, 2 Jul 2023 18:46:27 +0900 Message-ID: <20230702094631.39111-4-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230702094631.39111-1-akihiko.odaki@daynix.com> References: <20230702094631.39111-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::533; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x533.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1688291268893100008 Content-Type: text/plain; charset="utf-8" The ARI next function number field is undefined for VF so the PF should end the linked list formed with the field by specifying 0. Fixes: 3a977deebe ("Intrdocue igb device emulation") Signed-off-by: Akihiko Odaki --- hw/core/machine.c | 3 ++- hw/net/igb.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index f984a767a2..1f5aacd1dc 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -41,7 +41,8 @@ =20 GlobalProperty hw_compat_8_0[] =3D { { "migration", "multifd-flush-after-each-section", "on"}, - { "nvme", "ari-nextfn-1", "on"}, + { "igb", "ari-nextfn-1", "on" }, + { "nvme", "ari-nextfn-1", "on" }, }; const size_t hw_compat_8_0_len =3D G_N_ELEMENTS(hw_compat_8_0); =20 diff --git a/hw/net/igb.c b/hw/net/igb.c index 1c989d7677..d37d43c155 100644 --- a/hw/net/igb.c +++ b/hw/net/igb.c @@ -78,6 +78,8 @@ struct IGBState { uint32_t ioaddr; =20 IGBCore core; + + bool ari_nextfn_1; }; =20 #define IGB_CAP_SRIOV_OFFSET (0x160) @@ -431,7 +433,7 @@ static void igb_pci_realize(PCIDevice *pci_dev, Error *= *errp) hw_error("Failed to initialize AER capability"); } =20 - pcie_ari_init(pci_dev, 0x150, 1); + pcie_ari_init(pci_dev, 0x150, s->ari_nextfn_1 ? 1 : 0); =20 pcie_sriov_pf_init(pci_dev, IGB_CAP_SRIOV_OFFSET, TYPE_IGBVF, IGB_82576_VF_DEV_ID, IGB_MAX_VF_FUNCTIONS, IGB_MAX_VF_FUNCTIONS, @@ -582,6 +584,7 @@ static const VMStateDescription igb_vmstate =3D { =20 static Property igb_properties[] =3D { DEFINE_NIC_PROPERTIES(IGBState, conf), + DEFINE_PROP_BOOL("ari-nextfn-1", IGBState, ari_nextfn_1, false), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.41.0 From nobody Tue May 14 17:05:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1688291289; cv=none; d=zohomail.com; s=zohoarc; b=QoQci3MAz8/Ybq1qdojrqeDahDeccg8PnhxvW+0lciVK9iwLXLcYs0XgkDiiLvBEDKWlHFPTjxAT4st4b5IVx3/oGITDq9PF7XJnQRaHRL0bGWZbDe/zKZo2x0UoX6KGtam/DeVrEGarFYQN0F9STFq8u0Z2b0dQB+BF039ozas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688291289; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=viqv5Rw5CshESJTyQPgOsxciBoe2+ZUBIm03boeiAVY=; b=gKFwsR6zKl1Nv1XqMYT2bBm9mq2tqkHVzJ5OG7/7vxUjbb1r0l/r76PIsdiJD8WZ8piZKHNwo5x+j5rX6E4peygY/0on9VYjqIpyNSdT5s7PdYmiMEyxF9xe01VPokg1kj2urzOX3fRUp+reI5HVF8UprrpZpqjgkAwD36RZDRQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1688291289277131.99848213211112; Sun, 2 Jul 2023 02:48:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFtfV-0003og-4r; Sun, 02 Jul 2023 05:46: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 1qFtfT-0003n1-1V for qemu-devel@nongnu.org; Sun, 02 Jul 2023 05:46:55 -0400 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFtfO-0007jT-QO for qemu-devel@nongnu.org; Sun, 02 Jul 2023 05:46:53 -0400 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6b87d505e28so2977919a34.2 for ; Sun, 02 Jul 2023 02:46:49 -0700 (PDT) Received: from alarm.. ([157.82.204.253]) by smtp.gmail.com with ESMTPSA id i1-20020a635841000000b005348af1b84csm12934067pgm.74.2023.07.02.02.46.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jul 2023 02:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1688291209; x=1690883209; 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=viqv5Rw5CshESJTyQPgOsxciBoe2+ZUBIm03boeiAVY=; b=ZyPCwZ9c/sOP95jqAEWMRMj2S4CmzWswcD9HPWN/zggISrnmt6E/9qDitkWb3X9HX2 2eUfWYIbQS6cgrKbLyBvo9bslqsyIPwMBp0nHzDOfIVYFZEwJUvegrWPkgBz4J1D6fdO 0qj7A+H/8vWyvIqZg3wCFZkL6eHBgU9pvD5I54nbMrYkIQ3Nfp4W0g80Mfo6PePPmR3G BFHww7Lqoj27t0tdf/N+fDQ7NzuhNOmq96H88VAToWaWvrHxEqiVYQI/1IRVual5w5ow TJb7EAFbUOFXFhshM5GXQJQhbf+9acvfYJPo6U6kQ9fpsu/4q+hI+YTZ69IMku+Ha/yN gNPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688291209; x=1690883209; 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=viqv5Rw5CshESJTyQPgOsxciBoe2+ZUBIm03boeiAVY=; b=aDeVIqEMpXD8zarX9vG7t6YxF8e5kMvOQHKjyULbIojLkzvcwIdqbJl4Y2+HQ8KNK+ NNCU9pJc8RTbZqy7L7aQUhozSty4QvhDekdMcHftDgfz7sTtPaPcGLnMtc5s0gtsIt11 qZOQZaGHsqcNCUL9Q9y0nXZkEs0L2Vr15hL4vAUAIe+ux+PGaTPoBV8VPajuVQLn3Ois rx9K+n0A32m2LNQx8DC4z3NBH1rrTRD/8tkq4PJAYVsYqewhML9B+OWSOgVsl7jv2D4U hdS4lwTp0uAI8w35eEst24JtLKTrzUsvnphp3rf0PpVCONb+dgeWSZ8GYdgOX5OWzFAS 6Bdg== X-Gm-Message-State: AC+VfDyGh82V53+rRhiU4d5ZLxVygENNW8BdKpIcqVL98m5f/87fmZI+ ymxy5a578YLH8p5dHmIrk1okQO0aga8pWKOkW9A= X-Google-Smtp-Source: ACHHUZ7UK8af6Znd9yRF4FNpy1/pBcz6dGZfz3EKFABp7uPG/anYgSv2CjB3YIvEfuYMlNAJagf53g== X-Received: by 2002:a9d:7ad5:0:b0:6b8:969f:df31 with SMTP id m21-20020a9d7ad5000000b006b8969fdf31mr8959079otn.9.1688291208760; Sun, 02 Jul 2023 02:46:48 -0700 (PDT) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Ani Sinha , "Michael S . Tsirkin" , Marcel Apfelbaum , Sriram Yagnaraman , Jason Wang , Keith Busch , Klaus Jensen , Akihiko Odaki Subject: [PATCH v2 4/4] pcie: Note a caveat regarding ARI next function number Date: Sun, 2 Jul 2023 18:46:28 +0900 Message-ID: <20230702094631.39111-5-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230702094631.39111-1-akihiko.odaki@daynix.com> References: <20230702094631.39111-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::32b; envelope-from=akihiko.odaki@daynix.com; helo=mail-ot1-x32b.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20221208.gappssmtp.com) X-ZM-MESSAGEID: 1688291291092100003 Content-Type: text/plain; charset="utf-8" Suggested-by: Michael S. Tsirkin Signed-off-by: Akihiko Odaki --- include/hw/pci/pcie.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index 3cc2b15957..16860e2216 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -134,7 +134,14 @@ void pcie_sync_bridge_lnk(PCIDevice *dev); void pcie_acs_init(PCIDevice *dev, uint16_t offset); void pcie_acs_reset(PCIDevice *dev); =20 +/* + * Note: for non-VFs, nextfn must be the Function Number of the next higher + * numbered Function in the Device, or 00h if there are no higher numbered + * Functions. + * TODO: validate this. + */ void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn); + void pcie_dev_ser_num_init(PCIDevice *dev, uint16_t offset, uint64_t ser_n= um); void pcie_ats_init(PCIDevice *dev, uint16_t offset, bool aligned); =20 --=20 2.41.0