From owner-svn-src-projects@FreeBSD.ORG Fri Aug 13 03:10:48 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE33B1065673; Fri, 13 Aug 2010 03:10:48 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDC328FC17; Fri, 13 Aug 2010 03:10:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7D3AmUC075873; Fri, 13 Aug 2010 03:10:48 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7D3Amdo075871; Fri, 13 Aug 2010 03:10:48 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201008130310.o7D3Amdo075871@svn.freebsd.org> From: Jeff Roberson Date: Fri, 13 Aug 2010 03:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211260 - projects/ofed/head/sys/ofed/include/linux/mlx4 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Aug 2010 03:10:49 -0000 Author: jeff Date: Fri Aug 13 03:10:48 2010 New Revision: 211260 URL: http://svn.freebsd.org/changeset/base/211260 Log: - Just check the direct buf pointer against NULL rather than assuming it will be set for 64bit systems. This works in more cases. On BSD we may not allocate a direct map for a large non-contiguous region to avoid the vm address space allocator expense. Sponsored by: Isilon Systems, iX Systems, and Panasas. Modified: projects/ofed/head/sys/ofed/include/linux/mlx4/device.h Modified: projects/ofed/head/sys/ofed/include/linux/mlx4/device.h ============================================================================== --- projects/ofed/head/sys/ofed/include/linux/mlx4/device.h Fri Aug 13 03:09:08 2010 (r211259) +++ projects/ofed/head/sys/ofed/include/linux/mlx4/device.h Fri Aug 13 03:10:48 2010 (r211260) @@ -497,7 +497,7 @@ int mlx4_buf_alloc(struct mlx4_dev *dev, void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset) { - if (BITS_PER_LONG == 64 || buf->nbufs == 1) + if (buf->direct.buf != NULL) return buf->direct.buf + offset; else return buf->page_list[offset >> PAGE_SHIFT].buf +