From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0071.outbound.protection.outlook.com [104.47.37.71]) by dpdk.org (Postfix) with ESMTP id 135D05937 for ; Fri, 26 Aug 2016 15:57:31 +0200 (CEST) Received: from BN3PR0301CA0052.namprd03.prod.outlook.com (10.160.152.148) by BN1PR0301MB0708.namprd03.prod.outlook.com (10.160.78.14) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9; Fri, 26 Aug 2016 13:57:27 +0000 Received: from BN1BFFO11FD009.protection.gbl (2a01:111:f400:7c10::1:150) by BN3PR0301CA0052.outlook.office365.com (2a01:111:e400:401e::20) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9 via Frontend Transport; Fri, 26 Aug 2016 13:57:27 +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 BN1BFFO11FD009.mail.protection.outlook.com (10.58.144.72) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Fri, 26 Aug 2016 13:57:28 +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 u7QDvHpc023630; Fri, 26 Aug 2016 06:57:25 -0700 From: Shreyansh Jain To: CC: , , , , Shreyansh Jain Date: Fri, 26 Aug 2016 19:26:39 +0530 Message-ID: <1472219823-29486-2-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131166934488162756; (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)(199003)(8676002)(47776003)(81156014)(8936002)(50226002)(11100500001)(2950100001)(586003)(105606002)(106466001)(81166006)(36756003)(2351001)(7846002)(356003)(305945005)(85426001)(8666005)(48376002)(76176999)(5003940100001)(4326007)(2906002)(19580395003)(19580405001)(92566002)(68736007)(5660300001)(110136002)(50986999)(86362001)(189998001)(50466002)(97736004)(626004)(33646002)(77096005)(104016004)(229853001)(87936001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0708; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD009; 1:q04wZDxmvkw+jS4YpNfB/M+HTiQPLXsrr18MAHoP60ASLrTFa+lNDus0BesVvdvsylk2XBlv0dcJUVHzsmyrlPwnhzVDTvkAAlOwM8fiU+3m7p/h9rbCGLh5FINrHL3FypEowEUuK1mqnKW8xJM5P6ye3+bZQwFJSIX7aa9IlJxiU1Uz3xyifs33zMealjxO9oLrNdFryUkVYVMTjdcBdigXQx8+9Y3XLs8RjfIqVwtRr5q4vGnAF6J1k8RHtSnpCSecYMTOv5uEdtHFy+tZ4QxQDu58SpAXU3z25cgRoeRtvJRh8JmilLXvhsmgrjEJgmfjz69DKd5q5VRQpmeMC91GDlmIrONur6aYeqPGaEinTMQaEaKJaaNjNsnTD9VlbvZlfwgcba3WYgDwiBBsObiRd625vYbzpgDK+jh8bQuMcpm6+39d+CmDn16gr8Viz+VQ40wSJf0P/Bhx1PeZqlQbC+VCgx/OBYwaqfmt0XE2/PxL1z3A/zEH0MimMj/o+VRBsjghYcmDAXts7WY7BxzZpTIDRLQTrwK7UtpwE0nkRRpy2lVVBvMMGjN0tC1WGPScdc2G3J5XOkKhx7Ryx4/hudDU1b1xyy+LqV8V4kYFg9yYV2SLfU6OJNv3UGlJNKyv9gkaEXkKq0ZMk0Kxvg7G1g1mhKGdHkVB6iuciZqosPemXGtaXSTVcNrmLcxWZm6dCuS9oMsjz2oUy2ajXKM7edm8t4CX6YRqatSklxw= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: f946c206-ca87-444c-4063-08d3cdb8eae6 X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0708; 2:kOxi1apxUp+cJyNQ1Dv9e6MioedMz2DIYkLGlQQ6yNmrISFqX3HDOqi6YgpzA9JyMMFokTh3grkenVXItll9bd5qD7hY7kW3D5YFUxlF0NDyNhnEtA/wSTmPu+6AUVhkK2H9wIECsFJDAJfZOeHUbOoDpMhQstrTZTy+lOYLLDpBPAe3ft6oEOdvMtV6IQHU; 3:rFNU3rT/T+qNkegoiP2WCCGlxntsVu79cH6x11dg7IPgl3LY6BDf0a/nNkYG9S/kZgWdaol8jZGprAtvghHPibh12lhFk7DiZ4ASEQMFQwI+Lfp8ypAJA9uI4+EaB41b+BtqvSNgWTYCfgXGwHEGYzpgXzUl9y9yEw0VJ8QmncKFa0veFThrTl38JpLEK2zLJIEHVLOngADiL8FSYqe2a1bJ1+zzPGd2BTrxydt4W38= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0708; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0708; 25:jBw7WjVx3RNHdYHeO6yyK36Wdb8w1CUWXeCfb2ta4NaoQlTeXuiJ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o1U4t/xLCtz4MK+J8u8p3jUFqvDQ1q4a5jE3MnkNDlODo/leKFa9wAPArt2+1hguAc1qnnHLx9ApjDk28b9Ri6nZGslWWpXkDA9fVtL0jN+yFy+4rT6xv6cD+Ep1ED29HY5M+jBQeqbZeR7TS9Ro4E4QoIenp/jxwjfnbhnnS+fWN2iSb+3+J6lgHib/9SKYeN1kDJTkDHcps8N40BW8eS6FtemrsLNzL3IFKtbWxuATO1s8NzoObAwgV6OgjlG+CShQJJcdjDleHs7PdCDvbnpdBnUQB16KQ4T/UmA0F2hiY0KvCQ83hW6xrFk1X8nqQvXq8tCKm66tcMUbbFZN+CLFPD9vzJG4L/Ku7WWy+6jLlLhGrsq2U0b2nwQ2Cu4JzMU9yfyEhuLxJ2mJ6Tmq91WoIx/5B2U3thUYgApmup+HB0nS2qTdUKoHh0GY5wKy+e8YpFVB1TlD8hz8= 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)(13017025)(13023025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:BN1PR0301MB0708; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0708; X-Forefront-PRVS: 00462943DE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0708; 23:YHQR9FxhSZNdqwjfKpnVWWdaO2r3BaRYoSo84w9?= =?us-ascii?Q?AoaaW2YhjXWaC0HJjZJWAK4OaZ89JSNtLhWxZ281Y7J1aPvd9pTtvg6Sztop?= =?us-ascii?Q?Bj503K8j9rQvL7TkCI0lwz86VXqfsW5gJg5niV5tosrc8yqV67QXWNGwaYX+?= =?us-ascii?Q?z2SmR1R7AN3TevPzmLfSQ+6+fXf3Y9MMvuSWZzVah32aLYf1oBYWhluVzx7V?= =?us-ascii?Q?Gbzol8nSQ1nYsbWVRfYjpmmoMoyt6DMt7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?us-ascii?Q?n33gIzVtTcQpg/6nSAHL8mD5numBUZsDpsxgBPWdN1DycZop+MnT0o9fSJ0y?= =?us-ascii?Q?YL59D16gD+0UFf2s=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0708; 6:z4pf1nG7u8kqGLHq+q/PNO0M4LddIKM/8WRSdlGZB/M3ZzLNwOiXW8xh70a3AdpPAwV13sR0erLKOuLU701shpVNdHW9eoBBNv+mO4/4M+UMbdao6CVlxecFHMvXxKBmT5BulcTXz6BxGTukxZXT7Rc98SoK6/WmpMEvk1jZD0eN7TQTR09tFk2RUbKf3poLVybtyUgM/nqc3upyqKAfiSc2P9XSOJp2LChe4eRAF/LRetbRLPptCfGi/0BQWbUs0AvFT6O0rCCi1lEwRgVPhrAKlb4VPkQRFWrLAIRFfAY=; 5:Rsk/TxhBdzOO6/Ym413mpmM6xYulY8KSAFCSPk6OL3B2uGoeZ4b18MJqTHwxX3eT5YAep1X94whkpu5cWg1iZsXAuJb8em9lJAWcj3C86t6e+s38NWrH6zDT/ILV9WjyVtQiS2OQDXoNsCRQj+uYQr+Uo865d2vDpdU1fb2YsKM=; 24:9nqVJ1jDFO/IlOCzNFkTPjkt7syWS6AhyZGGshsxV7okZEFPvCQd5Zm0DuAZde1iFnMJoP2Y1hZ2rFgmZ9Ihi2VkxO0gn+sG9GP6ssrONck=; 7:grSdfRpSmG/mTgOmsqS98hWZHxQtMMsXTXQTWvFx3pnvfRex53fESQ3Bv1utjA6YHLEHf1x/2nybw5zttcNvNAgcRJFGRUESR8b0jRHc/YJRmGac/wxRbyWVhDOw1y63ZGoTtaGLS66erN08rfC7+Fz9vXG4sufiBgoHiLWhy5ivXrmwB5Tv9ImNzqfNn9CeWtOfQiMU9+sFfJ96HrmiptkZWUVN2/TJlK9+Xw33uoegw0O4QITCpTN3SxHCh67p SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 13:57:28.6290 (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: BN1PR0301MB0708 Subject: [dpdk-dev] [PATCH v8 01/25] eal: define macro container_of 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, 26 Aug 2016 13:57:31 -0000 Signed-off-by: Jan Viktorin Signed-off-by: Shreyansh Jain --- lib/librte_eal/common/include/rte_common.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 332f2a4..a9b6792 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -322,6 +322,22 @@ 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); + */ +#define container_of(p, type, member) \ + ((type *) (((char *) (p)) - offsetof(type, member))) + #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