Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3556965rdb; Wed, 13 Sep 2023 16:16:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2bX7Fb8IPXSk2H+qAfAcmb1IgrJd3zvFTpEkdLEFMybAOD1+pDg/It7oR0Fgi6Tsb7P+K X-Received: by 2002:a17:902:9302:b0:1c3:4b24:d89d with SMTP id bc2-20020a170902930200b001c34b24d89dmr3845898plb.40.1694647006814; Wed, 13 Sep 2023 16:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694647006; cv=none; d=google.com; s=arc-20160816; b=FSVv8pNqsWg8NL4+AHUSP/RzbkaVqbk3/a6O54GMcDtr1s8s2Bo6Ms7gLF8YyDL3FW eqEf2zFKBGdyxAe3rRyU4GEyEcU8tSpVSvpfWjAMEKBzjb/qSz021LuVKb9K/8rnZvC4 tv6LIwM2IVICOVbZK3mHBLmihrHQrFSXYwTLaCcvVYxF2M5Htw1LnJNoiQ7dydPUpxBd DHHJP+qr0WYGjiy09nGsAJqWTlhSwDC0/VPwRyyRYKk3y36livZFbeTUr4LycqMRjwWN xxouovxYOwbCaf2hbRT4AjYB7L4mRqy+ux5f6vAdmSNbCqom41CbSSJKoOEqYUeVA4xK 6J1Q== 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:subject:cc:to:from:date :dkim-signature; bh=7PogGVCHPdjunWAB1ZLN/UpXwnYlHki+1H1daV1Zio0=; fh=AR65rCEotzebPuAbLtTxPAQbx9GJhRuZt2B4OeaqT/U=; b=swyr5K1PtqWaxNwZCKgUdBowqx708tYfpxZEqm8PdmE3l3bpre59f9CLn8wwg6Pch3 pkq0r8UGKhZ9f5sMAdGkpeYPQ2Vl73NIpCZTCGtKS/xW/0tKJD807+x6ehkWOSZ3lVtX tbr/vD+gGpBa4dd8pEPBzTw27fQDqz9zHqpq6Ksf7QRO1qqlsJRnsAk+hR1dP2FZnksh HYzEetPtVAh/1+av0Y28sdULHR0M/6pgdJfknRZhB4OEMpnAC7cqBxWQdggjLjCYD6HD TEIdh0qvYFyBY1blAAWkC5HY479WLvDlIrEa5OUmHedu2gZ6xpVPaNMaUkWzGVJAXlN1 PjHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IvEbsH1R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id l10-20020a170902e2ca00b001c1e1fe16bcsi300934plc.252.2023.09.13.16.16.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 16:16:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IvEbsH1R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 1DE41802CE55; Wed, 13 Sep 2023 11:59:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232115AbjIMS7O (ORCPT + 99 others); Wed, 13 Sep 2023 14:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232071AbjIMS7L (ORCPT ); Wed, 13 Sep 2023 14:59:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5AF421999 for ; Wed, 13 Sep 2023 11:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694631500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7PogGVCHPdjunWAB1ZLN/UpXwnYlHki+1H1daV1Zio0=; b=IvEbsH1RrD3QGk/7HPUNrrbsjoQ1ID63+wtfx8rBF2w0hpSibS3Qa8PCIHZDDBLbL6O3YM L+ELo+2QWtiCyNJLYnnne4o12IUYMvK1mZlhMzyrM/siMs4OA5Ze7oAmXxLJ2psIS/slvf iU05ddxGNJhPp3XP8Gvf1ubW/bvsE5A= Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-626-uCWS3XyGOmCafoUPTd-vFA-1; Wed, 13 Sep 2023 14:58:18 -0400 X-MC-Unique: uCWS3XyGOmCafoUPTd-vFA-1 Received: by mail-il1-f198.google.com with SMTP id e9e14a558f8ab-34f9739e7d9so937075ab.3 for ; Wed, 13 Sep 2023 11:58:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694631498; x=1695236298; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7PogGVCHPdjunWAB1ZLN/UpXwnYlHki+1H1daV1Zio0=; b=wUoLijBkA7efpZIJaXZ60OL2fHx0UlBTdXHbyAIq3vBn3/OzLgKjAg2P8MFJVuxsuY ZhXq3mhBRcm5O4UktnKsF4AAEk/lcwfMdDonHEP57/b/g7y2FJbfdJGLNJAJTr9nnjGh h9l0e1JfVcck5K3H5zmy4/BIVnoeIhU3u4wT3IbXrfiTcAfBPYhIPcDdHQTbepKww/Ew S4cQp3mKdTRYU5dvmHzloDrfc9HLO+AuSOe2/5D3kP0Rzg6ruElV9zTXu3A197J/+qQ4 +qbd3aSjOvy9wRDK0buP+L08if4a7586rm99E3IiyZEF6Hwlm4IkEem6cEfeQD4XBNmn p7EQ== X-Gm-Message-State: AOJu0Yyb0Czc8tEyMXzmTjKKhDNStacjUHp4xfBmhYDjSDcTkLC+cpTt WiX8GphoQM4rD+iMWN8Kfk1hcYwSo8iSvw/ZB0kk1MwtbHwaGzbPp7IOCWcrrfzT0pehZuq9TrW GhHJLYECsnr2FznxszY5s/9cA X-Received: by 2002:a05:6e02:1a2b:b0:34f:234d:4b5a with SMTP id g11-20020a056e021a2b00b0034f234d4b5amr3931358ile.29.1694631498159; Wed, 13 Sep 2023 11:58:18 -0700 (PDT) X-Received: by 2002:a05:6e02:1a2b:b0:34f:234d:4b5a with SMTP id g11-20020a056e021a2b00b0034f234d4b5amr3931346ile.29.1694631497907; Wed, 13 Sep 2023 11:58:17 -0700 (PDT) Received: from redhat.com ([38.15.60.12]) by smtp.gmail.com with ESMTPSA id do13-20020a0566384c8d00b0043194542229sm3467615jab.52.2023.09.13.11.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 11:58:17 -0700 (PDT) Date: Wed, 13 Sep 2023 12:58:15 -0600 From: Alex Williamson To: Jason Gunthorpe Cc: "Tian, Kevin" , oushixiong , Yishai Hadas , Shameer Kolothum , Brett Creeley , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] vfio/pds: Using pci_physfn() to fix a compilation issue Message-ID: <20230913125815.3ef654e6.alex.williamson@redhat.com> In-Reply-To: References: <20230911080828.635184-1-oushixiong@kylinos.cn> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.35; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 13 Sep 2023 11:59:16 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 fry.vger.email On Mon, 11 Sep 2023 09:28:02 -0300 Jason Gunthorpe wrote: > On Mon, Sep 11, 2023 at 08:25:18AM +0000, Tian, Kevin wrote: > > > From: oushixiong > > > Sent: Monday, September 11, 2023 4:08 PM > > >=20 > > > From: Shixiong Ou > > >=20 > > > If PCI_ATS isn't set, then pdev->physfn is not defined. > > > it causes a compilation issue: > > >=20 > > > ../drivers/vfio/pci/pds/vfio_dev.c:165:30: error: =E2=80=98struct pci= _dev=E2=80=99 has no > > > member named =E2=80=98physfn=E2=80=99; did you mean =E2=80=98is_physf= n=E2=80=99? > > > 165 | __func__, pci_dev_id(pdev->physfn), pci_id, vf_id, > > > | ^~~~~~ > > >=20 > > > So using pci_physfn() rather than using pdev->physfn directly. > > >=20 > > > Signed-off-by: Shixiong Ou =20 > >=20 > > Reviewed-by: Kevin Tian =20 >=20 > Yes, we should do both patches Sure, but it's sloppy to put both in with the same commit log. Should we change this one to something like: vfio/pds: Use proper PF device access helper The pci_physfn() helper exists to support cases where the physfn field may not be compiled into the pci_dev structure. We've declared this driver dependent on PCI_IOV to avoid this problem, but regardless we should follow the precedent not to access this field directly. Thanks, Alex=20