2 * Copyright (C) 2009-2012 Cray, Inc.
4 * Copyright (c) 2014, Intel Corporation.
6 * Author: Nic Henke <nic@cray.com>, James Shimek <jshimek@cray.com>
8 * This file is part of Lustre, http://www.lustre.org.
10 * Lustre is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU General Public
12 * License as published by the Free Software Foundation.
14 * Lustre is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with Lustre; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _GNILND_ARIES_H
25 #define _GNILND_ARIES_H
27 /* for lnet_ipif_query */
28 #include <lnet/lib-lnet.h>
30 #ifndef _GNILND_HSS_OPS_H
31 # error "must include gnilnd_hss_ops.h first"
34 /* Set HW related values */
36 #include <aries/aries_timeouts_gpl.h>
38 /* from aries_timeouts_gpl.h when building for generic kernel */
39 #define TIMEOUT_SECS(x) ((uint64_t)(((x) / 1000.0) + 0.5))
40 #ifndef TO_GNILND_timeout
41 #define TO_GNILND_timeout (60000.000000)
42 #endif /* TO_GNILND_timeout */
43 #endif /* CONFIG_CRAY_XT */
45 #define GNILND_BASE_TIMEOUT TIMEOUT_SECS(TO_GNILND_timeout)
46 #define GNILND_CHECKSUM_DEFAULT 0 /* all off for Aries */
48 #if defined(CONFIG_CRAY_COMPUTE)
49 #define GNILND_REVERSE_RDMA GNILND_REVERSE_PUT
50 #define GNILND_RDMA_DLVR_OPTION GNI_DLVMODE_PERFORMANCE
52 #define GNILND_REVERSE_RDMA GNILND_REVERSE_GET
53 #define GNILND_RDMA_DLVR_OPTION GNI_DLVMODE_PERFORMANCE
54 #define GNILND_SCHED_THREADS 7 /* scheduler threads */
57 /* Thread-safe kgni implemented in minor ver 45, code rev 0xb9 */
58 #define GNILND_KGNI_TS_MINOR_VER 0x45
59 #define GNILND_TS_ENABLE 1
61 /* register some memory to allocate a shared mdd */
62 static inline gni_return_t
63 kgnilnd_register_smdd_buf(kgn_device_t *dev)
65 __u32 flags = GNI_MEM_READWRITE;
67 if (*kgnilnd_tunables.kgn_bte_relaxed_ordering) {
68 flags |= GNI_MEM_RELAXED_PI_ORDERING;
71 LIBCFS_ALLOC(dev->gnd_smdd_hold_buf, PAGE_SIZE);
72 if (!dev->gnd_smdd_hold_buf) {
73 CERROR("Can't allocate smdd hold buffer\n");
74 return GNI_RC_ERROR_RESOURCE;
77 return kgnilnd_mem_register(dev->gnd_handle,
78 (__u64)dev->gnd_smdd_hold_buf,
79 PAGE_SIZE, NULL, flags,
80 &dev->gnd_smdd_hold_hndl);
83 static inline gni_return_t
84 kgnilnd_deregister_smdd_buf(kgn_device_t *dev)
86 gni_return_t rc = kgnilnd_mem_deregister(dev->gnd_handle,
87 &dev->gnd_smdd_hold_hndl, 0);
88 LIBCFS_FREE(dev->gnd_smdd_hold_buf, PAGE_SIZE);
93 #endif /* _GNILND_ARIES_H */