Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1573662pxb; Thu, 4 Mar 2021 15:13:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6efCqwME+23YTHoHbyYhRLohHsTO+1MN04L9oJQp3kDshB4haMd3aR3yz8FL2CnDZwgHQ X-Received: by 2002:a17:906:6558:: with SMTP id u24mr6810927ejn.185.1614899638057; Thu, 04 Mar 2021 15:13:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614899638; cv=none; d=google.com; s=arc-20160816; b=KbhkYzjrVXBg250pUunvNc3zlvNidyGECJctV9/qimgjrWVHQjpF7RzQYDoVc9FWr+ V0ylPhMi07euVDnYSnSjDDoYW28ewZljk0Ub/n83N28rp9eOmcZ0368oVDPw8WONTgec Gs6EDxmroDcymET/JPQKgTtKA1WiR0IlIQ/fZKTe0PzQZw9APOWavRSqLpt5ZWJtLIF7 tfLdsdf7hZm0HSXy6UWCG2F3VPgNksjNyULlj9wN7MkqLK18Py1adD/e7yiMUgbV0tie hmjgDwuJinEJ4fHCEa4BwbmF1EkMnWJnksPAD1Not1H6vEtcPxpYZBhomCcnfIjPYOom eXwQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=bEM35y539zYTdo9MMllIZYjN9DigfWFlSWBSMTVulRk=; b=fl9RvW1SHVNf9b4+8rbjp4wRTxz1jJbe32W54rDBWITbwaTX9nvOVaNZiwcdEB5wFI MunLA6L2MsW3tJdm23TEhwZj3RPfTTyzB9SmfZ4oJRU+8L7TPccC++LKSjMW92hZVOV7 yCK/2waKLnJXLOLl87ReMqGvzL5rLTtrldNnfbtcA6Sfok9YdFi/dyAfhFX1PZT7jHTc 5BhhbinAT9oyDJ7ef0tcYKwp1sj10G5Sx3vzGYVQcHfwNTFIbiWdUJpSM18FenRYMg2/ dS1f3iCewOXZng71ZfIBUuNNSoLCounf7FY6MQCCrXrM/ibwr6sA7GIuetQ4wkx7O8cj rc0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=YU5d30Iz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h13si493927edq.173.2021.03.04.15.13.35; Thu, 04 Mar 2021 15:13:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=YU5d30Iz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1446307AbhCCPlp (ORCPT + 99 others); Wed, 3 Mar 2021 10:41:45 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:12234 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357308AbhCCKtW (ORCPT ); Wed, 3 Mar 2021 05:49:22 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1239qSnq016127; Wed, 3 Mar 2021 04:52:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=bEM35y539zYTdo9MMllIZYjN9DigfWFlSWBSMTVulRk=; b=YU5d30IzyI+2zGSUqXZKN3wWlFNPpE3w7f5x4wshBz2zjCPP/crEzFBbZKNFxdtUVSz5 gO0SLa1OBsVvdswq7IfeIly8H+dvvootg6lVTaLgq6c2VEm0fUryu3TzTLo7rkcuj/OQ rCLC26MrFTCRffM49K8qQx4xgmORUQkkPe5zxmWnajH794pMBZRVqqfHUJYzat9kAfdn FYejBDOMqRuMI8TB/TNnkKLo4za/EiXfAPE/7RtPrKC569fPaRdjrJ/33kqEkWGk4x+n z6TNgx2LLAto3fHzly3ZwH0wBuSlmJ089OnYaHgmh5ZNczfPUmp5Vln2ITAkG0QtytBf hg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 37287281c6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Mar 2021 04:52:58 -0500 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1239qf7p017753; Wed, 3 Mar 2021 04:52:58 -0500 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 3728728164-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Mar 2021 04:52:58 -0500 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 1239qJWc028806; Wed, 3 Mar 2021 09:52:53 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma01fra.de.ibm.com with ESMTP id 370atn1ee1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Mar 2021 09:52:53 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1239qa1a37159250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 3 Mar 2021 09:52:36 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B862042045; Wed, 3 Mar 2021 09:52:50 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6668242041; Wed, 3 Mar 2021 09:52:50 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 3 Mar 2021 09:52:50 +0000 (GMT) From: Niklas Schnelle To: Bjorn Helgaas , Narendra K , Greg Kroah-Hartman Cc: Viktor Mihajlovski , Stefan Raspl , Peter Oberparleiter , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: [RFC 0/1] s390/pci: expose a PCI device's UID as its index Date: Wed, 3 Mar 2021 10:52:49 +0100 Message-Id: <20210303095250.1360007-1-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-02_08:2021-03-01,2021-03-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 impostorscore=0 mlxscore=0 bulkscore=0 suspectscore=0 mlxlogscore=897 spamscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103030072 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On s390 each PCI device has a user-defined ID (UID). This ID was designed to serve as the PCI device's primary index and to match the device within Linux to the with the view in the hypervisor configuration. To serve as a primary identifier the UID must be unique within the Linux instance, this is guaranteed by the platform if and only if the UID Uniqueness Checking flag is set within the CLP List PCI Functions response which is also currently used to determine whether the UID is also used as the Domain part of the geographical PCI address of the device. As primary identifier of a PCI device, the UID serves an analogous function as the SMBIOS instance number or ACPI index exposed as the "index" respectively "acpi_index" device attributes. These attributes are used by e.g. systemd/udev to set network interface names. As s390 does not use ACPI nor SMBIOS there is no conflict and we can expose the UID under the "index" attribute whenever UID Uniqueness Checking is active and systemd/udev will then create "eno.." interface names. Note: This is an evolution of an earlier patch I sent for exposing the UID Uniqueness Checking flag directly. Thank you Greg for making me realize that we were looking too much at just exposing platform details instead of looking how existing interfaces could suit our purpose. Thanks, Niklas Schnelle Niklas Schnelle (1): s390/pci: expose a PCI device's UID as its index Documentation/ABI/testing/sysfs-bus-pci | 11 +++++--- arch/s390/pci/pci_sysfs.c | 36 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 4 deletions(-) -- 2.25.1