From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0058.outbound.protection.outlook.com [104.47.42.58]) by dpdk.org (Postfix) with ESMTP id 292D71AEF5 for ; Tue, 19 Sep 2017 15:07:55 +0200 (CEST) Received: from BN6PR03CA0083.namprd03.prod.outlook.com (10.164.122.149) by BN6PR03MB2692.namprd03.prod.outlook.com (10.173.144.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Tue, 19 Sep 2017 13:07:53 +0000 Received: from BL2FFO11FD039.protection.gbl (2a01:111:f400:7c09::156) by BN6PR03CA0083.outlook.office365.com (2603:10b6:405:6f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.11 via Frontend Transport; Tue, 19 Sep 2017 13:07:53 +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 BL2FFO11FD039.mail.protection.outlook.com (10.173.161.135) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.35.14 via Frontend Transport; Tue, 19 Sep 2017 13:07:52 +0000 Received: from [10.232.14.39] ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v8JD7oSn009399; Tue, 19 Sep 2017 06:07:51 -0700 To: Ferruh Yigit CC: , References: <20170823141213.25476-1-shreyansh.jain@nxp.com> <20170909112132.13936-1-shreyansh.jain@nxp.com> <20170909112132.13936-4-shreyansh.jain@nxp.com> <916531df-edb4-d0fe-cb86-32cedb6fc46a@intel.com> From: Shreyansh Jain Message-ID: <690be1c8-67d1-31e0-b1dc-4b270b1f8519@nxp.com> Date: Tue, 19 Sep 2017 18:48:48 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <916531df-edb4-d0fe-cb86-32cedb6fc46a@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131503000731315726; (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)(336005)(376002)(346002)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(3190300001)(339900001)(199003)(377454003)(189002)(24454002)(57704003)(104016004)(316002)(189998001)(65826007)(5660300001)(36756003)(97736004)(356003)(23676002)(58126008)(230700001)(6666003)(54356999)(76176999)(93886005)(50986999)(54906002)(83506001)(305945005)(31686004)(498600001)(81156014)(81166006)(6916009)(2906002)(106466001)(8676002)(229853002)(68736007)(8936002)(33646002)(2950100002)(31696002)(105606002)(85426001)(53936002)(47776003)(8656003)(65956001)(6246003)(77096006)(4326008)(86362001)(65806001)(50466002)(64126003)(53546010)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2692; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD039; 1:RS6xUjSiTsRjOeyv3iImeKc8+o+O8y5X+Ea/oNPq76eMSK7jekShso32sDHT1u3eEHfpBC1S6vncxC7ubrfw8SVzIoOp9zfxgW/hnHxC9dhPmhBljQPEzUUtag+DvAWq X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fe58cbb3-90bc-4926-ee0e-08d4ff5f6ff3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN6PR03MB2692; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2692; 3:rTlO7CPREwhLrPOBPbYYkTDR2Yf9/ICccpSRh6zRuQJbN9SpX6lvQ1rvGSjTMwE9KI8wCc0BHedyOqPrqyxEahgmCCm4NTxZ+JqjMG/AjAjnjkHC+s5WGG72mgZ4HvulBOStYuy/GGMtqj52llwf5UlaTPHrYo81jfcpSxIa7Y5eJ4icv9xdIre2Nx5Fwh+vFSMF7m17x3qS9HoLeh5RJU/HA6e/ArppifioTlJWNFRP1N5GcH/EA0SqspGw+JkMu40PsqOeztqsgL1JwIICtPsw6j44Rg0M9s3sEzrtZISHg6xDy3NTL6vO9SegN0ZQEFzqvpW7oeq9Y3HUYLx1AA6R/r7T4YKNS5RyjuVQn9U=; 25:kau2gclCGtHcDhk5GvcNg/WOJTeeTtWW1/8gA9wYbYbF4zdF3hJ0r9CX7h0rZ6jO/EyOkFnXICAvJ1ItU0x7Zzk1EoGOXk4NdEckSw4fdvdD0SSja+fxeDbUwsokaYYSwiIFH4YsTJS9g98VtBOw3IguMRZBv7q6VmKBWP9JXO4XV71JuZcP5IENALUM8igZaq1Lzzo5PFllH0ingHt4jptcI2CODrcxbeQ45w1EXUZ2+krTJ1FKL9iJkc6fZUbk+zdIqPTs+AiGovFyXttTOCWBr2mp/gS/Qtqx0XK/1gLpYZUb2ajO7U/0elBL7r3BqJhDWOBVgUjyVOo+VEauxQ== X-MS-TrafficTypeDiagnostic: BN6PR03MB2692: X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2692; 31:nW438e2HdpBg56NQYZQZ9rutu2Ept7Ys9RKyYugqzlhVjS8YztZjYFqQ66GeUb43TKceINlMIRZOfg7b17OzHd96FB0k8WROJ3g9Ps8aqrVOt1FI6wD97liPe9ktayhLjLg0Fy3wmJfMgFWxB9TU9TtgUHN1tFb0MVGIWJjuARO5kMG14NL19utjALhT0lRzNZPUMml6RSAzYucYj7UznI7rapdLusX9gy3UMWbMpbE=; 4:jmQMaTQM0br8Q/QnNYaj1LJCmMtAQPyVhhO6gt96iHvI7ktWcvj4vuBd8eAnRuDIkgT5yXxiAPWDIZLmMRUi0lXOi/4dOTqXdz6wVfPjKzWbre0iznmtxXPsrtQy4DukO+ongMf+kBnKEQyX2A7PDNed8NXMfK05+L3Qc9lZ5psyV1x8YGNh5dD+VQMgs/AApkNkBNtxJY7r6S7SS7liU4C7KVT6GZ/Yo/nSwBPHxvv43vR15jLy26l5fjVUAq2pF66sXlXNy4ZNJGhA1MpKPRa2JnCCNit/9SNjy3PmsHE= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123561025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123559100)(20161123556025)(20161123563025)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR03MB2692; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR03MB2692; X-Forefront-PRVS: 04359FAD81 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjAzTUIyNjkyOzIzOkdscGFGU2cvUUYyVUJxb3IraHFCV0Z1M0Yr?= =?utf-8?B?dVJyeDZZT2hwWGZzZUh5TlJBQkVnT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ha5VP7ZxpmLh330= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2017 13:07:52.9599 (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: BN6PR03MB2692 Subject: Re: [dpdk-dev] [PATCH v4 03/41] bus/dpaa: add compatibility and helper macros 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: Tue, 19 Sep 2017 13:07:55 -0000 On Monday 18 September 2017 08:19 PM, Ferruh Yigit wrote: > On 9/9/2017 12:20 PM, Shreyansh Jain wrote: >> From: Hemant Agrawal >> >> Linked list, bit operations and compatibility macros. >> >> Signed-off-by: Geoff Thorpe >> Signed-off-by: Hemant Agrawal > > <...> > >> diff --git a/drivers/bus/dpaa/include/compat.h b/drivers/bus/dpaa/include/compat.h >> new file mode 100644 >> index 0000000..a1fd53e >> --- /dev/null >> +++ b/drivers/bus/dpaa/include/compat.h >> @@ -0,0 +1,389 @@ >> +/*- >> + * This file is provided under a dual BSD/GPLv2 license. When using or >> + * redistributing this file, you may do so under either license. > > The content of the file looks like for Linux, is the file coming from an > existing GPL license? If so, is it allowed to add BSD license to this? > >> + * >> + * BSD LICENSE >> + * >> + * Copyright 2011 Freescale Semiconductor, Inc. >> + * All rights reserved. >> + * >> + * Redistribution and use in source and binary forms, with or without >> + * modification, are permitted provided that the following conditions are met: >> + * * Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer. >> + * * Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in the >> + * documentation and/or other materials provided with the distribution. >> + * * Neither the name of the above-listed copyright holders nor the >> + * names of any contributors may be used to endorse or promote products >> + * derived from this software without specific prior written permission. >> + * >> + * GPL LICENSE SUMMARY >> + * >> + * ALTERNATIVELY, this software may be distributed under the terms of the >> + * GNU General Public License ("GPL") as published by the Free Software >> + * Foundation, either version 2 of that License or (at your option) any >> + * later version. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" >> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE >> + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE >> + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >> + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >> + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >> + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >> + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE >> + * POSSIBILITY OF SUCH DAMAGE. >> + */ > > <...> > >> +#ifdef ARRAY_SIZE >> +#undef ARRAY_SIZE >> +#endif >> +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) > > Can re-use RTE_DIM I can change this. Thanks for highlighting. > > <...> > >> +#define ASSERT(x) do {\ >> + if (!(x)) \ >> + rte_panic("DPAA: x"); \ >> +} while (0) >> +#define DPAA_BUG_ON(x) ASSERT(!(x)) > > Can use RTE_ASSERT I will change this. > > <...> > >> + >> +#ifndef __DPAA_LIST_H >> +#define __DPAA_LIST_H >> + >> +/****************/ >> +/* Linked-lists */ >> +/****************/ > > Do we need to maintain a linked list implementation, why no just use > sys/queue.h ones as done many places in DPDK? > >> + >> +struct list_head { >> + struct list_head *prev; >> + struct list_head *next; >> +}; >> + > > <...> > The underlying DPAA infrastructure code is shared between kernel and userspace. That is why, changing the internal headers (for example, using RTE_* queues) is something I want to avoid until absolutely necessary. The outer layers (drivers/*/dpaa/) are something I am trying to keep as close to possible to DPDK. - Shreyansh