From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 487825948 for ; Fri, 26 Jul 2013 16:40:03 +0200 (CEST) Received: by mail-wg0-f51.google.com with SMTP id e12so981521wgh.30 for ; Fri, 26 Jul 2013 07:40:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=xnAfOnpWs+5Q38NfGpsbxw9bqHRUPWsqZ0touH6+7PQ=; b=OkQuY64LxS/vZvXR5SMYs1Fmnf1169saftwm0DgCSNNnfqB6P3krZANj/IsJQasW5u bpoDZKICkpJxJcJ3DxL7oFme7polmsgHOgKGqhdoXYE4ioE/NG1Rl98tvqoGqR72AesM AejasAuYop0cSUeU+337qAsCfKDDNlqS1OJS15giguOHBy0MhqhTyXv+/mQxWVQCGuYc kyd/N1qBKJi6khM6KmGJXjnyX0gzC+7QX9YbmtvPSosgYBYvuc5nqKgOeRkdnicvCqfT Dls0ugBTtf1Iil9LJNTIHwlDCLZ77EqG3NjXdgMFkQiSTjoOJw7tor9nJkokRZK8eMpn rc3A== X-Received: by 10.180.95.201 with SMTP id dm9mr6010552wib.21.1374849626185; Fri, 26 Jul 2013 07:40:26 -0700 (PDT) Received: from 6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id nb12sm5230600wic.3.2013.07.26.07.40.23 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Fri, 26 Jul 2013 07:40:25 -0700 (PDT) From: Damien Millescamps To: dev@dpdk.org Date: Fri, 26 Jul 2013 16:39:12 +0200 Message-Id: <0e095118447ebbd42f2762edbda8218b13b58a1a.1374849076.git.damien.millescamps@6wind.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQklFDr7hsBThwAhhx+pXoCsWzwPj6/mq7DIrhmSJV5VPhGnRK0Go8eOvXuB7yFxBQ5XIkUj Subject: [dpdk-dev] [PATCH 1/2] mem: get hugepages config 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 Jul 2013 14:40:03 -0000 Allow external libraries and applications to know if hugepages are enabled. Signed-off-by: Thomas Monjalon Signed-off-by: Damien Millescamps --- lib/librte_eal/common/include/rte_eal.h | 13 ++++++++++++- lib/librte_eal/linuxapp/eal/eal.c | 4 ++++ 2 files changed, 16 insertions(+), 1 deletions(-) diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h index 240530d..58a6f90 100644 --- a/lib/librte_eal/common/include/rte_eal.h +++ b/lib/librte_eal/common/include/rte_eal.h @@ -214,7 +214,18 @@ int rte_eal_init(int argc, char **argv); } \ } while(0) - +/** + * Whether EAL is using huge pages (disabled by --no-huge option). + * The no-huge mode cannot be used with UIO poll-mode drivers like igb/ixgbe. + * It is useful for NIC drivers (e.g. librte_pmd_mlx4, librte_pmd_vmxnet3) or + * crypto drivers (e.g. librte_crypto_nitrox) provided by third-parties such + * as 6WIND. + * + * @return + * Nonzero if hugepages are enabled. + */ +int rte_eal_has_hugepages(void); + #ifdef __cplusplus } #endif diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index ed0e9b1..52de2b6 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -945,3 +945,7 @@ rte_eal_process_type(void) return (rte_config.process_type); } +int rte_eal_has_hugepages(void) +{ + return ! internal_config.no_hugetlbfs; +} -- 1.7.2.5