From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0088.outbound.protection.outlook.com [104.47.41.88]) by dpdk.org (Postfix) with ESMTP id E7982558B for ; Fri, 25 Nov 2016 11:30:58 +0100 (CET) Received: from BLUPR0301CA0037.namprd03.prod.outlook.com (10.162.113.175) by BY2PR0301MB0741.namprd03.prod.outlook.com (10.160.63.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13; Fri, 25 Nov 2016 10:30:56 +0000 Received: from BY2FFO11FD048.protection.gbl (2a01:111:f400:7c0c::124) by BLUPR0301CA0037.outlook.office365.com (2a01:111:e400:5259::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.734.8 via Frontend Transport; Fri, 25 Nov 2016 10:30:56 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD048.mail.protection.outlook.com (10.1.15.176) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.734.4 via Frontend Transport; Fri, 25 Nov 2016 10:30:55 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:946; Count:13 Received: from [10.232.14.87] ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uAPAUrhU028129; Fri, 25 Nov 2016 03:30:53 -0700 To: Ben Walker References: <1479929804-19614-1-git-send-email-benjamin.walker@intel.com> <1479931644-78960-1-git-send-email-benjamin.walker@intel.com> <1479931644-78960-3-git-send-email-benjamin.walker@intel.com> CC: From: Shreyansh Jain Message-ID: Date: Fri, 25 Nov 2016 16:03:46 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <1479931644-78960-3-git-send-email-benjamin.walker@intel.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IncomingHeaderCount: 13 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131245434558233998; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(336004)(339900001)(3190300001)(189002)(24454002)(199003)(377454003)(4001350100001)(97736004)(23746002)(92566002)(305945005)(106466001)(105606002)(33646002)(110136003)(65826007)(6666003)(6916009)(2950100002)(85426001)(64126003)(2906002)(50466002)(39450400002)(83506001)(4326007)(5660300001)(77096005)(626004)(38730400001)(189998001)(31696002)(104016004)(39380400001)(229853002)(39400400001)(54356999)(50986999)(36756003)(230700001)(76176999)(39410400001)(8936002)(65956001)(65806001)(81156014)(356003)(8676002)(7846002)(68736007)(47776003)(81166006)(31686004)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0741; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD048; 1:ZJgJA7qClWf7qDMSn05Y+8cA4a68c9/xmpaQPu0enVF0+4bE41C9Ylx8tHFCh38tf5fRicNigH9T46K/rRb8mvqGnhM1o4hPcUduy7Esm4rxQZ7oEBIx14m9e6Sygs5ZOSnZs2zvUVwnyB65AFVoEkOzPyG6aQrn0q9HDXuObZSvrVQ98R8JE8FQuEtw9FWUjY+5fO0KM+vJjDkFKL+ix21ElzxFTK5j/bI4Lv9EqjQgc4z8n7hH3NC5ch0p2Q4NYWEMzs0oKS0XK0Abk5TGamkzY/whr4sBf53BHlczKNdlUq++efriTHbp9eBJhtSlK+vpq4t4uWM3jfj1aDF4XD1dOKIqZV5o2Pjwpkopf9KvDYKb9dIMeo145sKPTYf7KD9BO3J/yGTrkqP8jus3h9SjudouUG0Tcs6eORM3lZMGwoxkhJ+HOhFp+9CWBLCvOuD24FtbdXusVMGa+8IVeSO9kE2gudnqcjCPvPTTN+sVIUS238Bdj50J/43Y/cCBFeIF88yLeIbIefV549dnvO1rwK1We7bXAkM1GzHSSXLTqH/ovKyMxcXGW1p8e56slI2va3CvCCqALsfZOyB5fxLiVn/eyAnbVCm2fzQEoM+h7xqhJo0Ze8YJv+N7tu+iHfGFzgFlL+RgUTyGc/B8121MNvGdKR8OWHc42JGQVxo= X-MS-Office365-Filtering-Correlation-Id: e9cdc9f8-b588-435c-329e-08d4151e23a0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR0301MB0741; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0741; 3:JBoruiTkV3lb1sSfk9UXBzBYGFPYa9yOAMDHc1yjEpk5n4VZSReZ3d/LRGTGWAGHdh2DmsTUAUa89jowbAJCPCCRUs/zcGm6JKx/dI+GXvX2ARiWOIQ+6C7rRzTwR08ZkkrgF+g1qXefGgT5zCzF9q75GH0TetWwGoJSqNE//S+y1IXZBNZcCqOxqJfrrpnsC+EVOc9JxQKXDxt3AdlR6h3V5rhtQ5Kcrrsxu5EI57X64GwiYl/kxHegfXwwfOUKPVkk1QJleJMDhUf9xFUjkZ8uIrC12eVtMOv0bQ5clc3uFnPOFaoLDrlBFcVBocetVbnrN0gYlONlAW7O8tlRSO5UXEuTJxKB6hR4Ba08pGsP5Zo840lQS/qlHCyE3Nv6 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0741;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uNnzwcpNtdb3kYsZDYPJ8x7tlpYTw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13023025)(13017025)(13015025)(13024025)(13018025)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6096035)(20161123556025)(20161123559025)(20161123561025)(20161123565025)(20161123563025); SRVR:BY2PR0301MB0741; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0741; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0741; 4:RTNIp4XXW9k840hKowwyUajvDlIbq+EneX3OBDqz27mb4R+HXZDkdRiU6UW/ODCfHdy2d3FvevTMk+vi9DWPFapJALXeDcIMSm22R6fekNpkcSQKnAuJJVdj9n+sO8UKFxEvoNMwTpdNkxWKgcz+ttarbP5ep19Z/WbDfqXBI4O+uAZF3TpPrOVSTCavc0yJPz1mA6NPBfUih3nxFLX/aF1oaHshtmGvrSHmzPzr+JlI/6Jb6b6RMxnWr8NzJrzr0W8WlGHgq10SgAWiP36PJV2ykG7a2oDwMCc8QHYle0WK0ziyJ3r7qb8rLpdr8y80zf19CzC4B1Mnk33ptwm//P0uOjwRV5JBkwGWfRI8tRKgsHTM2YinEPQ5fjUrXxMFo2Nx8pHiQZwf3Cfr7vN3xC560k3+DQMf3IE00L+24rR1VpF4OpFj5bIzCr99kZlowPXPYIoMfGhZTNzo4n1E/Gcq/EX1R8Fdx57ke15BCPAqbi1GeqECzn48G/zZQZ7jcmZ06b1WR84yLDKOTicLzRYEmulLJyaLg5swTJa6uCmpRd0CJXm9jw9vi5b5PEuvmI+BsawHXdXCHJts9ScpcZwB1j1bcNXH9tt/ogJztcpPHey/+/VGXZaBXNmzLEuZ43v5Dgt2FpoWj3PbwZTBE8BTvN6g4DgRRFWkcsZJaNDw5dqg8ciX14ya38b6DC76kvLEYX4QR6DHP0Cb2q+ykcOExyN8lmLRT+27BCekzmGpTpFqAzrYAlzfgxdEhKdF7rqatgyfF4FbuGb0fZfH9Q== X-Forefront-PRVS: 01371B902F X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BY2PR0301MB0741; 23:VoucoHb9wTmniHepLO2hdjq+1ChCKrEBrLr?= =?Windows-1252?Q?fmdHPvm5LFM8OlKm6d1TAafg1YgSL8tsRd3K2Evy8AZZg0KC0ZlDinFq?= =?Windows-1252?Q?nc6yhkXv73yrBjrABJdnGPRKIk0QHTuth1n2IvPj+/Aue0MT0ja1byRb?= =?Windows-1252?Q?3/75jC0NFjNMhpwJx7Kcn4Oj57pspiEidwnmHbLyC8aCPrwHwv92D855?= =?Windows-1252?Q?2QRuZPTSBX8NBIVyIzvAy8H/0iVd6Ic+luqYVw19IAJmxYbP15hk/N/h?= =?Windows-1252?Q?YzimTr4tAAZfr+RUhUFbBeHU8p4A47kHRSmyFvA+cGBwu/EMVtP79i0W?= =?Windows-1252?Q?7juC0w+zyjuNpkdfcdg2NmreNoMvQCM7xVWhHTNjh1M7VD9lUm5Eq/Su?= =?Windows-1252?Q?F6s1pF7AYB3895mfY472G7oc9LcMfJP343ydF2LqYSY8IJF8Yl0NJMms?= =?Windows-1252?Q?OaG3Q53sMcMRSri4/v7h40JsQZfisaIopTX773MujNfuDoUG5tEfjT5L?= =?Windows-1252?Q?ETxPbVKFHvIe/z5ZtSnKcT8lOvGfhRmyemIF6qx80L2uzBf5BzVfD70N?= =?Windows-1252?Q?3a7+Oh4YjgFmTS5AAkDchhWezLIqfLX5egNqt9RY+GCpIgt3KVTt3L0e?= =?Windows-1252?Q?1hE32qpUwO1KYsVKphHinb3pGjo/Fgx9y21qbWj/a+uESym3Lj+P1PGP?= =?Windows-1252?Q?Bc9t/ANSE+dasyTgcw0vW4J3qug5qG0t/ZC2ztIGxagVZE9I0Xj1e/nm?= =?Windows-1252?Q?JrpOiUd42vDmefP6jpvuD/r9vQf2PeQtdQdMW42ZUh/QheP7NS1Epr8h?= =?Windows-1252?Q?rXOYDNd5MGfFrNyvvdWfORtqvimIpKDJ/49Z+MOsol+WWDyMJO+9EGG6?= =?Windows-1252?Q?LLHz58GQomLJxzkjscW9HlaJx8NPIb5hT4g/UrGi5OU6u5jqgYAm8/g7?= =?Windows-1252?Q?L3OakJAxvmsULIroRI1PGj9l0y6OoFwaediz4Q16kM5NQOTfqLbPaZAH?= =?Windows-1252?Q?fllqhG/NmXNgZ0mN+kqQZTipk4uX5patLQZw92gOjmLduO3nqWNqIuLG?= =?Windows-1252?Q?sUg/EBtrKdMZ4obGBZok9KfFYFa/wWykS6LsR+1dtm6AW+M0GYLARP+Y?= =?Windows-1252?Q?fNAo3eEKsm4HTO9oNaZep5x6Id8BwkKL6MgQEGQuh/EoTOkh/bxrOCq4?= =?Windows-1252?Q?5uVYbfnE8rRq8X1YBoi9TeutYJuG0c+UbVyUydgbx7KB1EVh2BCwvX0s?= =?Windows-1252?Q?/mNpQBC3teK/l7ZKIxQuw2HzTFugJyhL0LIwOTV93pJPHi/3g/ARgXAP?= =?Windows-1252?Q?l4cmMOOxyRDgtj5CMv1M0cxcgnaovIAi9C4h7AMiPj26Rr9RWXGvSUA+?= =?Windows-1252?Q?pUcAm7WAkvR03XCcGr7ew23EMv1hNGthPtTgW2RYsI7qDDZZyxWjs7SX?= =?Windows-1252?Q?L8joH4ULI7ZkCV4in4h/hrq2SOe5ZaK5ysB/7gLcDfM+qjvPiuegEJIb?= =?Windows-1252?Q?/7fSBc6W4DYcNVxSJscTtn6CT3PXwpmUsSN/ZD1Fwk+hOQnoYcXVdUNz?= =?Windows-1252?Q?fMnFR/4nRzYTKCgM=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0741; 6:CVTTeDnGZIN5KjgbmijBttb+3STD9E8JcVdEdLhh4+Wfcr0YH905RJzbz9twhZ1/i1nxgWhL91Xyu8d1o+WmbhmtILJ3hfug2v8N4SbVwkb45vJJoy8cD+kmlpDfy5QHxYnhCT9NxjvJFgD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z4ZDZkmz689di6uTkKlzDCT4EhPr/oOhbVddGzjDvfB7c8M5dP/NEaz1tc7o4k3C+3GPy7SGY0AQY7T+cs27XipADU+otw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2016 10:30:55.5114 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0741 Subject: Re: [dpdk-dev] [PATCH v2 3/7] pci: Pass rte_pci_addr to functions instead of separate args X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2016 10:30:59 -0000 On Thursday 24 November 2016 01:37 AM, Ben Walker wrote: > Instead of passing domain, bus, devid, func, just pass > an rte_pci_addr. > > Signed-off-by: Ben Walker > --- > lib/librte_eal/linuxapp/eal/eal_pci.c | 32 +++++++++++++------------------- > 1 file changed, 13 insertions(+), 19 deletions(-) > > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c > index 876ba38..073af5f 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c > @@ -267,8 +267,7 @@ pci_parse_sysfs_resource(const char *filename, struct rte_pci_device *dev) > > /* Scan one pci sysfs entry, and fill the devices list from it. */ > static int > -pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, > - uint8_t devid, uint8_t function) > +pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) > { > char filename[PATH_MAX]; > unsigned long tmp; > @@ -281,10 +280,7 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus, > return -1; > > memset(dev, 0, sizeof(*dev)); > - dev->addr.domain = domain; > - dev->addr.bus = bus; > - dev->addr.devid = devid; > - dev->addr.function = function; > + dev->addr = *addr; > > /* get vendor id */ > snprintf(filename, sizeof(filename), "%s/vendor", dirname); > @@ -429,16 +425,14 @@ pci_update_device(const struct rte_pci_addr *addr) > pci_get_sysfs_path(), addr->domain, addr->bus, addr->devid, > addr->function); > > - return pci_scan_one(filename, addr->domain, addr->bus, addr->devid, > - addr->function); > + return pci_scan_one(filename, addr); > } > > /* > * split up a pci address into its constituent parts. > */ > static int > -parse_pci_addr_format(const char *buf, int bufsize, uint16_t *domain, > - uint8_t *bus, uint8_t *devid, uint8_t *function) > +parse_pci_addr_format(const char *buf, int bufsize, struct rte_pci_addr *addr) > { > /* first split on ':' */ > union splitaddr { > @@ -466,10 +460,10 @@ parse_pci_addr_format(const char *buf, int bufsize, uint16_t *domain, > > /* now convert to int values */ > errno = 0; > - *domain = (uint16_t)strtoul(splitaddr.domain, NULL, 16); > - *bus = (uint8_t)strtoul(splitaddr.bus, NULL, 16); > - *devid = (uint8_t)strtoul(splitaddr.devid, NULL, 16); > - *function = (uint8_t)strtoul(splitaddr.function, NULL, 10); > + addr->domain = (uint16_t)strtoul(splitaddr.domain, NULL, 16); > + addr->bus = (uint8_t)strtoul(splitaddr.bus, NULL, 16); > + addr->devid = (uint8_t)strtoul(splitaddr.devid, NULL, 16); > + addr->function = (uint8_t)strtoul(splitaddr.function, NULL, 10); > if (errno != 0) > goto error; > > @@ -490,8 +484,7 @@ rte_eal_pci_scan(void) > struct dirent *e; > DIR *dir; > char dirname[PATH_MAX]; > - uint16_t domain; > - uint8_t bus, devid, function; > + struct rte_pci_addr addr; > > dir = opendir(pci_get_sysfs_path()); > if (dir == NULL) { > @@ -500,20 +493,21 @@ rte_eal_pci_scan(void) > return -1; > } > > + Unnecessary new line. > while ((e = readdir(dir)) != NULL) { > if (e->d_name[0] == '.') > continue; > > - if (parse_pci_addr_format(e->d_name, sizeof(e->d_name), &domain, > - &bus, &devid, &function) != 0) > + if (parse_pci_addr_format(e->d_name, sizeof(e->d_name), &addr) != 0) > continue; > > snprintf(dirname, sizeof(dirname), "%s/%s", > pci_get_sysfs_path(), e->d_name); > - if (pci_scan_one(dirname, domain, bus, devid, function) < 0) > + if (pci_scan_one(dirname, &addr) < 0) > goto error; > } > closedir(dir); > + > return 0; > > error: > This is much more cleaner than passing all the BDF entries. Except the above unnecessary new line: Acked-by: Shreyansh Jain