From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0060.outbound.protection.outlook.com [104.47.34.60]) by dpdk.org (Postfix) with ESMTP id 7BED3FE5 for ; Sat, 15 Oct 2016 15:44:24 +0200 (CEST) Received: from BY2PR03CA078.namprd03.prod.outlook.com (10.141.249.51) by BY1PR03MB1418.namprd03.prod.outlook.com (10.162.127.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Sat, 15 Oct 2016 13:44:21 +0000 Received: from BY2FFO11OLC008.protection.gbl (2a01:111:f400:7c0c::112) by BY2PR03CA078.outlook.office365.com (2a01:111:e400:2c5d::51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11 via Frontend Transport; Sat, 15 Oct 2016 13:44:21 +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 BY2FFO11OLC008.mail.protection.outlook.com (10.1.14.255) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.669.7 via Frontend Transport; Sat, 15 Oct 2016 13:44:21 +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 u9FDhhgH021870; Sat, 15 Oct 2016 06:44:18 -0700 From: Shreyansh Jain To: CC: , , , Shreyansh Jain Date: Sat, 15 Oct 2016 19:14:52 +0530 Message-ID: <1476539108-13170-2-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1476539108-13170-1-git-send-email-shreyansh.jain@nxp.com> References: <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> <1476539108-13170-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131210126615838814; (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)(339900001)(199003)(189002)(86362001)(356003)(87936001)(5660300001)(586003)(6916009)(2950100002)(105606002)(36756003)(189998001)(110136003)(6666003)(4326007)(8936002)(2351001)(50226002)(76176999)(50986999)(33646002)(229853001)(19580395003)(68736007)(11100500001)(104016004)(305945005)(626004)(2906002)(7846002)(97736004)(19580405001)(5003940100001)(85426001)(92566002)(8676002)(47776003)(48376002)(50466002)(8666005)(77096005)(106466001)(81156014)(81166006)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR03MB1418; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC008; 1:UYHwWbWhzMcEbk1MSo5vd5yvuHq3DHLTlIHOYMJLaRIVKunequSseHr9rTwU371ymc7TAInTYO86p7/fEObyXz+jUymZecPudPsD5iZ3OOSOptb2euqx1zOzv8Qa03KfAh3RBmQjwuS2sZnL7oAMec7GVGa8gknneuU94zVx9nvkPJ34Hb4AqjrHWRblcZ1o9sMmtbKPXxCI4i631tRgPC7vsxWrwLlsPQBcPz1uMPkwVN28uenrA2WIbLSkt80mSyv3wb4XNLIG0NA1ZotpG6nNu4IuuW+8dCupOl0PNuTStWaEz6CjKjOkdlb6ASwkddV+0nKRdnln6ZwX0eCIKiSOYpyjZhnX1TgZw1EHYwG8Ba68AGuEzqGmn6zTJ57F2KKQlyCXX0ZGSL4v5ntjWt6wtO9VD+Vd4sr9FaQ+DSeMGXgGkZD7kLN4e0ddvLcxL2E/C0ed7A29orPqF3RtQE5vJPvAKqw4FO4oIH8iojgYaixx3mQ783vV1VGz6DxDek6o1m5uPPGTGxsaNLzpFiQurFtiuAkDjPycoZBpI3PBzApG+JVL4aqS5bGkDWgMq6yvHHea0RSbxYTm64cA+CW2+wLV7o/BuspjFckplGdWYXCJxSpeVyqI9Ckei4IZPJ+2eb+o0xrHFLyJbQ+nYx/rbkzxshHA9bwVwocys228aXKF3DA6dAFqyQaT0pxXdrUwZaZcQQnsfEDA3EN+hchCjKiLSLiGbJuXNv+0++A= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 9dd95422-4c4b-49e7-005e-08d3f5015e56 X-Microsoft-Exchange-Diagnostics: 1; BY1PR03MB1418; 2:7pJgFkV2c7QcNavjmV2UpTjYPYIE2Xj4YAGTYVi5dfW1rFtfmoq1k6TYBai4fTj/q4QXATY9ZMgZI2XrADzqIMZzc7UvkmHqN53B4BLuVvZVDzGhCGH570A9tpF3RLI4OrbfkbAzAL+ai/BhaMY6gcyS81lEY6nN7dgKzKyrsHozp3gtP+4sQOFi7DQvpht84jvNp2T8WMOrolf1dFAbWA==; 3:mNVj2gOepZVdVNz+8O3MMZqHQ/MdlpHlO2l+rYK4hVJyaehuI1HVWo6aRO1IwkdtQBoiuGQ/W1ie0gAwrX6C60yp02fK5IkQJfmmR5YYLOcDGyInirp5F0fQbXol7E7GVHzfbEGuie+5E8w4521XG1j8y2fM40RuvQfwJ5b9VwspmQVjBkaAONZiyw9a+cGwqCzpL7tee22mdvBxXi6x5sQ3SmM/lGZiW//nqC2Bjlw8HiYdZsncCGEl+eAS8Bgn X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1418; X-Microsoft-Exchange-Diagnostics: 1; BY1PR03MB1418; 25:hF+bruu0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rnvme7rWjnyhybfLiag9WrDbSA==; 4:rttoZBkG8y1ngJnzF6wzOG7Ha6vQ7oo+EJgSiYSZciM811IRXWL//bKs4HAzUy1ks+c38oqaxwTWul6fYHnJ4xRPwa1mRJ+U4FCXd6M/foAThxvXh1/4ce76sByFO/NDlSet6R5pMnLubUzpsDXbqyb0nwmMpk7Qc4OlvjtKXLhr4OAr9WDefvjv+pop8JwPupJ7dcQnFf4AbDHtgyFERzshI/lnf431/Lur2mXytw0Tu1z0nIdcTfl0Wa00a1KNoC4Ic4uv32VoHlpRHB61B/bDnPFanDCw8QNujznEu3Kgiod8MF3gZy8xYRgl4G1kzmgu8aqYM/RqAUCvoc9ByoHdrUEmuKx+PPG1+7HOBOkLsbYcWuXAA4dmnUDKjOP8cVwI6D8vE7IT5aFbF9p2hwhXYXGkcRfLj4GY8CXe3jyVKarfAyCK99wRP1pChRLS3SE3irybjCfVqm6JV1zW5TWO1UaJHr7B0crgY0BtMhMkzZj11TBGES40qmcbrzuW+oy5PlBrlSr/cZvvSPuSi1RjzaLyz3olb3C/AJ19dvzgsC/Nf/lZ6ZQua/izQB5j 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)(13015025)(5005006)(8121501046)(13023025)(13024025)(13018025)(13017025)(3002001)(10201501046)(6055026); SRVR:BY1PR03MB1418; BCL:0; PCL:0; RULEID:(400006); SRVR:BY1PR03MB1418; X-Forefront-PRVS: 00963989E5 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR03MB1418; 23:UCFOg/v+2+l/Jbg3Tqd1+0lFWvrX6OMNpzl6XkL++?= =?us-ascii?Q?ePwJDIObKWJGT8fd0C+nCQtaNPxo3SFLDKkgAeuKdBtNrc3fuQVL6RZtbpB8?= =?us-ascii?Q?vjQhRcjKvenuKq9Vl4m/5IY/ROHEjnDigxChoDbNEpf5H4BuUi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KkCAU0bN70ZoyPwVYh6xwUQoFUCX3U4EJ?= =?us-ascii?Q?DBhOH4So6MJnlO73kjSTUmH5T0e50FDeyZ80mtETwJ6BJLhhvv+zxD9fAMOp?= =?us-ascii?Q?8AdQRYAbCxH6goI7M0XZH/aMDlq9hTJp8DvfYlXTCTL/qNuChv2HxkRKdDNy?= =?us-ascii?Q?VEckMAe8mIN1sEQdy06lG+HohE2m6H4AiSS?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR03MB1418; 6:ylj7oj6bsMGl4Yh7umF7PDF3Gvo40cwlAK0nYPzvanU853bJd4CrL7O1UoCO/i+KnozmCxKNuDNwtlfoVUutx17EOKNtOa5D6PfhI+KKMM1NvKpJEvXM1M6LH/gAlH9G7y2Htgt54XN0qQQvkz6F5YtWlXlueK8sbaJYamLJSGxfXyUsLQG8JsV+twZMonFarezcZiKu704wxtowP4z2XCtLY7hb610Kbhq2vpLOnay8zzJg8qv1iP4AZUN2y9zndvHASPHUzyrp/x73Xz0v4UaNC4gycKWbuBdpLNRMUEf+RX00ylJ28eV9KmrP1heq; 5:v1otIz94FaOSzRiGmlznjQ/Vk87dpv5fWXEZYbY++auTpOxCesHr4gU7ZhHTBmjefMz62SakR11YKZQdJ1hLzjMP4uhz1BSo4fuQF8VXzsGk37pKGebs8tJJpReOxdwdKkfKnhWGJEMNCwe1hrjz6QMt3eae2h+QQXwrUVvpJhcqR/fq8bmbhZ3jKbW0n4CT; 24:4zvNiyh5XtzzyTSPzZ2qpUjVD0r/d3yOZxJFM4qJ+vOv2kpZgAu0XGx7dt69MSZW0iq848b9ILW42gJ9JQ6DRugv0n2KlcWFF0jzT6x7NA0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR03MB1418; 7:gZ4srkR7fBV0JpA5X9ZSdH71ach36+ytLkE4AKsAzRLRpX5cF6eb2hGeDhgxzRlxl4bA4m4UViaVQFwe637j536MKLbrjohaDMF2GwylOPCUE/+f1mj0oQcwVeKTKO2y2SSSXNdX16y9Rdnelv90stzKM/zcKGZ22Cq+JxSAU0vzN9ygy05jQjVH5XUX45ETz/rp06xm+P/J9VJkZ8oU05wRLl0sHPw1NaMo8JBxbsKd/xGatdkM80k/SXi4vO4gU//Y2CKrYV+MmeIwQwLl6M0F4huYwowOw+B4AEoU/fcQ8eukDwPcOV4icIbPgHa+1iiFDMci0cjnsEBh9KqtIco3UZghhE4eXyRew+UtVNs= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2016 13:44:21.3966 (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: BY1PR03MB1418 Subject: [dpdk-dev] [PATCH v4 01/17] 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: Sat, 15 Oct 2016 13:44:25 -0000 From: Jan Viktorin Signed-off-by: Jan Viktorin Signed-off-by: Shreyansh Jain --- lib/librte_eal/common/include/rte_common.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index db5ac91..8152bd9 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -331,6 +331,24 @@ 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); + */ +#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