From owner-svn-src-head@FreeBSD.ORG Sun May 10 22:21:01 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F30391B6; Sun, 10 May 2015 22:21:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E171812D6; Sun, 10 May 2015 22:21:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4AML0Rh003856; Sun, 10 May 2015 22:21:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4AML0BR003855; Sun, 10 May 2015 22:21:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201505102221.t4AML0BR003855@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 10 May 2015 22:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282743 - head/sys/ofed/include/linux X-SVN-Group: head 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.20 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: Sun, 10 May 2015 22:21:01 -0000 Author: markj Date: Sun May 10 22:21:00 2015 New Revision: 282743 URL: https://svnweb.freebsd.org/changeset/base/282743 Log: msecs_to_jiffies() is implemented using tvtohz(9), which always returns a positive value since it adds the current tick to its result. This differs from the behaviour in Linux, whose implementation does not add the extra tick, so subtract the extra tick in the OFED compat layer implementation. This addresses some incorrect handling of IB MAD timeouts, since some IB code depends on msecs_to_jiffies(0) returning 0. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ofed/include/linux/jiffies.h Modified: head/sys/ofed/include/linux/jiffies.h ============================================================================== --- head/sys/ofed/include/linux/jiffies.h Sun May 10 22:07:53 2015 (r282742) +++ head/sys/ofed/include/linux/jiffies.h Sun May 10 22:21:00 2015 (r282743) @@ -42,7 +42,7 @@ msecs_to_jiffies(int msec) tv.tv_sec = msec / 1000; tv.tv_usec = (msec % 1000) * 1000; - return (tvtohz(&tv)); + return (tvtohz(&tv) - 1); } #define jiffies ticks