lnet/doc/Makefile
lnet/include/Makefile
lnet/include/lnet/Makefile
-lnet/include/lnet/linux/Makefile
lnet/klnds/Makefile
lnet/klnds/autoMakefile
lnet/klnds/mxlnd/autoMakefile
lnetdir=$(includedir)/lnet
-SUBDIRS = linux
-DIST_SUBDIRS = linux
-
EXTRA_DIST = \
api.h \
lib-dlc.h \
#ifndef __LNET_LIB_LNET_H__
#define __LNET_LIB_LNET_H__
-#include <lnet/linux/lib-lnet.h>
+#define LNET_ROUTER
#include <libcfs/libcfs.h>
#include <lnet/types.h>
#ifndef __LNET_LIB_TYPES_H__
#define __LNET_LIB_TYPES_H__
-#include <lnet/linux/lib-types.h>
+#ifdef __KERNEL__
+# include <linux/uio.h>
+# include <linux/types.h>
+#else /* !__KERNEL__ */
+# define LNET_USE_LIB_FREELIST
+# include <sys/types.h>
+#endif /* __KERNEL__ */
#include <libcfs/libcfs.h>
#include <libcfs/list.h>
+++ /dev/null
-/Makefile.in
+++ /dev/null
-EXTRA_DIST = lib-lnet.h lib-types.h lnet.h
+++ /dev/null
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#ifndef __LNET_LINUX_LIB_LNET_H__
-#define __LNET_LINUX_LIB_LNET_H__
-
-#ifndef __LNET_LIB_LNET_H__
-#error Do not #include this file directly. #include <lnet/lib-lnet.h> instead
-#endif
-
-#ifdef __KERNEL__
-# include <asm/page.h>
-# include <linux/string.h>
-# include <asm/io.h>
-# include <libcfs/libcfs.h>
-
-static inline __u64
-lnet_page2phys (struct page *p)
-{
- /* compiler optimizer will elide unused branches */
-
- switch (sizeof(typeof(page_to_phys(p)))) {
- case 4:
- /* page_to_phys returns a 32 bit physical address. This must
- * be a 32 bit machine with <= 4G memory and we must ensure we
- * don't sign extend when converting to 64 bits. */
- return (unsigned long)page_to_phys(p);
-
- case 8:
- /* page_to_phys returns a 64 bit physical address :) */
- return page_to_phys(p);
-
- default:
- LBUG();
- return 0;
- }
-}
-
-#else /* __KERNEL__ */
-# include <libcfs/list.h>
-# include <string.h>
-# ifdef HAVE_LIBPTHREAD
-# include <pthread.h>
-# endif
-#endif
-
-#define LNET_ROUTER
-
-#endif /* __LNET_LINUX_LIB_LNET_H__ */
+++ /dev/null
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#ifndef __LNET_LINUX_LIB_TYPES_H__
-#define __LNET_LINUX_LIB_TYPES_H__
-
-#ifndef __LNET_LIB_TYPES_H__
-#error Do not #include this file directly. #include <lnet/lib-types.h> instead
-#endif
-
-#ifdef __KERNEL__
-# include <linux/uio.h>
-# include <linux/types.h>
-#else
-# define LNET_USE_LIB_FREELIST
-# include <sys/types.h>
-#endif
-
-#endif
+++ /dev/null
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2011, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#ifndef __LNET_LINUX_LNET_H__
-#define __LNET_LINUX_LNET_H__
-
-#ifndef __LNET_H__
-#error Do not #include this file directly. #include <lnet/lnet.h> instead
-#endif
-
-/*
- * lnet.h
- *
- * User application interface file
- */
-
-#if defined (__KERNEL__)
-#include <linux/uio.h>
-#include <linux/types.h>
-
-#ifdef HAVE_TCP_SENDPAGE_USE_SOCKET
-#define cfs_tcp_sendpage(sk, page, offset, size, flags) \
- tcp_sendpage((sk)->sk_socket, page, offset, size, flags)
-#else
-#define cfs_tcp_sendpage(sk, page, offset, size, flags) \
- tcp_sendpage(sk, page, offset, size, flags)
-#endif
-#else
-#include <sys/types.h>
-#include <sys/uio.h>
-#endif
-
-#endif
*
* User application interface file
*/
-#include <lnet/linux/lnet.h>
#include <lnet/types.h>
#include <lnet/api.h>
*
*/
+#include <asm/page.h>
#include <linux/nmi.h>
#include "gnilnd.h"
"nkiov %u offset %u\n",
kiov->kiov_page, kiov->kiov_offset, kiov->kiov_len, nob, nkiov, offset);
- phys->address = lnet_page2phys(kiov->kiov_page);
+ phys->address = page_to_phys(kiov->kiov_page);
phys++;
kiov++;
nkiov--;
* Author: Scott Atchley <atchley at myri.com>
*/
+#include <asm/page.h>
#include "mxlnd.h"
mx_endpoint_addr_t MX_EPA_NULL; /* use to determine if an endpoint is NULL */
ctx->mxc_nseg = niov;
sum = 0;
for (i = 0; i < niov; i++) {
- seg[i].segment_ptr = lnet_page2phys(kiov[first_kiov + i].kiov_page);
+ seg[i].segment_ptr =
+ page_to_phys(kiov[first_kiov + i].kiov_page);
seg[i].segment_length = kiov[first_kiov + i].kiov_len;
if (i == 0) {
seg[i].segment_ptr += (u64) first_kiov_offset;
* Author: Eric Barton <eric@bartonsoftware.com>
*/
+#include <asm/page.h>
#include "o2iblnd.h"
static lnd_t the_o2iblnd;
rx->rx_msgaddr));
KIBLND_UNMAP_ADDR_SET(rx, rx_msgunmap, rx->rx_msgaddr);
- CDEBUG(D_NET,"rx %d: %p "LPX64"("LPX64")\n",
- i, rx->rx_msg, rx->rx_msgaddr,
- lnet_page2phys(pg) + pg_off);
+ CDEBUG(D_NET, "rx %d: %p "LPX64"("LPX64")\n",
+ i, rx->rx_msg, rx->rx_msgaddr,
+ (__u64)(page_to_phys(pg) + pg_off));
pg_off += IBLND_MSG_SIZE;
LASSERT (pg_off <= PAGE_SIZE);
* Author: Eric Barton <eric@bartonsoftware.com>
*/
+#include <asm/page.h>
#include "ralnd.h"
void
tx->tx_nob = nob;
tx->tx_buffer = (void *)((unsigned long)(kiov->kiov_offset + offset));
- phys->Address = lnet_page2phys(kiov->kiov_page);
+ phys->Address = page_to_phys(kiov->kiov_page);
phys++;
resid = nob - (kiov->kiov_len - offset);
return -EMSGSIZE;
}
- phys->Address = lnet_page2phys(kiov->kiov_page);
+ phys->Address = page_to_phys(kiov->kiov_page);
phys++;
resid -= PAGE_SIZE;
MODULES := ksocklnd
-ksocklnd-objs := socklnd.o socklnd_cb.o socklnd_proto.o socklnd_modparams.o socklnd_lib-linux.o
+ksocklnd-objs := \
+ socklnd.o \
+ socklnd_cb.o \
+ socklnd_lib.o \
+ socklnd_modparams.o \
+ socklnd_proto.o
@INCLUDE_RULES@
if MODULES
-if LINUX
-
- modulenet_DATA := ksocklnd$(KMODEXT)
-
-endif # LINUX
+modulenet_DATA := ksocklnd$(KMODEXT)
endif # MODULES
-EXTRA_DIST := $(ksocklnd-objs:%.o=%.c) socklnd_lib-linux.h socklnd.h
+EXTRA_DIST := $(ksocklnd-objs:%.o=%.c) socklnd.h
-MOSTLYCLEANFILES = @MOSTLYCLEANFILES@ socklnd_lib.c
+MOSTLYCLEANFILES = @MOSTLYCLEANFILES@
*
*/
+#ifndef _SOCKLND_SOCKLND_H_
+#define _SOCKLND_SOCKLND_H_
+
#define DEBUG_PORTAL_ALLOC
#define DEBUG_SUBSYSTEM S_LND
-#include "socklnd_lib-linux.h"
+#include <asm/irq.h>
+#include <linux/crc32.h>
+#include <linux/errno.h>
+#include <linux/if.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/kmod.h>
+#include <linux/list.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/stat.h>
+#include <linux/string.h>
+#include <linux/syscalls.h>
+#include <linux/sysctl.h>
+#include <linux/uio.h>
+#include <linux/unistd.h>
+#include <net/sock.h>
+#include <net/tcp.h>
#include <libcfs/libcfs.h>
#include <lnet/lnet.h>
#include <lnet/lib-lnet.h>
#include <lnet/socklnd.h>
+#ifdef HAVE_TCP_SENDPAGE_USE_SOCKET
+# define cfs_tcp_sendpage(sk, page, offset, size, flags) \
+ tcp_sendpage((sk)->sk_socket, page, offset, size, flags)
+#else /* !HAVE_TCP_SENDPAGE_USE_SOCKET */
+# define cfs_tcp_sendpage(sk, page, offset, size, flags) \
+ tcp_sendpage(sk, page, offset, size, flags)
+#endif /* HAVE_TCP_SENDPAGE_USE_SOCKET */
+
+/* assume one thread for each connection type */
+#define SOCKNAL_NSCHEDS 3
+#define SOCKNAL_NSCHEDS_HIGH (SOCKNAL_NSCHEDS << 1)
+
#define SOCKNAL_PEER_HASH_SIZE 101 /* # peer lists */
#define SOCKNAL_RESCHED 100 /* # scheduler loops before reschedule */
#define SOCKNAL_INSANITY_RECONN 5000 /* connd is trying on reconn infinitely */
#define CPU_MASK_NONE 0UL
#endif
+static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len)
+{
+#if 1
+ return crc32_le(crc, p, len);
+#else
+ while (len-- > 0)
+ crc = ((crc + 0x100) & ~0xff) | ((crc + *p++) & 0xff) ;
+
+ return crc;
+#endif
+}
+
static inline int
ksocknal_route_mask(void)
{
extern int ksocknal_lib_memory_pressure(ksock_conn_t *conn);
extern int ksocknal_lib_bind_thread_to_cpu(int id);
+
+#endif /* _SOCKLND_SOCKLND_H_ */
+++ /dev/null
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2012, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#define DEBUG_PORTAL_ALLOC
-
-#ifndef __LINUX_SOCKNAL_LIB_H__
-#define __LINUX_SOCKNAL_LIB_H__
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/version.h>
-#include <linux/mm.h>
-#include <linux/string.h>
-#include <linux/stat.h>
-#include <linux/errno.h>
-#include <linux/unistd.h>
-#include <net/sock.h>
-#include <net/tcp.h>
-#include <linux/uio.h>
-#include <linux/if.h>
-
-#include <asm/uaccess.h>
-#include <asm/irq.h>
-
-#include <linux/init.h>
-#include <linux/fs.h>
-#include <linux/file.h>
-#include <linux/stat.h>
-#include <linux/list.h>
-#include <linux/kmod.h>
-#include <linux/sysctl.h>
-#include <asm/uaccess.h>
-#include <asm/div64.h>
-#include <linux/syscalls.h>
-
-#include <libcfs/libcfs.h>
-
-#include <linux/crc32.h>
-static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len)
-{
-#if 1
- return crc32_le(crc, p, len);
-#else
- while (len-- > 0)
- crc = ((crc + 0x100) & ~0xff) | ((crc + *p++) & 0xff) ;
- return crc;
-#endif
-}
-
-#define SOCKNAL_WSPACE(sk) sk_stream_wspace(sk)
-#define SOCKNAL_MIN_WSPACE(sk) sk_stream_min_wspace(sk)
-
-/* assume one thread for each connection type */
-#define SOCKNAL_NSCHEDS 3
-#define SOCKNAL_NSCHEDS_HIGH (SOCKNAL_NSCHEDS << 1)
-
-#endif
read_lock(&ksocknal_data.ksnd_global_lock);
conn = sk->sk_user_data;
- wspace = SOCKNAL_WSPACE(sk);
- min_wpace = SOCKNAL_MIN_WSPACE(sk);
+ wspace = sk_stream_wspace(sk);
+ min_wpace = sk_stream_min_wspace(sk);
CDEBUG(D_NET, "sk %p wspace %d low water %d conn %p%s%s%s\n",
sk, wspace, min_wpace, conn,