From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id B326CC364 for ; Tue, 30 Jun 2015 11:28:36 +0200 (CEST) Received: by wgjx7 with SMTP id x7so4209426wgj.2 for ; Tue, 30 Jun 2015 02:28:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qcll7noLkF385UYYa6aF0bhLN06yR9J5Urhaqzysvpo=; b=Kh9ht8ylLit1+U9lYqo90aNcnkQd05EpDBCdOSG8R6inUrTcjdjLHTCyLwex+EMLSJ ZDYD1Gw20gIZA7OL0TPXHB3q9T9JsNDZMiLkIDRUvMuCINBpxhdtwloIXVM/P8mhdY13 vhf1vFakGTJuC77hIkGmY4Yxad67l1vtBrfQBio2g2eg7ah+oI1lUf1Hckn25RR86uPG pe+w+5C8aapgSx5Tt3Ou1rYBn7ZibP9IBipEA7WefiA1ao/1JR/TfPy2ZLv0fME1KAvt U2/pCLvkYWprwn5PlDaOO4P28SeKCAz1xEpl8iSozE2F/Irx+bYEC5JhmpbVhpuWABf1 +0yA== X-Gm-Message-State: ALoCoQkIQ0+h0iOO6kPPUk9TBr9BtgRiyjr9ClgBB/d1MwsZmt5G8fSUwVYLSZtMZKvI5Msp/XRd X-Received: by 10.180.84.202 with SMTP id b10mr31770346wiz.23.1435656516636; Tue, 30 Jun 2015 02:28:36 -0700 (PDT) Received: from 6wind.com (6wind.net2.nerim.net. [213.41.151.210]) by mx.google.com with ESMTPSA id q4sm67905716wju.14.2015.06.30.02.28.35 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Jun 2015 02:28:35 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Date: Tue, 30 Jun 2015 11:27:52 +0200 Message-Id: <1435656489-27986-7-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1435656489-27986-1-git-send-email-adrien.mazarguil@6wind.com> References: <1433546120-2254-1-git-send-email-adrien.mazarguil@6wind.com> <1435656489-27986-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH v2 06/23] mlx4: allow applications to partially use fork() 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: Tue, 30 Jun 2015 09:28:37 -0000 From: Olga Shern 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 --- drivers/net/mlx4/mlx4.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 8be1574..ed68beb 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; } -- 2.1.0