From patchwork Tue Apr 24 11:28:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABtan_Rivet?= X-Patchwork-Id: 38794 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B341629D2; Tue, 24 Apr 2018 13:29:21 +0200 (CEST) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 434961066 for ; Tue, 24 Apr 2018 13:29:16 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id a8so218796wmg.5 for ; Tue, 24 Apr 2018 04:29:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=AvYrzoRcMZHfvRG1lNtXbYNg5lPA+k5iDJDOcEmN02w=; b=Zxy6eN7nK+ZDw/8mOkZO3b0UHyrRpkqtWy/7fDA5JY8Y7G3NcEFCYl/y/f6vlbpjgb xTzYv6x9G0tMYXvzKqqiXsuvVVqhbVBiyFKwRyevF+CwKSHQaUz11MhoceKH8VUsG5+8 u63E6ZKTVl8qFWxER5M3WKk5tsnnPP3AGlFBhKUNYTbnUrytsB7FzxjVBH9Ryd7/EZp+ Z0LrlVIG5MPhADJZEMnvKQZv0/Uqx6ZWWi1Y1GgvG9dLfwuompbuN6MypuI1z+OFokMF X9fraHyKyx4PtysjoAxwqAIFDvPYuI8RU2kefPFafd94ZbbYv76lh2/7ltdTFcsXKTh4 yeUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=AvYrzoRcMZHfvRG1lNtXbYNg5lPA+k5iDJDOcEmN02w=; b=Av5fVA2LA5aq1D675BXP6Mln1zx9ofHk1U8sUcinD/jzwVbYbzGOaZkvtBRiUmu3MQ 9kFtBjN5VX3lv4v5o6fCuTn57cNVaVshC1n2LWIuJztLkfuE33X4IolGzgEKIdF8iw1i LUf9xHTU/va1YH8BDfJbYWNHtNOdFqz3h0X+nz+QOKPpnhIXMJqQhSUMuuk7qI2PPV1d gpmnV7Ke2m/qF9zyKP7i5agUu5XcnwnSo0cdXH86iOTpTVJJxD9nsz2WqdqjM83ovSOo yU6jya1RLjuOTerwmRW0VL4vUVMQmhxhJerAWro8ztvfmE55+0/ZiZvSN+Fe+8x8VrjX o39w== X-Gm-Message-State: ALQs6tA5c3gu5fQ1jqXQDf7gkqMFDasrlZ0hyz35La1Kt7YuURWSpNoH lvxUPLkZHoMtz9BtAD9M3c65IRIp X-Google-Smtp-Source: AB8JxZpqNAoP8/lGVNztK8eU3dgvEknQnOhTj+kssynrpNXLC1qIAWpErXpL/S9hdpRDNsrHWqzlnQ== X-Received: by 10.28.197.205 with SMTP id v196mr12668836wmf.39.1524569355316; Tue, 24 Apr 2018 04:29:15 -0700 (PDT) Received: from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id c21-v6sm12848021wre.43.2018.04.24.04.29.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 04:29:14 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Tue, 24 Apr 2018 13:28:53 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v1 2/2] eal: add last init priority 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add the priority RTE_PRIORITY_LAST, used for initialization routines meant to be run after all other constructors. This priority becomes the default priority for all DPDK constructors. Signed-off-by: Gaetan Rivet Acked-by: Shreyansh Jain --- lib/librte_eal/common/include/rte_common.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 8f04518f7..69e5ed1e3 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -83,22 +83,12 @@ typedef uint16_t unaligned_uint16_t; #define RTE_PRIORITY_LOG 101 #define RTE_PRIORITY_BUS 110 +#define RTE_PRIORITY_LAST 65535 #define RTE_PRIO(prio) \ RTE_PRIORITY_ ## prio /** - * Run function before main() with low priority. - * - * The constructor will be run after prioritized constructors. - * - * @param func - * Constructor function. - */ -#define RTE_INIT(func) \ -static void __attribute__((constructor, used)) func(void) - -/** * Run function before main() with high priority. * * @param func @@ -111,6 +101,17 @@ static void __attribute__((constructor, used)) func(void) static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void) /** + * Run function before main() with low priority. + * + * The constructor will be run after prioritized constructors. + * + * @param func + * Constructor function. + */ +#define RTE_INIT(func) \ + RTE_INIT_PRIO(func, LAST) + +/** * Force a function to be inlined */ #define __rte_always_inline inline __attribute__((always_inline))