From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) by dpdk.org (Postfix) with ESMTP id 5B5FC4BE1 for ; Thu, 22 Jun 2017 18:23:49 +0200 (CEST) Received: by mail-pf0-f179.google.com with SMTP id e7so10923213pfk.0 for ; Thu, 22 Jun 2017 09:23:49 -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=vLBnrepitOtDYultsNVQw5OHYJe/3mbXlOxD0XLp1yU=; b=nmtUUFFcmyiJvaZaeSAtTKtDBgx8WDGFl9oZbxMUAZbq0b/sh4SAFNdK3I8I53BzDq HNcthwGrQs3SyLYK+bp4hLghCmJHIQOa+0pJeOFWnyWbdt/8MhTr6hOzukuAyT6s8ugh Bro6qHN8+R6I5dBvCnWQjpThji7zmTB5ijJRmAiA4Kuuji69y/wixIu+Kfens3XyUE6W Ju7ofcwQZKkcJngyuxcqSiq5IHFkzDEK3HZDUI5cvRRdNUcRA+8g5699p/oF+DGXia+N +r6sJp5r7YfhofYV/4wwXizA8Fs/r1EJDHeOTXMie8/cnUU3tU+9XzBryUthCua/Q2Ad 84sA== 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=vLBnrepitOtDYultsNVQw5OHYJe/3mbXlOxD0XLp1yU=; b=pEcm3JTwLyGin1wAJAQLhb3EcW5+etJ4YuQq+4/jswrMWHkDz6wK04c7yGE1I1UTa6 Iuxc8r9bnTXNpAxM6tAHCpR6xUDvCUicRS380mpeBKr9AO13LJJYXfOmMgyrn3xYZe5g dMEO7tmdD46omQAXXv9XRkGWe2mxEw9RLZlTE/4fznExW1ygYB62sdHN5cBnyKpIqRmX L1l8vpIFu/IVhw5qughP0S3tmf3k8A4mo0PcCA/U0wCJxi9Cj8h2Yf4ca81bpmeM4BLL EmMwF0jtEVPD5HxKOGU07yjnF17Q9gOYMeX/NwWHNDt5A+3LuCO08xlOxTzf19WVOIS1 m28w== X-Gm-Message-State: AKS2vOy7ZNWhLjs8EcovKOOR00hJzPqudfJKrT/tgOSjf+sJxsdum/q9 Ojy+utjF0Gc+GAG6 X-Received: by 10.84.231.134 with SMTP id g6mr3853296plk.86.1498148628652; Thu, 22 Jun 2017 09:23:48 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id n71sm4778774pfi.95.2017.06.22.09.23.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Jun 2017 09:23:48 -0700 (PDT) Date: Thu, 22 Jun 2017 09:23:41 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: dev@dpdk.org, Stephen Hemminger Message-ID: <20170622092341.7e1544c2@xeon-e3> In-Reply-To: <3793478.bOXkPGkn7S@xps> References: <20170622155641.25916-1-stephen@networkplumber.org> <20170622155641.25916-3-stephen@networkplumber.org> <3793478.bOXkPGkn7S@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 2/3] eal: PCI domain should be 32 bits 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: Thu, 22 Jun 2017 16:23:50 -0000 On Thu, 22 Jun 2017 18:05:42 +0200 Thomas Monjalon wrote: > 22/06/2017 17:56, Stephen Hemminger: > > In some environments, the PCI domain can be larger than 16 bits. > > For example, a PCI device passed through in Azure gets a synthetic domain > > id which is internally generated based on GUID. The PCI standard does > > not restrict domain to be 16 bits. > > > > This change breaks ABI for API's that expose PCI address structure. > > > > Signed-off-by: Stephen Hemminger > > --- > [...] > > --- a/lib/librte_eal/common/include/rte_pci.h > > +++ b/lib/librte_eal/common/include/rte_pci.h > > @@ -63,7 +63,7 @@ const char *pci_get_sysfs_path(void); > > > > /** Formatting string for PCI device identifier: Ex: 0000:00:01.0 */ > > #define PCI_PRI_FMT "%.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 > > -#define PCI_PRI_STR_SIZE sizeof("XXXX:XX:XX.X") > > +#define PCI_PRI_STR_SIZE sizeof("XXXXXXXX:XX:XX.X") > > I think you need to change PCI_PRI_FMT accordingly. No. I don't want all outputs to have extra leading zeros on other platforms The existing format works: Example: --- cut here --- struct rte_pci_addr { uint32_t domain; /**< Device domain */ uint8_t bus; /**< Device bus */ uint8_t devid; /**< Device ID */ uint8_t function; /**< Device function. */ }; #define PCI_PRI_FMT "%.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 int main(void) { struct rte_pci_addr pci_addr = { 0, 5, 0, 0 }; printf(PCI_PRI_FMT "\n", pci_addr.domain, pci_addr.bus, pci_addr.devid, pci_addr.function); pci_addr.domain = 0xdeadbeef; printf(PCI_PRI_FMT "\n", pci_addr.domain, pci_addr.bus, pci_addr.devid, pci_addr.function); return 0; } --- output --- 0000:05:00.0 deadbeef:05:00.0