From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f174.google.com (mail-pf0-f174.google.com [209.85.192.174]) by dpdk.org (Postfix) with ESMTP id B7C472BF1 for ; Fri, 23 Jun 2017 19:44:54 +0200 (CEST) Received: by mail-pf0-f174.google.com with SMTP id s66so26449220pfs.1 for ; Fri, 23 Jun 2017 10:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3YWm9MXgGUB0B/R/8hAsehzGIhoYhBm3VtL2h/l8Hns=; b=MeMTOrMwFYlen+RPdYat328wCr0EO0KPMOkVhpsRcMQSit8+13PtkdgGwrsxGFWk0k oKOgRskHSiB6YVXCdVt7w+0rEkHzfrflTUgH7OYfb+WOICLikdz3FXDUW+wEsPB9IPIS +B7uYryDHrHIC9fwSVg++2eifrQ0Ob8TdU3BW9hWJcNWdmNxzb0++rpJhfbBOtxnL9z9 8Ct+ko1tvtXoJWXoZt+FmPCqPsKPPYmZZRvD2Zko/U7RQbgQY6lY432SrOw23aaBqTfm hASP1w71lDHaqGoQE1jCfNMztoDfaffgW9VLNHOsejWrvgmDrm0JLbMujyd3H4rXTAwq DyFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3YWm9MXgGUB0B/R/8hAsehzGIhoYhBm3VtL2h/l8Hns=; b=fo020k604colo0Jlq1jZylhy5zzrzzV0DB8kIuO7CNJ8KXusy1K5MpPlUgXE1B4pBf iRZVM4rioj1TqGdmo7O9tNrTtsos55vmOpWU+PdFLskGGD4tWHkdCg/KRyaIlppAujXO swy3Y5eyL4EU3Y/guX7bVdOHgIHo+0Gc7aV8hdghUveKIOvgkibn39dpv3gzob8G8qSL egBQBcutsO6BmCtdjma075nripUyq8/rvPaYptsFgEoTuUtnF5JOE6Awda3IYQZX5oeB 8HfF+sCVQdjSlzPAJcgh2yt47qu+0SdVwzlFNLo4J/1JH62M8wB3p7M4+q3xMPA6mAss 227Q== X-Gm-Message-State: AKS2vOy4VCExIW+ie1RE+NKnIJYkcvW0IZOYZ605U9GROBuayKSE+3nC 2HDZcwilXdEDgB4S X-Received: by 10.99.67.68 with SMTP id q65mr9291677pga.260.1498239893391; Fri, 23 Jun 2017 10:44:53 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id l63sm11274164pfc.132.2017.06.23.10.44.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Jun 2017 10:44:53 -0700 (PDT) Date: Fri, 23 Jun 2017 10:44:51 -0700 From: Stephen Hemminger To: Daniel Verkamp Cc: dev@dpdk.org Message-ID: <20170623104451.41f6877a@xeon-e3> In-Reply-To: <20170623172941.14423-1-daniel.verkamp@intel.com> References: <20170623172941.14423-1-daniel.verkamp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] pci: pad vendor and device ID to 4 digits X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jun 2017 17:44:55 -0000 On Fri, 23 Jun 2017 10:29:41 -0700 Daniel Verkamp wrote: > Some PCI vendor and device IDs have leading zeros. > > Signed-off-by: Daniel Verkamp > --- > lib/librte_eal/common/eal_common_pci.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c > index 78b097e..c23421f 100644 > --- a/lib/librte_eal/common/eal_common_pci.c > +++ b/lib/librte_eal/common/eal_common_pci.c > @@ -203,7 +203,7 @@ rte_pci_probe_one_driver(struct rte_pci_driver *dr, > return 1; > } > > - RTE_LOG(INFO, EAL, " probe driver: %x:%x %s\n", dev->id.vendor_id, > + RTE_LOG(INFO, EAL, " probe driver: %04x:%04x %s\n", dev->id.vendor_id, > dev->id.device_id, dr->driver.name); > > if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) { > @@ -253,7 +253,7 @@ rte_pci_detach_dev(struct rte_pci_device *dev) > loc->domain, loc->bus, loc->devid, > loc->function, dev->device.numa_node); > > - RTE_LOG(DEBUG, EAL, " remove driver: %x:%x %s\n", dev->id.vendor_id, > + RTE_LOG(DEBUG, EAL, " remove driver: %04x:%04x %s\n", dev->id.vendor_id, > dev->id.device_id, dr->driver.name); > > if (dr->remove && (dr->remove(dev) < 0)) > @@ -427,7 +427,7 @@ pci_dump_one_device(FILE *f, struct rte_pci_device *dev) > > fprintf(f, PCI_PRI_FMT, dev->addr.domain, dev->addr.bus, > dev->addr.devid, dev->addr.function); > - fprintf(f, " - vendor:%x device:%x\n", dev->id.vendor_id, > + fprintf(f, " - vendor:%04x device:%04x\n", dev->id.vendor_id, > dev->id.device_id); > > for (i = 0; i != sizeof(dev->mem_resource) / It would be better to use a format consistent with PCI_PRI_FMT, as in: RTE_LOG(DEBUG, EAL, " remove driver: %.4" PRIx16 ":%.4" PRIx16 " %s\n", Maybe introduce PCI_VENDOR_FMT #define PCI_VENDOR_FMT "%.4" PRIx16 ":%.4" PRIx16