From owner-svn-src-head@freebsd.org Fri Feb 17 13:31:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 066B7CE2A3B; Fri, 17 Feb 2017 13:31:13 +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 mx1.freebsd.org (Postfix) with ESMTPS id ADA6A1CA7; Fri, 17 Feb 2017 13:31:12 +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 v1HDVB0M022362; Fri, 17 Feb 2017 13:31:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1HDVB5A022360; Fri, 17 Feb 2017 13:31:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201702171331.v1HDVB5A022360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 17 Feb 2017 13:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313872 - head/sys/compat/linuxkpi/common/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.23 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: Fri, 17 Feb 2017 13:31:13 -0000 Author: hselasky Date: Fri Feb 17 13:31:11 2017 New Revision: 313872 URL: https://svnweb.freebsd.org/changeset/base/313872 Log: Implement GFP_DMA32 flag in the LinuxKPI. Define all FreeBSD native GFP bits as GFP_NATIVE_MASK. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h head/sys/compat/linuxkpi/common/include/linux/gfp.h Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Fri Feb 17 12:47:51 2017 (r313871) +++ head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Fri Feb 17 13:31:11 2017 (r313872) @@ -129,8 +129,10 @@ dma_alloc_coherent(struct device *dev, s if (dev->dma_mask) high = *dev->dma_mask; - else + else if (flag & GFP_DMA32) high = BUS_SPACE_MAXADDR_32BIT; + else + high = BUS_SPACE_MAXADDR; align = PAGE_SIZE << get_order(size); mem = (void *)kmem_alloc_contig(kmem_arena, size, flag, 0, high, align, 0, VM_MEMATTR_DEFAULT); Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/gfp.h Fri Feb 17 12:47:51 2017 (r313871) +++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Fri Feb 17 13:31:11 2017 (r313872) @@ -53,7 +53,7 @@ #define __GFP_IO 0 #define __GFP_NO_KSWAPD 0 #define __GFP_WAIT M_WAITOK -#define __GFP_DMA32 0 +#define __GFP_DMA32 (1U << 24) /* LinuxKPI only */ #define GFP_NOWAIT M_NOWAIT #define GFP_ATOMIC (M_NOWAIT | M_USE_RESERVE) @@ -63,8 +63,9 @@ #define GFP_HIGHUSER_MOVABLE M_WAITOK #define GFP_IOFS M_NOWAIT #define GFP_NOIO M_NOWAIT -#define GFP_DMA32 0 +#define GFP_DMA32 __GFP_DMA32 #define GFP_TEMPORARY M_NOWAIT +#define GFP_NATIVE_MASK (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_ZERO) static inline void * page_address(struct page *page)