From owner-svn-src-head@freebsd.org Tue Jul 17 08:34:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FED5103072E; Tue, 17 Jul 2018 08:34:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CF8A7AAE5; Tue, 17 Jul 2018 08:34:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A542F89; Tue, 17 Jul 2018 08:34:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6H8Yn6L091424; Tue, 17 Jul 2018 08:34:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6H8Ynrn091423; Tue, 17 Jul 2018 08:34:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201807170834.w6H8Ynrn091423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 17 Jul 2018 08:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336363 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 336363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2018 08:34:50 -0000 Author: hselasky Date: Tue Jul 17 08:34:49 2018 New Revision: 336363 URL: https://svnweb.freebsd.org/changeset/base/336363 Log: Process address resolve requests at least one time per second in ibcore. When setting a large address resolve timeout it was observed that the address resolving would succeed at the timeout and not when the address was available. Make sure the address resolving requests are processed no slower than one time every second. While at it use "int" for jiffies instead of "unsigned long" to match FreeBSD ticks. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_addr.c Tue Jul 17 07:42:14 2018 (r336362) +++ head/sys/ofed/drivers/infiniband/core/ib_addr.c Tue Jul 17 08:34:49 2018 (r336363) @@ -63,7 +63,7 @@ struct addr_req { void *context; void (*callback)(int status, struct sockaddr *src_addr, struct rdma_dev_addr *addr, void *context); - unsigned long timeout; + int timeout; int status; }; @@ -190,13 +190,15 @@ int rdma_translate_ip(const struct sockaddr *addr, } EXPORT_SYMBOL(rdma_translate_ip); -static void set_timeout(unsigned long time) +static void set_timeout(int time) { int delay; /* under FreeBSD ticks are 32-bit */ delay = time - jiffies; if (delay <= 0) delay = 1; + else if (delay > hz) + delay = hz; mod_delayed_work(addr_wq, &work, delay); }