From nobody Tue Apr 30 01:55:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1488362536356506.5793837395896; Wed, 1 Mar 2017 02:02:16 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v219wQjx002383; Wed, 1 Mar 2017 04:58:27 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v219wPT0009090 for ; Wed, 1 Mar 2017 04:58:25 -0500 Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v219wPqA008290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 1 Mar 2017 04:58:25 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C43B42BA1 for ; Wed, 1 Mar 2017 09:58:24 +0000 (UTC) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v219s9wM011054 for ; Wed, 1 Mar 2017 04:58:23 -0500 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 28wv2prcnf-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 01 Mar 2017 04:58:22 -0500 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Mar 2017 19:56:58 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 1 Mar 2017 19:56:56 +1000 Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 6B40B2BB0045 for ; Wed, 1 Mar 2017 20:56:56 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v219umiq43712584 for ; Wed, 1 Mar 2017 20:56:56 +1100 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v219uO3Y031907 for ; Wed, 1 Mar 2017 20:56:24 +1100 Received: from ltc-fire1.aus.stglabs.ibm.com (ltc-fire1.aus.stglabs.ibm.com [9.40.195.135]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v219uNGk031376 for ; Wed, 1 Mar 2017 20:56:23 +1100 From: Shivaprasad G Bhat To: libvir-list@redhat.com Date: Wed, 01 Mar 2017 03:55:58 -0600 User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17030109-0040-0000-0000-000002F667D4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17030109-0041-0000-0000-00000C57A018 Message-Id: <148836210293.71050.613494175723406473.stgit@ltc-fire1.aus.stglabs.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-01_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1703010094 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 202 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 01 Mar 2017 09:58:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 01 Mar 2017 09:58:24 +0000 (UTC) for IP:'148.163.156.1' DOMAIN:'mx0a-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'sbhat@linux.vnet.ibm.com' RCPT:'' X-RedHat-Spam-Score: 0.005 (BAYES_50, KHOP_DYNAMIC, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2) 148.163.156.1 mx0a-001b2d01.pphosted.com 148.163.156.1 mx0a-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] virpci: Enable GEN4 card Link speed (16GT/s) X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This enables GEN4 link speed (16GT/s) property to be fetched properly and t= hus allows the detach/reattach/dumpxml to work. Signed-off-by: Shivaprasad G Bhat --- Verified on Mellanox MT27800 Family ConnectX-5 IB card. # lspci -kvvvs 0001:01:00.4 0001:01:00.4 Infiniband controller: Mellanox Technologies MT27800 Family [C= onnectX-5 Virtual Function] Subsystem: IBM MT28800 Family [ConnectX-5 Virtual Function] Control: I/O- Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Steppi= ng- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast >TAbort- SERR- pci_0001_01_00_4 /sys/devices/pci0001:00/0001:00:00.0/0001:01:00.4 pci_0001_00_00_0 vfio-pci 1 1 0 4 MT27800 Family [ConnectX-5 Virtual Function] Mellanox Technologies
# virsh nodedev-detach pci_0001_01_00_4 error: Failed to detach device pci_0001_01_00_4 error: malformed 'speed' attribute: (null) After Fix: # ./run tools/virsh nodedev-dumpxml pci_0001_01_00_4 pci_0001_01_00_4 /sys/devices/pci0001:00/0001:00:00.0/0001:01:00.4 pci_0001_00_00_0 mlx5_core 1 1 0 4 MT27800 Family [ConnectX-5 Virtual Function] Mellanox Technologies
# ./run tools/virsh nodedev-detach pci_0001_01_00_4 Device pci_0001_01_00_4 detached --- src/util/virpci.c | 4 ++-- src/util/virpci.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/virpci.c b/src/util/virpci.c index 3c1e13b..1e0d903 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -53,7 +53,7 @@ VIR_LOG_INIT("util.pci"); #define PCI_ADDR_LEN 13 /* "XXXX:XX:XX.X" */ =20 VIR_ENUM_IMPL(virPCIELinkSpeed, VIR_PCIE_LINK_SPEED_LAST, - "", "2.5", "5", "8") + "", "2.5", "5", "8", "16") =20 VIR_ENUM_IMPL(virPCIStubDriver, VIR_PCI_STUB_DRIVER_LAST, "none", @@ -147,7 +147,7 @@ struct _virPCIDeviceList { #define PCI_EXP_DEVCAP 0x4 /* Device capabilities */ #define PCI_EXP_DEVCAP_FLR (1<<28) /* Function Level Reset */ #define PCI_EXP_LNKCAP 0xc /* Link Capabilities */ -#define PCI_EXP_LNKCAP_SPEED 0x0000f /* Maximum Link Speed */ +#define PCI_EXP_LNKCAP_SPEED 0x0001f /* Maximum Link Speed */ #define PCI_EXP_LNKCAP_WIDTH 0x003f0 /* Maximum Link Width */ #define PCI_EXP_LNKSTA 0x12 /* Link Status */ #define PCI_EXP_LNKSTA_SPEED 0x000f /* Negotiated Link Speed */ diff --git a/src/util/virpci.h b/src/util/virpci.h index a5e8d00..50e8b3c 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -58,6 +58,7 @@ typedef enum { VIR_PCIE_LINK_SPEED_25, VIR_PCIE_LINK_SPEED_5, VIR_PCIE_LINK_SPEED_8, + VIR_PCIE_LINK_SPEED_16, VIR_PCIE_LINK_SPEED_LAST } virPCIELinkSpeed; =20 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list