From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web11.470.1616439852134798084 for ; Mon, 22 Mar 2021 12:04:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hL49+IqU; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616439851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qOK/wZ84GVgk6nSe3uRB8M5cr+IBJmXYLfcluHgSQjM=; b=hL49+IqUKmEVDGhN0QCUC3q5NhFxGQtz+r37X6XBG9s6+zR6+PBD6pgAadFCfPnVCeknhJ 63ibQHjz3cMal6icN2VUKOWVnWAC938TZ3H9BUmwDmLTS45erJoKtw4ptRdk/XcHbc6izh XKsX5TG1SHXR3f+xGg8HD5fq1WU39+0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-502-Ag1UkgJCM-y90IhyJde1nQ-1; Mon, 22 Mar 2021 15:04:08 -0400 X-MC-Unique: Ag1UkgJCM-y90IhyJde1nQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2F3A388127C; Mon, 22 Mar 2021 19:04:07 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-223.ams2.redhat.com [10.36.115.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 83B3A1972B; Mon, 22 Mar 2021 19:04:06 +0000 (UTC) Subject: Re: [edk2-devel] SR-IOV setup in edk2 To: devel@edk2.groups.io, jon@solid-run.com References: From: "Laszlo Ersek" Message-ID: <986c079a-137f-c3e5-2e85-1aeccf148f8c@redhat.com> Date: Mon, 22 Mar 2021 20:04:05 +0100 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 03/21/21 13:46, Jon Nettleton wrote: > I am looking for some example code, or direction in how SR-IOV > functions are expected to be picked up by the platform pcie host > library so it can setup required bits like LUTs. Currently the > HostLib is getting the gEfiPciIoProtocolGuid event and then setting > the controller up based on the BDF. I see that PciScanBus is > detecting the VF's and calling PciAllocateBusNumber(). > > PCI-IOV ScanBus - SubBusNumber - 0x2 > PciBus: Discovered PPB @ [00|00|00] > > However my setup function is only ever triggered with the real device > BDF's... What do you mean by "setup function"? If you have a UEFI driver that follows the UEFI driver model, i.e. it installs at least one instance of the Driver Binding protocol, then it's up to platform BDS to call ConnectController() on those devices that should be connected per platform policy. > Is it up to me to check for the VFs if SR-IOV is enabled and > set them up manually? Is there another event I should be listening to > that will be triggered for VF's vs PF's? My guess is that platform BDS does not try to connect the PciIo instances that stand for VFs to any drivers. In the UEFI shell, try running dh -d -v -p PciIo Pick a handle ID that appears to stand for a VF, then run connect Thanks Laszlo > > Any pointers would be very helpful. > > -Jon > > > > >