From patchwork Tue May 7 05:17:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adit Ranadive X-Patchwork-Id: 10932281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C29A1575 for ; Tue, 7 May 2019 05:17:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C5B928879 for ; Tue, 7 May 2019 05:17:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2ED7F2888E; Tue, 7 May 2019 05:17:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6C8328879 for ; Tue, 7 May 2019 05:17:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726337AbfEGFRv (ORCPT ); Tue, 7 May 2019 01:17:51 -0400 Received: from mail-eopbgr760049.outbound.protection.outlook.com ([40.107.76.49]:45488 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725843AbfEGFRv (ORCPT ); Tue, 7 May 2019 01:17:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YuGJ8uavJ/PT9hHqbHv5rxWTGixXoa1FBnB/mFUUjX0=; b=nTaEm1JGn+aYrvwyweXD2Kp+wX4PEweuFhSkJ4/6uKnOSFrk7fWRHfJO4PcHw1NUlK6xjbI6SOtYzqInLGtsF/MOfB5bj+xWvwkl7dBh1aP+DABS11H2qWtFodMIMcoqaBDfW+VqOrxtiiZIhXHGVRpY+mMu06wG5RRz0jwIZpQ= Received: from BYAPR05MB5511.namprd05.prod.outlook.com (20.177.186.28) by BYAPR05MB4182.namprd05.prod.outlook.com (52.135.200.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.19; Tue, 7 May 2019 05:17:46 +0000 Received: from BYAPR05MB5511.namprd05.prod.outlook.com ([fe80::f0e2:4d9d:b09b:def5]) by BYAPR05MB5511.namprd05.prod.outlook.com ([fe80::f0e2:4d9d:b09b:def5%7]) with mapi id 15.20.1878.019; Tue, 7 May 2019 05:17:46 +0000 From: Adit Ranadive To: "linux-rdma@vger.kernel.org" , "jgg@mellanox.com" , "dledford@redhat.com" CC: Adit Ranadive Subject: [PATCH] libibverbs: Expose the get neighbor timeout for dmac resolution Thread-Topic: [PATCH] libibverbs: Expose the get neighbor timeout for dmac resolution Thread-Index: AQHVBJQ03rON3H5UMUmK3O/KPKwCrg== Date: Tue, 7 May 2019 05:17:45 +0000 Message-ID: <20190507051537.2161-1-aditr@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BY5PR03CA0023.namprd03.prod.outlook.com (2603:10b6:a03:1e0::33) To BYAPR05MB5511.namprd05.prod.outlook.com (2603:10b6:a03:1a::28) x-mailer: git-send-email 2.17.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=aditr@vmware.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [66.170.99.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 57a8de1f-958c-43ca-f216-08d6d2ab56c1 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020);SRVR:BYAPR05MB4182; x-ms-traffictypediagnostic: BYAPR05MB4182: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 0030839EEE x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(376002)(396003)(136003)(366004)(39860400002)(199004)(189003)(50226002)(14454004)(966005)(305945005)(8936002)(5660300002)(14444005)(25786009)(66066001)(71190400001)(256004)(8676002)(386003)(2501003)(6506007)(81166006)(7736002)(64756008)(66446008)(66556008)(66476007)(66946007)(478600001)(107886003)(4326008)(102836004)(73956011)(81156014)(53936002)(1076003)(316002)(6116002)(3846002)(99286004)(2906002)(26005)(52116002)(71200400001)(110136005)(68736007)(486006)(6486002)(86362001)(2616005)(36756003)(2201001)(6512007)(6436002)(476003)(186003)(6306002);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB4182;H:BYAPR05MB5511.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ByJhciBxISAqRJCcAgIBHXK7JxO2Pue31b6K8X3NPm5yXpjSqVS+PYn6NBlIpKdVLN3pydluFXPwKnyz75ZJlIgAMnoJA6aZZB3sprQKIHqYPoYHiLM3qF3TcM1p6tZCwPLm5+xK07OfuFpuQgAdfInYZMvspDfruG/WwTzBkFMPvx0VxGpLd1EWhosYoWgIlHqeGrJmPH7RlHYhHyXKwb1jbUTJF8pfTLyO5afZ2j4EU7HjQX3fl0fq83kbjyh0BkZ/Vv1BrcTU5hOGg+AmV0qOhESLWh+ldESb+rt3JC8YK9gp/d60ODrC33uGMyS5UCTR+QUZ9BmRVP85UgBEBllQcOgmUSjdzwJQ4aMmKuSKf/REwgTF/BtxLd96h/wPk65xFCZehTM9DDtAiveEhQdSPQo7Qb0qM+WPfzJcznI= MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57a8de1f-958c-43ca-f216-08d6d2ab56c1 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 May 2019 05:17:45.9053 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4182 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This allows the neighbor timeout to be configured while building rdma-core using the extra cmake flags. Reviewed-by: Jorgen Hansen Reviewed-by: Vishnu Dasa Signed-off-by: Adit Ranadive --- CMakeLists.txt | 6 ++++++ buildlib/config.h.in | 2 ++ libibverbs/verbs.c | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) --- Here is the PR: https://github.com/linux-rdma/rdma-core/pull/524 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index beb8f4ec1238..8dbdd2b807f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,8 @@ # -DNO_PYVERBS=1 (default, build pyverbs) # Invoke cython to build pyverbs. Usually you will run with this option # is set, but it will be disabled for travis runs. +# -DNEIGH_GET_DEFAULT_TIMEOUT_MS=3000 (default) +# Set the default timeout for lookup of neighbor for mac address. cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR) project(rdma-core C) @@ -84,6 +86,10 @@ if (IN_PLACE) set(CMAKE_INSTALL_INCLUDEDIR "include") endif() +if ("${NEIGH_GET_DEFAULT_TIMEOUT_MS}" STREQUAL "") + set(NEIGH_GET_DEFAULT_TIMEOUT_MS 3000) +endif() + include(GNUInstallDirs) # C include root set(BUILD_INCLUDE ${CMAKE_BINARY_DIR}/include) diff --git a/buildlib/config.h.in b/buildlib/config.h.in index 0754d2494234..590e70162d1e 100644 --- a/buildlib/config.h.in +++ b/buildlib/config.h.in @@ -61,6 +61,8 @@ # define VERBS_WRITE_ONLY 0 #endif +# define NEIGH_GET_DEFAULT_TIMEOUT_MS @NEIGH_GET_DEFAULT_TIMEOUT_MS@ + // Configuration defaults #define IBACM_SERVER_MODE_UNIX 0 diff --git a/libibverbs/verbs.c b/libibverbs/verbs.c index 1766b9f52d31..2cab86184e32 100644 --- a/libibverbs/verbs.c +++ b/libibverbs/verbs.c @@ -967,7 +967,6 @@ static inline int create_peer_from_gid(int family, void *raw_gid, return 0; } -#define NEIGH_GET_DEFAULT_TIMEOUT_MS 3000 int ibv_resolve_eth_l2_from_gid(struct ibv_context *context, struct ibv_ah_attr *attr, uint8_t eth_mac[ETHERNET_LL_SIZE],