From: Olga Shern Date: Tue, 30 Jun 2015 09:27:52 +0000 (+0200) Subject: mlx4: allow application to partially fork X-Git-Tag: spdx-start~8901 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=643777a171acc19b578ba867db12774986585a4d;p=dpdk.git mlx4: allow application to partially fork Although using the PMD from a forked process is still unsupported, this commit makes Verbs safe enough for applications to call fork() for other purposes. Signed-off-by: Olga Shern Signed-off-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 8be1574b03..ed68bebaa5 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -4686,6 +4686,14 @@ rte_mlx4_pmd_init(const char *name, const char *args) { (void)name; (void)args; + /* + * RDMAV_HUGEPAGES_SAFE tells ibv_fork_init() we intend to use + * huge pages. Calling ibv_fork_init() during init allows + * applications to use fork() safely for purposes other than + * using this PMD, which is not supported in forked processes. + */ + setenv("RDMAV_HUGEPAGES_SAFE", "1", 1); + ibv_fork_init(); rte_eal_pci_register(&mlx4_driver.pci_drv); return 0; }