From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0074.outbound.protection.outlook.com [104.47.33.74]) by dpdk.org (Postfix) with ESMTP id 7ECC637A8 for ; Wed, 15 Feb 2017 15:33:01 +0100 (CET) Received: from DM2PR03CA0053.namprd03.prod.outlook.com (10.141.96.52) by BN1PR0301MB0723.namprd03.prod.outlook.com (10.160.78.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 15 Feb 2017 14:32:59 +0000 Received: from BL2FFO11FD016.protection.gbl (2a01:111:f400:7c09::149) by DM2PR03CA0053.outlook.office365.com (2a01:111:e400:2428::52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Wed, 15 Feb 2017 14:32:59 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; infradead.org; dkim=none (message not signed) header.d=none;infradead.org; 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 BL2FFO11FD016.mail.protection.outlook.com (10.173.160.224) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.904.16 via Frontend Transport; Wed, 15 Feb 2017 14:32:59 +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 v1FEWtZb028455; Wed, 15 Feb 2017 07:32:56 -0700 To: Jan Blunck , References: <1487152929-23627-1-git-send-email-jblunck@infradead.org> <1487152929-23627-2-git-send-email-jblunck@infradead.org> From: Shreyansh Jain Message-ID: <303901dd-da3c-38ea-2979-01ee66387b68@nxp.com> Date: Wed, 15 Feb 2017 20:07:47 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <1487152929-23627-2-git-send-email-jblunck@infradead.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131316427794214263; (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)(7916002)(39850400002)(39840400002)(39380400002)(39410400002)(39450400003)(39860400002)(39400400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(377454003)(24454002)(4001350100001)(23746002)(77096006)(626004)(6246003)(106466001)(2906002)(230700001)(83506001)(53936002)(356003)(389900002)(105606002)(31686004)(104016004)(81166006)(50986999)(65956001)(81156014)(65826007)(92566002)(85426001)(189998001)(47776003)(6666003)(65806001)(8676002)(97736004)(38730400002)(2950100002)(5660300001)(8936002)(86362001)(50466002)(31696002)(68736007)(64126003)(36756003)(54356999)(229853002)(33646002)(76176999)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0723; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD016; 1:rxNhMS7uU6slc0UpevyZfkwpX0h8RQZGA25WEbGiVuHZunqqE73/QzTBJsdHdnqqI9pK+qeRBeypKpJYyAGPyQ0G4rvDMr1+F0FnR1bh4IkwZaVZHUpasDljvWD8yZpJZcvr1YhGr5oJcfFTm/0h5x3xfa817U8XtiKE0WBqc46tXoAoWcQ0s6PE5G9q0R39ktAhIQeWBwuB8HSV0iiU9bM/OuIcOm/tg6vSlNQ3QwEVnRsbXcSBnPmjoWoQ2IVQ8ZimZkVqETGRY47T9r4fFgfKq8b6Wq/m9YtnTnS9rDUPJYWo7ewIZjfLZgeLtYYZFSy5k50kevf5kSs66Oe7Xoyp34p0IohoUuBgHRObQ/BjlxHCr//ZBft3mbFboXaJVPGu8pKBGrI6nSAzKwlqu5DoK9oT0y9eB/t7BIy1fh2RKF5vbbORgS572TDOgO3ydRGXGhCmaWD8YLkwvXwpX2qjBIYex2zhFdqmR0Q50hs9eRySc0Hg217ME8guWsuka7o62Fd3bUFWdvuYBL0mPk7vfO4D3LgCN/OQd5bomowOhuJSu2Qm7y1rOuHc9nEp X-MS-Office365-Filtering-Correlation-Id: 56c19242-aeb0-43f8-8c17-08d455af8a4d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN1PR0301MB0723; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0723; 3:qcH6UI/LSzZhkXt4SplJzaL6dQMgB1zC/eG3oQPxi9bGfqSZApOTLagVN8uBRtUKcS+4vMoXCAFowAW91/IIJOnzjeYXtovHY517xthkcjWdXD/YsoLz1cRoRDkA5DGXXviQ8qg55YuBSb9QcrC+Tirpc4oA2T7tBBhFvmlBU+mZfiv+XvQxLezdNfvVmJNooLngfTWp11hd0m13ohWR+0uNE5ekvIyTiCouGU+tEtPFdY9h7p0Jxx0OUy384Cq3uN9XgSfCo82NOWXoDrl11dUVPBHyCoIg6+Opy+Owp4bQbVHhao17GF8f2V+Z6GGWt1AAxplAWDJpibWeD9XtOCbBhA+CCW33G7DXrPrT1PT4Kelxd9WpjF3ppsszJoBO; 25:1rjjgp3wtPYdnVD9pVnaXyvBIG+w9vKYj2ZTq2m9+l0S1sqDgHruI5CYahw8ruIuXQgBYojrQmqsaw2mrqld74agAA3BnDcSAeAAb6pN/dSmVUKn6kNNxTZhfe9ogg1QTlP14K0B+Pb4lz47iVeS0hOVODctYOaLd220tnAOHXbblf2utksQIp+4z2E4hj6jcpd+QNEQKi9t0x/6TvaRiIKDA/ToHXo8MDxxpea49f8NITfdM/q28ncIUiY7rY6f6gKyPMyLGvN50uYVZ/3sVHjcu5hp3v9ebJwM9Y3WOw+IdCM+Cf/TtbkQXivwxP/PhtvoMU9kwA39O/O2d6t53VsAgbB2H80UlqrM+9IrFlLcTDNvA+Vz62i+CMqtS4Vjajx2troiEqf/8Fzh2OgL9JtznfTBNNPSJJGsQG72vmPo1IQc9YGJUCw+wiWTMd1D+6Uuit47H2XLN7zO+YYwjw== X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0723; 31:qRlVQvMiWOo3hDTPRqjREYryiczOQrL2vuAoM4S4DFC8eyHiN9vfA2JDGl9xOjfTAIkG5iMjdrzE0ErbGfsxNjpktiQvGK1aWgr/crI0JAxlWHo24bw9kpOHgScqXmKdQWpJnPWDy9vva7vHUl6idovJSFOsth0kkNlfzEUtZcYqB6n/6VVfzVR71V4srdvJ25qkUPeDUZqqQOvkRZj0SDPOtYV5BCe3W0bGzpki5ixSWLnKV9KxG8Ulci17S2I/BgbcQRgvPjE56AhwfWO3+Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13023025)(13015025)(13017025)(5005006)(8121501046)(13018025)(13024025)(3002001)(10201501046)(6055026)(6096035)(20161123563025)(20161123561025)(20161123556025)(20161123559025)(20161123565025); SRVR:BN1PR0301MB0723; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR0301MB0723; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0723; 4:lCIgfsTn5FaasMEqDqRaBTFWY6GYe8WpwQ7lcShtkdETI5W5q77lLcT/NI1zrNCaMY3Z3zjs7kJy+7g0y3qNO8JrBK/2ApzvHYLO8VxrBrpwuh3IVAagUVKxjjpWY6wAY7R3/ouyA76uSH7PJv/j4VA6XnkYvv6O15YH0Pv7GPIlsUwwnHPboXbAwRS2C3jtQyx8VGTwuU3oWn88c68OwDXifqd7/x0+B+EKxF3q2S7OwzDdph8HPc29bWPXBDukSWGejPmTC1/jQQCKDjJBdEDQpTqdVdd1r0Hfvc8TFtZiRzE76Rp3pM7j/hLsMOjz3vzyOlaNDbHDVuMErBRwjkIPel+ysBlsxSvdUymqBZ23LutZTN7j6rAcikt6hon78FCEi1fLpjmmv5gpHE1bEOTQWKk0DpS/JU5bXbWwik/DixcpEJ/emOZ84pe8BUiHvq1QV89sADSma1ZYuWam3btBLOOxaB8EPGF6Zy9/nqn/X+fpriloGo5RLRhnES5M92+wwvbj7LMA/7XgfR7qUYK40yKwCYeK0vRwBA8VY/HbCvTXahtKvr86RJQC/4v47uQ9YtOY85hGTs5f1weqPIlvZkHppe6cMV8opjbP2IxhbleyDhykIBf9EPKTQIDwxrjtgkBLlR2m3cVo3MXc1/fArlDJGJPF7cWgiZE0Xx108ZK5+B+QPYVARDIDk+3W X-Forefront-PRVS: 021975AE46 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BN1PR0301MB0723; 23:rPqvnbjNDgBFF5az5d8TfdOCgR7gdjkiODd?= =?Windows-1252?Q?DXVZ0UF8EetLr9VdaMwFnvXkNnR63qa8SjbSRa8AR8v1fROWbehThyNg?= =?Windows-1252?Q?vlOnDi/QmP6N+L2Ms4S9S2AFYeESNjYQfPEozuN3gSGJIOSJiB8eK4bx?= =?Windows-1252?Q?7i/OPz+ng3r4XbInyW4AGkbKzNCC0T33ZccrujZQi3S4DSMKWdOb2Z26?= =?Windows-1252?Q?upa2xEb4Vu9RYsZVB7kGdCZ8P9VweMDYr5qokUxAmsO/+TfGZPWQA5l/?= =?Windows-1252?Q?S4gY+nZiJyR26uUsXPWHV6qKxbeuEpuHZ+Ga7X+qdcvU+Jw4S8/1/p01?= =?Windows-1252?Q?/ondyzqEqN5efs+URGBu421clwilyFUZV8+JyYi9hwZLC3kgY3Dc+l6e?= =?Windows-1252?Q?dlL6l+eIs2JYup3Nj6PHJENw0svWOFQdjl9OoJAgT9AzG26UIkwrcxH1?= =?Windows-1252?Q?45Qtc76nmD91A8DYcJGCjo+hWdL6VWI5EwFzGVrZGO37yMLpVlJ+8dpO?= =?Windows-1252?Q?WeD3y1xiqlvqaovRCR4fq0qVHTEeIv07Arsc4rFgnLnZqgM+yiCiF9u1?= =?Windows-1252?Q?5aJ7JgvhaSVYmtFSMFriXWf7NiZLARGMsfpHJMF0QfC4zFW9yAG1hpdT?= =?Windows-1252?Q?InTftD8Zmcg0mkHvZLiOeYhK7RJNpVfyKIX8Dycl4oVbH6y1OrwY8sT2?= =?Windows-1252?Q?EAmL+msLk3F12hc4YXrvMRPum8gr/j9yV/ulDjoNa76Fhm/5N0b7BuEH?= =?Windows-1252?Q?X+7vtx0hmQf+WK1hvuwb8N/Q6Gu2rQS3z02vhLqr5reDDuq3hCH8PGZn?= =?Windows-1252?Q?3R+b0BETLNnHBLqhccUfDpgF6WskIHYTurCjUC0YufxrzljV7GHo5Fqh?= =?Windows-1252?Q?TRslZ4tHZR0CKws2v8EhZNA416r+TdVIKVoJ6VYX5ulYtIbyU91p/3tT?= =?Windows-1252?Q?sYlTkpDcyLdHmhlOA8C+Hkbp908RPzyYrvE/CpLvGNil+3IhXzhMRHwm?= =?Windows-1252?Q?FoaH115F/ulf6cvhHbVkh5v2MfmKa3RZORdmuJSrpfWHxOTEui4rlCyx?= =?Windows-1252?Q?w9jf9Cl+tq41LE1d6ASIgh0obK5LsVQYljcAxheWyJJrcNkHge43xQmr?= =?Windows-1252?Q?N13lBVlO5ATS8HwMBWAJtvBh9v/tK7LKJ93EsCZXIkEdlgevTQQFP7i9?= =?Windows-1252?Q?MZPE9sfBUZ7+EpakshzQM1yvLq0s9kclJQGwQjZS7HFevFZJMXsaJP72?= =?Windows-1252?Q?syd16AE+CLo6toGm9abjQRJmXTxc2AHhHZ5x4G5P40OCd7IhW1Zj9rUF?= =?Windows-1252?Q?DQVS3WtF6UswcCxSX8EtqvEOAeQZsDWTbRX8W640zm+4i3NIITpxcfBO?= =?Windows-1252?Q?hUhhl69BRTBKBKHOvAU/LZG+HfbrnTQcNSp3550VKSztoABesd4c+Gsd?= =?Windows-1252?Q?8bEesNmPqse7kPLnsL9oFFm+5X07NhHC4fpl4Z/WspTwgt37tchlH01A?= =?Windows-1252?Q?qNVWKktxlBC7wq9YuWPMaCAbNHrMY9miG+rt3tZAqnEJBIrcqPN26EI0?= =?Windows-1252?Q?W0r1mN37eK2WUEb8ju0DpXEtus+ExmjnrB/ATTJKp49Nz5ukZYjfutC8?= =?Windows-1252?Q?5Ng=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0723; 6:1MrWA0YhsaTLQR2ovbF5fU0Z+mcI7COoeIoZRdW3hDrHocd2gNAkU77lkiNxYaBx2jQN+29qE0/qbQjw7wslr6nzf6xHA/E5izx2EofabHklaz+i6C+DQu1rV0il1Mln+z7/tlj4X3S+vnm+6EUKDCcCEKaOiWwxD9hAj2MoOt0p8JnA3xJ95cZiJZwldLlATBKfVzmLSstXyF2JmK1ghzuYHoMKVW93hWMDA00bmV3cEPEdciqKf5MSmmdsDXbSLTvoK/2rc4Tq2vnqWDIYdjQZGMwyj+F4mi+6kVFdiNR8yPxNZ4dK00LnRZwuMEqPPhYwuBUcgbZcynnzJ7h9U9uHYPhBiFcAKhTb33+y7+y6tEK9lLWkt2kSDqLdc9cTF6hXMW672VSRkdecXNK/m9LPCOPEFKloAEpd22gCJJM=; 5:XbP1iST5K2MW7aq9JkT0Y4SIfOaJLpvpqsQX1qnT22ogOqrojDig+hbA4afC19kZIsxh79I+LEIjIlX9DFPbm/juBRGO9y81VpKweEShNptKKFnM6BsHgUCzkXKv+MuBARJfTqU0kaESibBeB+/HNyD1lZNLHMOuWQzJycX7evEFwNjBg+5dKDBU7k3tBZMk; 24:OZcDEZVwqA8Xb0iHddt82iUdJixs7cYR/jIlL5rerNubJslgxr+POme6zONeqXPPbb18zwbiiya1AygVSx5P006kOzmQryq89/hBm5ECIU0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0723; 7:5dZMiqtdY+Y9x2svSQHe8MoQc1/OSL34Vypf7+yPetLHRwge1hiv3bUr/HpEsaEqGKmUEv4ZrCJ8m3378YFN93rao6ZiMUvIxyo2wHmsd+fIi38oOM9VaBM9nHr1yukNuY3PHV5NA4ih1Dud2dCvAZffi2flW5YO8nAGJD2/QH8+mjIX6/vsyAwExoJBLMDt29/pM0IvDRZp2oM8YgkmvBiyEyOtWxJ0YQIZ+FPBZu/70pdGnne27egHAm42Qm5bnD5+IULztU66qsb+6KsxCY+uEGwxOGftEf7rCKyeJ872X8jFehGZo0sCmeiJwFBbShQ+qZn8MOxOKeyYY2zzgTTYyTszTJev8eOe3KeY1oL1tABf654PccCVkjy/Ep1OfyRXuxlnAIkilQIX2aXEyjX5WBuedE11H5Y5R41DXUUYtlVcveKk0qUvIyy+6y/DL6lnOWnV1dIA7LYpBRG6Ky671pFKcwqbIuwi/Ii10MvYe4wWFjBU1xHpDsz7kqZ2lQXuEFwyOVcNX9YQkqoyyw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2017 14:32:59.2342 (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: BN1PR0301MB0723 Subject: Re: [dpdk-dev] [PATCH 1/7] eal: use different constructor priorities for initcalls 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: Wed, 15 Feb 2017 14:33:01 -0000 On Wednesday 15 February 2017 03:32 PM, Jan Blunck wrote: > This introduces different initcall macros to allow for late registration of > the virtual device bus. > > Signed-off-by: Jan Blunck > --- > lib/librte_eal/common/include/rte_bus.h | 17 ++++++++++++++++- > lib/librte_eal/common/include/rte_eal.h | 12 ++++++++++-- > lib/librte_eal/common/include/rte_tailq.h | 2 +- > 3 files changed, 27 insertions(+), 4 deletions(-) > > diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h > index 7c36969..9f161f2 100644 > --- a/lib/librte_eal/common/include/rte_bus.h > +++ b/lib/librte_eal/common/include/rte_bus.h > @@ -50,6 +50,7 @@ extern "C" { > #include > #include > > +#include > #include > #include > > @@ -145,7 +146,21 @@ void rte_bus_dump(FILE *f); > * The constructor has higher priority than PMD constructors. > */ > #define RTE_REGISTER_BUS(nm, bus) \ > -static void __attribute__((constructor(101), used)) businitfn_ ##nm(void) \ > +RTE_EAL_INIT(businitfn_ ##nm); \ > +static void businitfn_ ##nm(void) \ > +{\ > + (bus).name = RTE_STR(nm);\ > + rte_bus_register(&bus); \ > +} > + > +/** > + * Helper for late Bus registration. > + * The constructor still has higher priority than PMD constructors but has > + * lower priority than RTE_REGISTER_BUS. > + */ > +#define RTE_REGISTER_BUS_LATE(nm, bus) \ > +RTE_POST_EAL_INIT(businitfn_ ##nm); \ > +static void businitfn_ ##nm(void) \ > {\ > (bus).name = RTE_STR(nm);\ > rte_bus_register(&bus); \ > diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h > index 03fee50..3a6bd71 100644 > --- a/lib/librte_eal/common/include/rte_eal.h > +++ b/lib/librte_eal/common/include/rte_eal.h > @@ -258,8 +258,16 @@ static inline int rte_gettid(void) > return RTE_PER_LCORE(_thread_id); > } > > -#define RTE_INIT(func) \ > -static void __attribute__((constructor, used)) func(void) > +#define RTE_EAL_INIT(func) \ > +static void __attribute__((constructor(101), used)) func(void) > + > +#define RTE_POST_EAL_INIT(func) \ > +static void __attribute__((constructor(102), used)) func(void) > + > +#define RTE_DEV_INIT(func) \ > +static void __attribute__((constructor(103), used)) func(void) Shouldn't we simply allow this priority to be default to allow for some priority space between buses and default init? > + > +#define RTE_INIT(func) RTE_DEV_INIT(func) > > #ifdef __cplusplus > } > diff --git a/lib/librte_eal/common/include/rte_tailq.h b/lib/librte_eal/common/include/rte_tailq.h > index 3aae098..07ceec1 100644 > --- a/lib/librte_eal/common/include/rte_tailq.h > +++ b/lib/librte_eal/common/include/rte_tailq.h > @@ -148,7 +148,7 @@ struct rte_tailq_head *rte_eal_tailq_lookup(const char *name); > int rte_eal_tailq_register(struct rte_tailq_elem *t); > > #define EAL_REGISTER_TAILQ(t) \ > -RTE_INIT(tailqinitfn_ ##t); \ > +RTE_EAL_INIT(tailqinitfn_ ##t); \ > static void tailqinitfn_ ##t(void) \ > { \ > if (rte_eal_tailq_register(&t) < 0) \ >