From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0080.outbound.protection.outlook.com [104.47.32.80]) by dpdk.org (Postfix) with ESMTP id 89C329253 for ; Thu, 8 Sep 2016 07:45:13 +0200 (CEST) Received: from BY2PR03CA042.namprd03.prod.outlook.com (10.141.249.15) by CY4PR03MB2614.namprd03.prod.outlook.com (10.173.42.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9; Thu, 8 Sep 2016 05:45:05 +0000 Received: from BN1BFFO11FD002.protection.gbl (2a01:111:f400:7c10::1:167) by BY2PR03CA042.outlook.office365.com (2a01:111:e400:2c5d::15) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9 via Frontend Transport; Thu, 8 Sep 2016 05:45:05 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD002.mail.protection.outlook.com (10.58.144.65) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Thu, 8 Sep 2016 05:45:05 +0000 Received: from [10.232.14.87] ([10.232.14.87]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u885j0pp005120; Wed, 7 Sep 2016 22:45:01 -0700 To: Ferruh Yigit , References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> <1472219823-29486-2-git-send-email-shreyansh.jain@nxp.com> <57C46637.3060707@intel.com> CC: , , , From: Shreyansh Jain Message-ID: Date: Thu, 8 Sep 2016 11:15:16 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <57C46637.3060707@intel.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131177871052590566; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(3190300001)(339900001)(199003)(377454003)(24454002)(189002)(83506001)(76176999)(54356999)(50986999)(33646002)(93886004)(586003)(65956001)(65806001)(92566002)(2950100001)(31686004)(85426001)(230700001)(4326007)(81166006)(77096005)(104016004)(87936001)(47776003)(7846002)(626004)(81156014)(8936002)(8676002)(2906002)(356003)(5660300001)(11100500001)(86362001)(65826007)(23746002)(50466002)(36756003)(19580405001)(68736007)(64126003)(31696002)(8666005)(106466001)(105606002)(4001350100001)(5001770100001)(189998001)(19580395003)(97736004)(69596002)(305945005)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2614; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD002; 1:ykU0kNxpg8ZTLwjRMWZXiwNSJoTiRu7RLbaQlsJUdSyq1nW3uUwUGpw/lAVUKzfmZC0LQAlTSHriV3oogCxm1VWX+3Ysj+NtNZbLg8GyDGmmPLvZWAvTz1ZJFE0DI60o4HDO+3vtaQQd0xeUS8Tqu8habX7gIx6ViVOm56Lqr8FGAsR5I9SvMJtsWYmq11t8ZXutMG2t53tMpIiA2TaslUr1JV9AhJ0kjf+gOZieto+j2I2ePJBBkLvGg+txn4FU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cdKYGkaFd1y6aZoDzJoZ9p2x0pGp58tSIcgVvLR4N6Qh5DIH6gZpRnooTG9q9p94B3xT7G//of6u1RP6ShXV2TPrmvfwlBb8w4k= 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)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:CY4PR03MB2614; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2614; X-Forefront-PRVS: 00594E8DBA X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY4PR03MB2614; 23:/Fgays2IbtgRMk2IzVvqqjb0E3i/LduLF2jve?= =?Windows-1252?Q?u1GzVk1Gpsa2dNKsMrX6asyMsx+7ykRsNpTuK/yh1Qwt5VzUYfQ+lDU7?= =?Windows-1252?Q?asVKujc4Go2LJTKdG2MpKUtsAXgFDZ/PMsU6VLKxrLZccdbiEHLxvJYW?= =?Windows-1252?Q?/6w9NGrPhzymXDkcHOVqRefzexr4niVfflZx8UNDHwWBLOjSz8ArAclY?= =?Windows-1252?Q?otV67l52t+YNlZX1rzZBaQq5QDWvSCOu+PVvJYFNtprm8fKoWmYkU2YB?= =?Windows-1252?Q?IdjPcWE990dtMfCMYvYqDN+Yt17SqF9hQKpqCC5BYlTcwTQwKdvuTuLJ?= =?Windows-1252?Q?8PrVa4COf5SL7EiAe+xSTpqEGmrzKDxOIxVa6XgxjboxDYFv/on9Q+u/?= =?Windows-1252?Q?+TRN/kspNNuwq6ObPiYPMQwWWQdqrzIXyjbvnfDWrUjGRJDNtWINrA2/?= =?Windows-1252?Q?QQ/8eOwB/sS59a66FOj9giEJ00PYmTiSXc0sLPlVXR1L7UvZWzSdLkcp?= =?Windows-1252?Q?9/LOrQuQxStpL0p9LhdJpnOKlQJAJbCaeuac0DIMZ51kD6KnoheUSglm?= =?Windows-1252?Q?PsCcOVB4Zakotw88V4uPYHwyB9EAztJUz3c5qMBJy3PJPX9hUh4a9Xyb?= =?Windows-1252?Q?l5+gRV+h2grd3Wrfa9Zwt6h4F3NW7EOpZURfLAEMs0/oGiuYedLw1Fq9?= =?Windows-1252?Q?p+XmHH49dUALkLTbjVA5wujXldAcNB+54TK9oMwQpUa8q3TGcSQdjv8k?= =?Windows-1252?Q?QDem5N5/+ESjEdDE0oLW+Gi2vmFnkwKB4GQFTGrZizzJ6l/tWtsGxpj8?= =?Windows-1252?Q?1/WWd2aP7iqpTkGpxG+kbc/OGHh2wI+P9ZB2McYht1SSGB5a83MUgov1?= =?Windows-1252?Q?Am1Os+LHo0lBDRV5/XGI6pG/MjuvjniIQjiDfzxGgBmrZlqv3ODJCuj3?= =?Windows-1252?Q?fO/ECmAsBm2Ee+F2qDrMNUwABjxjZYr+jz+y+1vBPW2wo0X04db6wTi3?= =?Windows-1252?Q?h7QjV9SZrUR9vrtIgv9x6Spf0IT2z3bYFXC6OVV5gNh3NWpPrV5kwLiD?= =?Windows-1252?Q?LuuVRGqHKjatUJA4lwRSBmOq5u1f2CK8CLoi7+y/2rumP3/BjCKQ5hfE?= =?Windows-1252?Q?H0SkprYDCNSIoGZ2HJjVEggTMQ7seosexAS5LYUB9wQMIKw1BHtNZecl?= =?Windows-1252?Q?LgCFg/8aVoqruTayLJytxWj+ZrcHrH40P/oqqMbXIm+jupvafIZIByf4?= =?Windows-1252?Q?d0vt/tLzMYge5tp4g4OYFtnwJe/4f9LL3Sq/Z6EU9CIKvACb7QV9pWPY?= =?Windows-1252?Q?9DEgos9NBtl5PEtjMGC5ZNUCWaASjsqwusS3rJCCa45MpEu38M/4la6p?= =?Windows-1252?Q?YBigA9lxEC+FBgCsZAR1csoaTduoBamhYrdy8bs5Z6O673/yENMYjeYV?= =?Windows-1252?Q?niBhTInYifvlSa6IWwhC6ZqN23FhBaXRsynUryP2S0oViGXVYWZxz2IM?= =?Windows-1252?Q?ORUgb/OD4MCQy0vdZSK4vxIu2om5fg/6Bg0a8gEK4YRhXyPdtIPsvzCB?= =?Windows-1252?Q?CBNBSY0LQ2RmCI=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2614; 6:bDSZTRCmEKYkJtw326KzVDA4JWqlLuY2WVOmZItyANsYvA9Yl5BNYjLWo0GpxGMNPToq5BDktTAjqYLJ0S1wOnB3OhE4bHN5L8DqcuHw/FDvUh6scYpyKmm3YA2iCTRxICOe+k2F35jmmotwjJovUJq60mILALIEGOQbjjEpaTBd3XXUkA9Of1f5G0VJqdTGUjrVf4HwE3qLB6BR1Fu9et58jcHSxy5m/+TejHZfoIalFzDCslAUYx2/LzNn/KCmR4v1pPbrSwq2agNzYfSJoGD2Sqp3j0flQv7jCMAdlME=; 5:fbXuluCWkwhz+omsfUAK6bRdUfioZo0i2AEil37D/gPBsYfwowhkElztZuNA0Jcy8GNMPoUVf8GeteV2BX+nw9Xkrj2O97QAZY3U5jgYlo4mTMyo3T42LsU5DyGYsYbDrHEpg+15D86Z1K0l1Bup1zOqUAZyZUUCG9nmnYb8N+8=; 24:2THbZZsudPRxUWvOJfTacNT4ZhWE+/Xv70+TeFT09kZDv1wZ7mGMi3g0t4qS/UScTf8MCUSCWmeg7Nh14LSKaBjaYZJGcbsDi9FyRN0wabk=; 7:JaIkUXM4RzGkQFxWpfbKK+cVCdz1ng/wgHRvYxpmrc1WSTXPGLdSMej3xh1tkaMGNxwf2WNfmehMVjwWfKo9NQa13Q0eHfCECQQVpnQq51zRLAd/hCEiU1nJAXxk74pV4pXT2UboK/a+7turCJn+84aoQu2TJ6oA4EQqsjfcJuYPI5PFitn4YfaXlekRzzsIIh5fJJSb0t1nfl9Hq1vyJkbFfQO43yumkT9hsrJ8KTgPDOSTQuQxtD8PZQzrxS/h SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2016 05:45:05.0094 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2614 Subject: Re: [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: Thu, 08 Sep 2016 05:45:16 -0000 Hi Ferruh, On Monday 29 August 2016 10:13 PM, Ferruh Yigit wrote: > On 8/26/2016 2:56 PM, Shreyansh Jain wrote: >> 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) >> > > This gives compilation error for mlx5, because the libraries mlx depends > defines same macro: > ..../rte_common.h:338:9: error: 'container_of' macro redefined > /usr/include/infiniband/verbs.h:77:9: note: previous definition is here I have converted into a conditional macro in v9. I still couldn't compile and test mlx* - my environment is still not prepared. Though, I can see that this error is not being reported anymore. > > Does it make sense to protect macro with > #ifndef container_of > .... > #endif > > OR > > add a dpdk prefix? > > > Regards, > ferruh > - Shreyansh