From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0040.outbound.protection.outlook.com [104.47.38.40]) by dpdk.org (Postfix) with ESMTP id 76129316B for ; Thu, 10 Nov 2016 06:49:41 +0100 (CET) Received: from BN6PR03CA0035.namprd03.prod.outlook.com (10.175.124.21) by MWHPR03MB2751.namprd03.prod.outlook.com (10.168.207.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Thu, 10 Nov 2016 05:49:39 +0000 Received: from BN1AFFO11FD054.protection.gbl (2a01:111:f400:7c10::180) by BN6PR03CA0035.outlook.office365.com (2603:10b6:404:10c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6 via Frontend Transport; Thu, 10 Nov 2016 05:49:38 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; linaro.org; dkim=none (message not signed) header.d=none;linaro.org; 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 BN1AFFO11FD054.mail.protection.outlook.com (10.58.53.69) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.693.6 via Frontend Transport; Thu, 10 Nov 2016 05:49:38 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:1090; 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 uAA5nZ0D028690; Wed, 9 Nov 2016 22:49:36 -0700 To: Jianbo Liu References: <1477581467-12588-1-git-send-email-shreyansh.jain@nxp.com> <1477657598-826-1-git-send-email-shreyansh.jain@nxp.com> <1477657598-826-7-git-send-email-shreyansh.jain@nxp.com> CC: , Thomas Monjalon , Jan Viktorin From: Shreyansh Jain Message-ID: <99387c3b-1815-a10f-a21a-3da9b9d0fc85@nxp.com> Date: Thu, 10 Nov 2016 11:21:55 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-IncomingHeaderCount: 13 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131232305787708360; (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)(1109001)(1110001)(339900001)(189002)(377454003)(199003)(24454002)(8676002)(110136003)(6916009)(2950100002)(86362001)(54356999)(50986999)(76176999)(6666003)(31696002)(85426001)(87936001)(7846002)(586003)(2906002)(23676002)(92566002)(81156014)(50466002)(36756003)(230700001)(81166006)(229853002)(93886004)(4326007)(47776003)(77096005)(65956001)(65806001)(64126003)(68736007)(31686004)(97736004)(5660300001)(4001350100001)(189998001)(8936002)(33646002)(305945005)(83506001)(65826007)(626004)(356003)(106466001)(105606002)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2751; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD054; 1:1fQINctuN/X28X0suMNVzzevOdnHWJ0t7W/j3v68/1tiyn/Z/O+6rVPJsJ8QQqZ9pDq931hm76+56pyUBNwwt31pXn7PX7Nrx7HIeUnHQNzwmGeE26aYtQWNLVXJ1Uxd8walr6JF2Tcf9aDWdpzQhhFdyY6CuqqY+CYk3YANWVLUk02cOEokkn+Fh+DtGXfK4NbU2o6N0kDuERkvpGONVbUlvWdFepiXbXTJ3i2+rlASKvIKlg8YAat5fplLpVd+a7+6bFm64Qg5c68+4KrcL8OmM1+mVOMsqL5bZuq38hWWf0wDckTZGICs5vl918czYkdNsE4wG4sElxPFoRhsASwpLZyZJP+Bm6a+DKBj84UVgRQMcNIW0qBzYKgCJze9zOhTuvIIgDUjcIg6nd7MCBgaZt9pRMkpf3MJ/s8QTwrkwTx3GzLT05Z6wMIDSzCgcfzBxBcmHmdgMx7E9m15DV3P5e4Z9khOsdFqe+xcu6HF1Bk1w2DrGUR/sPSEn1+VVvF312OwxwDar4I0PDWZbesyLfDTz7fLarHrZ4Ey8MLEkyYgSzHyWqTLflbfEijvGbwOrY1960Rw88+oIgoxHv34CWRzldvb/0bDCF8qypc= X-MS-Office365-Filtering-Correlation-Id: ff4de7ae-4950-445e-c26a-08d4092d5bfc X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2751; 2:a02uivqjbho6hjXDzxm658gIJl7943oQb6+C44engh8X/j6jNMZpjMlov2tGHz2L8aXpZpqMOHKVGgrPa1UVnUhjxw7aHnBSXvZIqbMdSUbQlnamxlho8QFIzBzF301+IcaqRAYNGNpVS6mX2ciItTzyOLtEflfeBY8WTm1Bg6rzVVywbhSU5NlCLSbLgwqVZ3oQUwSViMfY9ZDSeHnfVw==; 3:tG6IbEuwI9mUREyq6Xltq7X5TbbblhQyNE3mdjEIE8FL8X1v+1+rpD2RuzWQxSybxeuOPs3DtSDSoQrt7aJRTBxUvqQlzEJs3TAnqdKByLM2axAl4YIwMfesX633bLS99EVvic64QYK/33QGaxMulCDZVT7s+KGyfacGy/nBaOwK6bkpr2INpN14zyJ4Iam43RuW0VuUj4i9WTpSZy9tcwlwAyK7C/YA6+tfUjtnajmv90VMeEPaUCYX43SRTBw5; 25:XUzNAoUaB0+chedsf6kCSLNnG0jHQkUkBp8oBqA1F0YGfXPB2aXsFbBunFLtFkEf+ALgKrx+JodSeII2mbgL3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EJrbIV7Gfc70K8NYIrS0KQ7NlJq0HMefGwtrf/ogxWK4d4EaWaUvKZmVX7JIDwB2ek/ZvseFmGtvzqUGkpCVhCTWwKj8a8e7901tNtSKORQ5W/tLPQqF8Wpbylwy29b1lapSD50LBwh+C90WyFLTJXmHJ/uxTaEH5Fu5B0+CfIpV6oRY7WvO8AAOCCy2WeItTlTE2chqdr9cG1vJXgcyAlOhVQOmI/SnkfbeU/eedOo/GL4i9ZTh2czf+gYIxHrGaTMuVKCn1YPLkGRQtsVTs X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(13024025)(8121501046)(13023025)(13015025)(13017025)(13018025)(3002001)(10201501046)(6055026); SRVR:MWHPR03MB2751; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2751; X-Forefront-PRVS: 01221E3973 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjAzTUIyNzUxOzIzOm9wMzN3aEFUaWJ4TDBiQk1IQzZ0UzZFUDhT?= =?utf-8?B?d2xiSFh2SG9Tc3NNaDQ3WTE0OVlaVHJhTzV3QllhK0VSaFJUZmZHdjgwaUNZ?= =?utf-8?B?bUJxSEZXWnhXYkd1WThoYzZCbWgxbkpYS0VlQnJPRHdYcDN6Sm80anBOUkZr?= =?utf-8?B?cjQ4d041VVk4Q1grRVptQ3NlbWh4Uzcyb0VtYUxXYkpxazBqbGFuTHJJZEFF?= =?utf-8?B?cUtpQk9qZlVjTUJzeUZEQXYxVlBlVmZrZzR2NERNa0tETEJud3ZoaHdOVkZY?= =?utf-8?B?THZ3eUh4OWk1UGJ4bjd0TkJSekwvZzVkK1BPMXdNS0NjSzVja2F4T0piREdM?= =?utf-8?B?VFhsZDlsWFo2T1RwVmNjL1NLYmhyTVdtaU0xeHFtSmNOTjRiZlNyS1p3RWpq?= =?utf-8?B?Ty9jeH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Zxv9wG8eE7Vr5; 24:U6GdDTVy5hcItQOEfBDYaGwgUi0BY83AnDXgTvPMjmFLftwkClsejFdkplq6FedX/QhGMKcaPE+T/toik7sK/zdSfGeI8PxcdoZ4ev2gEu8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2751; 7:3NHyW/nQyjkN1mStJTSwdBjUt2ZlRKSEt5MCsBzEp8cvs5jhW0fKfr1TYicU/aTkTwtRAP+0UVqpFdYCc/FG3HXV05RFYOqbh0cUNUqNLw1rgA8nA/E4feGhOR95Vm/+f0TpfhxmtyMkq2eMoD5AWzhrL841kymeJt6Zp/FxaaFLjnMyU3qcTNJQDX/J1CYN2y/iy9GguCiFzSUUSFSjRjcWeRiRQ+KGYaRdq5gtwDI5R6xzOTVgJLU36YZ+ugp0/S8Sf6wrhkh6/c/3yunlRAmd5LyXMbQZl9K8fiM5OBhAChQ7dAZNoC4SIg07FOFcZACoTp4++17lsBb0MJ8L6E0oGuZc36rJ/WgtqkihfNY= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2016 05:49:38.5368 (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: MWHPR03MB2751 Subject: Re: [dpdk-dev] [PATCH v7 06/21] eal/soc: introduce very essential SoC infra definitions 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: Thu, 10 Nov 2016 05:49:42 -0000 On Thursday 10 November 2016 09:39 AM, Jianbo Liu wrote: > On 28 October 2016 at 20:26, Shreyansh Jain wrote: >> From: Jan Viktorin >> >> Define initial structures and functions for the SoC infrastructure. >> This patch supports only a very minimal functions for now. >> More features will be added in the following commits. >> >> Includes rte_device/rte_driver inheritance of >> rte_soc_device/rte_soc_driver. >> >> Signed-off-by: Jan Viktorin >> Signed-off-by: Shreyansh Jain >> Signed-off-by: Hemant Agrawal >> --- >> app/test/Makefile | 1 + >> app/test/test_soc.c | 90 +++++++++++++++++++++ >> lib/librte_eal/common/Makefile | 2 +- >> lib/librte_eal/common/eal_private.h | 4 + >> lib/librte_eal/common/include/rte_soc.h | 138 ++++++++++++++++++++++++++++++++ >> 5 files changed, 234 insertions(+), 1 deletion(-) >> create mode 100644 app/test/test_soc.c >> create mode 100644 lib/librte_eal/common/include/rte_soc.h >> > .... > > >> +/** >> + * Utility function to write a SoC device name, this device name can later be >> + * used to retrieve the corresponding rte_soc_addr using above functions. >> + * >> + * @param addr >> + * The SoC address >> + * @param output >> + * The output buffer string >> + * @param size >> + * The output buffer size >> + * @return >> + * 0 on success, negative on error. >> + */ >> +static inline void >> +rte_eal_soc_device_name(const struct rte_soc_addr *addr, >> + char *output, size_t size) >> +{ >> + int ret; >> + >> + RTE_VERIFY(addr != NULL); >> + RTE_VERIFY(size >= strlen(addr->name)); > > Is it better to use (size > strlen(addr->name)? Yes, I missed the '\0' in this. I will fix this. > >> + ret = snprintf(output, size, "%s", addr->name); >> + RTE_VERIFY(ret >= 0); >> +} >> + >> +static inline int >> +rte_eal_compare_soc_addr(const struct rte_soc_addr *a0, >> + const struct rte_soc_addr *a1) >> +{ >> + if (a0 == NULL || a1 == NULL) >> + return -1; >> + >> + RTE_VERIFY(a0->name != NULL); >> + RTE_VERIFY(a1->name != NULL); >> + >> + return strcmp(a0->name, a1->name); >> +} >> + >> +#endif >> -- >> 2.7.4 >> > -- - Shreyansh