From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0056.outbound.protection.outlook.com [104.47.42.56]) by dpdk.org (Postfix) with ESMTP id 88604530F for ; Fri, 16 Sep 2016 06:30:53 +0200 (CEST) Received: from BLUPR0301CA0011.namprd03.prod.outlook.com (10.162.113.149) by CY4PR03MB2440.namprd03.prod.outlook.com (10.168.163.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.619.10; Fri, 16 Sep 2016 04:30:52 +0000 Received: from BL2FFO11FD021.protection.gbl (2a01:111:f400:7c09::105) by BLUPR0301CA0011.outlook.office365.com (2a01:111:e400:5259::21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.629.8 via Frontend Transport; Fri, 16 Sep 2016 04:30:51 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; 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 BL2FFO11FD021.mail.protection.outlook.com (10.173.161.100) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.619.6 via Frontend Transport; Fri, 16 Sep 2016 04:30:51 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u8G4Trfh029256; Thu, 15 Sep 2016 21:30:48 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Fri, 16 Sep 2016 09:59:36 +0530 Message-ID: <1474000200-16705-2-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131184738516056991; (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)(199003)(189002)(2351001)(189998001)(305945005)(229853001)(105606002)(106466001)(626004)(97736004)(33646002)(77096005)(76176999)(4326007)(2906002)(50986999)(92566002)(104016004)(2950100001)(47776003)(86362001)(5003940100001)(586003)(356003)(11100500001)(8666005)(7846002)(68736007)(36756003)(8676002)(85426001)(50226002)(50466002)(8936002)(48376002)(110136003)(81156014)(19580405001)(81166006)(87936001)(5660300001)(19580395003)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2440; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD021; 1:zxxqh2++7ZaZ4DAda/Ubz9z8ATZGHR0zZ4lciza1F8koRcFKiDAWcTDTlH6iyufwpzzeUDPRPzyhDs0a5+BJY3Wa54Zsuv0NvmyzgUI/ZhiFt3cktHMoDt3qPapHboOvtsfLcC1V9J1XT2isI3xT+j88tjUyJyhjPdZkqFkYsZEtWdtATXzzkiTLbHr6YIFNgyAbrDG2Ys9YjqpudeJSGdLyXHE2UjWISTTxEe/8ApNz3ciE0fbiobvv/Bgdf8wqA3Jv8azmxe9822SHtd8Ylq0WmRrHlgiovmdkALdbrSUJL1of01vlbpKBl9QVbZ7ctu6IFWCiEBQXOMjjA7sE+Zv1vgtSS4ECeW3hv+wUBzdGTNtLFdqGYFpWPC6MA62oqelSGVU7Zx/483YtWabDqxYOi+O6jRcU4F+lG4J/+sQU4CUlP+pPxQaJ1ZBD545qtPzazOXeH8HP5tBCXp0qbyGKWdxy/T8a4IsUnvZzXo6lZXVXfuiNlqjsJk4qwAXKvO+TNGK5oam0EGeSFGjS0lgqbw2m02K/Tp292U+5j1MhmhRTQbWRQbFqK20P6qSM1oahEMATQYU6THNeqhv+5u/1LQTA+NBswh0w1PiwjBarkydXIhRTIcm3400T6r97hjALhc7ecxpgfbl2JdQ2WZITBaGCTCLGJNaMbCTgt5oFyAxtk8ruS1OEeeBPueRX+tq0FDuC1HokDV4PjE1DgUBqSayOZ+1oZAAiiGd9HhY= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 2cbc709a-fbf5-45b8-bb9f-08d3ddea3daa X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2440; 2:RzZlcLeSDefGPkUugbBzadkeKKB9itfV7wSbRDgha8snWWC34Nkn1lxxGpVZQhqBbwAFRjyMjgvNCWw3OgpQeAr55sjOwHarw7jODTNieX8hOXnlGEJlMkKCtnLO+1mE46yPPkuQaM/89kVtPMryQsv33vV2mUTg7RSqhxAqbSrK9YTuAQ/Ex9nsJ/Imlr7f; 3:+VLHrvRmhtb5O//Uyja13UodV6Sz+80hX0ndOuDN0S0DuphYg7DD+hUtRWtoADITaGqdC9MfocH6Q1cQ76QcCm6BlT+5Kn9OZll/kGFVpxRUaJkKxLlO1GqiymkyPBkQN8BKUcYKAkiLL6iYtMB9Wq2JZZg00tIFXyAsA8hBRmgoGFqt6Fr7/xwZbHDjYD6MHmdqJjwo3izW0H3QUfmCMx+0cHUeqR8PfPCvC+ny4Yg= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR03MB2440; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2440; 25:ks7Tse2dNEb9QzYPFAWPlpAMsppZr6Mw3cOa4Vcn1F/EFZnJ8mCEuPswiMCf9YYLKzdLXIxOTWKuiSEFqeEsa6n6QCggx7JJ5S4m5ItOuG2OhOyNPLDnvwOAcbItQwk6ZJpvNG7L60FDIu0GhlGI/TjgrUGFKb2y1B5k7PUNlT7twcdw9SrvDzRdVxeTSi6sPqRfzAjWSvkSUuEbySpm2cvV6lYY1Q5DvbUHD6VAr+KNQ4OzAtTES2vAH0lacQ88k7VTvhefhggJUZ5n+i0iLboDxvnWoDpR//6LYyzb21WO/8IvU63OTK2kGMAENU4ipc42cPWvvqJ10PEVv+PtVyo0C685XJ70z2Lpzw26jowLwOqBzLbBhi0vJhSD8yqACzBv+pzJ4GfcNpyescGIJBpxSYZlYmwI8mmDCCt+hBpLS1NNHcUOIJ2915DsYxGmfebd0Y8gb9dtv97G/a6uzlXr/s/iKkZMRJwGzpdqkr33FH0AwpUdmbmqTlpecYUopS6pIgRK/1PS12qmBaYCTDabCTiPiFxvNh1f9j4il/ttLFK5cJKwCME4T+LTBQaGb6qNjAt4kJ1DjT1elA12dG9jAZs7au+q7KdT3ROralM0omCij8UwRFqk3LNKPvuIXEK6n1ZNX+Wgw0Pq3utJLGggtxhvbuvPuQ51Hs9wvMwq8sC6IwVT6FhfLLhXEtZMwJHXvbwkQGiLtLwQyR4zhg==; 31:bQ/Jwe3Q4owXzn8QCDnMqCYo3I19DMEaloNKSxg6zG1N5jFYO3GjujpzbAROKiDQdMJuyosm+amR6q2GufyytmTxNX+7a16ZQseMrk5i3Z0zoE8mwr3rMMYCSlZiXlxeyIdKR/vdzGN/tjjJh5EszK3E7NjBQa76daHV98rNQIggLEWzcjRzr2sI+PrS3jk5zt6TMlTLmv8VfUez/On81u6jTM0vRHc9q3sS3lUXOxw= 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)(8121501046)(5005006)(13017025)(13015025)(13018025)(13024025)(13023025)(3002001)(10201501046)(6055026); SRVR:CY4PR03MB2440; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2440; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2440; 4:MeRZ54UjU9k+brpAhsfM5igbOjbHg9MOZt0+CxeFbIwykenzkmcVlwo8uToOgUl8hx+1h02fhPg8vkbs+hFXAF/NwLrRRPrT8sZohbGMNLGI4T9UAoFixj18g929PgKAoEfqoinBT2tBi1sByEx/LwoHKCn2pFAlPW24tvpEbrZSdk05nJtqLt9yvUIA5uAYwZ8w0yxmsClFLcJS8QgBkjXS6QbM/jBI0HoAsnqlNt/+/k7itpS1MjiHi4MoKR9+BpEF/v9FJN0N0mEh3ox7iTbpnH/dDvNC1Mybg+riGHf8I9zxehJTZJJIe4yw4wq2Y6QSQyCEAJSWAO0jGLPZ56L0K0kWcnd/3F3ybEMzcqLMd98G1hrRrVYb92t5AORwKEZsLRjAZQgMteeK/OQELrRwDB7yuBHpS4wwvO+XEvF08Cj9W4NnUTL3mjo33XJHj+6Rx0wfcXJh/QevGIbBDxtv7oX82jdRfaDwtZPsxGDok2kl+y2mEeo1iNW3xaHXU9ijM5uNR+X13JFLeutZxV2Mpf2+CEnsItGYEas+Lzc= X-Forefront-PRVS: 0067A8BA2A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2440; 23:SZzLqWgYCYzUuo5fJKUxibbsspFR27taAgvb29cmx?= =?us-ascii?Q?OhQN7F+D3opyA2BtZmZSIRIVdw3Ssn1QYyeBL6JUV5opJOdtw8G1546ZXfq1?= =?us-ascii?Q?sX+Adye41CEm36Wm6BNAQsMgrE4n4no6UdHKqusSfD5KdrkaZBF+0sq8YB7K?= =?us-ascii?Q?RXL5GFNMxeiGW4gm1Vm+2XZCy9s+4/BDBUDs1hzQHRCIXvujIxpETJ6CbYzS?= =?us-ascii?Q?X6trO4Tdhy1mhHInLB3ygPadDQMaNUayjqGPCYzzSecxTCYj+pwHS+TFtHTf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7dyWcE7ah5FVxKqycajYYbYQtf+p?= =?us-ascii?Q?wgLYmck78tn8rs=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2440; 6:g8Pth7C24HxEcnoTg0jNlHBu/g88/VxuL0Wj/xKEWNOhVd7othERsGFaJvMijUzxRKkHlT8NIg/biQS6wAUyO3wBb9KYAcqMI+JCRBA6wLq3LtsxyIu78QeyG2acg1ipgecMeHQcsfmRvQPeMjOQtiCNzzBFxDdXBEJv6FoMAc3ViiYtrOmiGUaZjkm5/dSHnfOwkpO37z0eiPAozHYIik+ror4KZGwzxlZZXe0/Fxl+RQaAVj1oaalPb/7fGk/OIW2muitD75eBDsDmdirqbUWj5TEwy6W682cQ8WhLoqI=; 5:oftpE29krqiSorrzZr3H2psZ1sXIV8JvPcv017VEhuj9dIuZcdC7uLWK1A7WTVHLxGhHKa2wF735l6hGA3SbvgpkUUGc09K6M80d4DwTqfN9CdJbzU8T8Atc6FF5NoNHOUHywscxBg3cadf9Rrjdl0Ir122HVT4Chs+GX2LH5R0=; 24:OwxPPpHU7Dfj6VC7aQjm0GPKNhArk3Rpi9HxEjJjtPBX7zdQTqtSbLnarXQjIZnVIugszsr4WG45TtNVUEekJMBROg4kRsemQodB8O98bbk=; 7:w8iZa63HwWjwLH7CjBSkTo0XbrVZZ5ZE54LeqECmYb10m95Cn3/77MUkjDBRq3rN+i3D9/JIShItHV209oiU1fM2z8YiFq7kroQPciDeTz+oSO3t5W1yqiPV9w2XoBqzyY4qmRvauHICK/xtTQb1GOAIRB1V43VsBzDIzzU8e3D+NhRKjd6Z9NvSuVBQFZiiPj6ZWWBiHrlMu7JTtpwckKrQ/laHzFvudNSmGjKjgs8erOL7fA43X+mo97VrJyxD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2016 04:30:51.4340 (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: CY4PR03MB2440 Subject: [dpdk-dev] [PATCH v10 01/25] eal: define container macro 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, 16 Sep 2016 04:30:54 -0000 From: Jan Viktorin Signed-off-by: Jan Viktorin Signed-off-by: Shreyansh Jain --- lib/librte_eal/common/include/rte_common.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index db5ac91..7f9e4dd 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -331,6 +331,27 @@ rte_bsf32(uint32_t v) #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) #endif +/** + * Return pointer to the wrapping struct instance. + * Example: + * + * struct wrapper { + * ... + * struct child c; + * ... + * }; + * + * struct child *x = obtain(...); + * struct wrapper *w = container_of(x, struct wrapper, c); + * + * Some implementation already have this defined, thus, conditional + * declaration. + */ +#ifndef container_of +#define container_of(p, type, member) \ + ((type *) (((char *) (p)) - offsetof(type, member))) +#endif + #define _RTE_STR(x) #x /** Take a macro value and get a string version of it */ #define RTE_STR(x) _RTE_STR(x) -- 2.7.4