X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Fklnds%2Fsocklnd%2Fsocklnd_lib-linux.h;h=379892c0d49f527e6a8ae060baa377fd8c444b61;hp=50dec134997683dccb69a2425fca13e98e73673c;hb=08aa217ce49aba1ded52e0f7adb8a607035123fd;hpb=6869932b552ac705f411de3362f01bd50c1f6f7d diff --git a/lnet/klnds/socklnd/socklnd_lib-linux.h b/lnet/klnds/socklnd/socklnd_lib-linux.h index 50dec13..379892c 100644 --- a/lnet/klnds/socklnd/socklnd_lib-linux.h +++ b/lnet/klnds/socklnd/socklnd_lib-linux.h @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,8 +24,10 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * 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/ @@ -35,16 +35,10 @@ */ #define DEBUG_PORTAL_ALLOC -#ifndef EXPORT_SYMTAB -# define EXPORT_SYMTAB -#endif #ifndef __LINUX_SOCKNAL_LIB_H__ #define __LINUX_SOCKNAL_LIB_H__ -#ifndef AUTOCONF_INCLUDED -#include -#endif #include #include #include @@ -52,13 +46,12 @@ #include #include #include -#include #include #include #include #include +#include -#include #include #include @@ -71,10 +64,7 @@ #include #include #include - -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) -# include -#endif +#include #include #include @@ -91,67 +81,11 @@ static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len) #endif } -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,7)) -# define SOCKNAL_WSPACE(sk) sk_stream_wspace(sk) -# define SOCKNAL_MIN_WSPACE(sk) sk_stream_min_wspace(sk) -#else -# define SOCKNAL_WSPACE(sk) tcp_wspace(sk) -# define SOCKNAL_MIN_WSPACE(sk) (((sk)->sk_sndbuf*8)/10) -#endif - -#ifndef CONFIG_SMP -static inline -int ksocknal_nsched(void) -{ - return 1; -} -#else -#include -# if !(defined(CONFIG_X86) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,21))) || defined(CONFIG_X86_64) || ((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && !defined(CONFIG_X86_HT)) -static inline int -ksocknal_nsched(void) -{ - return num_online_cpus(); -} +#define SOCKNAL_WSPACE(sk) sk_stream_wspace(sk) +#define SOCKNAL_MIN_WSPACE(sk) sk_stream_min_wspace(sk) -static inline int -ksocknal_sched2cpu(int i) -{ - return i; -} - -static inline int -ksocknal_irqsched2cpu(int i) -{ - return i; -} -# else -static inline int -ksocknal_nsched(void) -{ - if (smp_num_siblings == 1) - return (num_online_cpus()); - - /* We need to know if this assumption is crap */ - LASSERT (smp_num_siblings == 2); - return (num_online_cpus()/2); -} - -static inline int -ksocknal_sched2cpu(int i) -{ - if (smp_num_siblings == 1) - return i; - - return (i * 2); -} - -static inline int -ksocknal_irqsched2cpu(int i) -{ - return (ksocknal_sched2cpu(i) + 1); -} -# endif -#endif +/* assume one thread for each connection type */ +#define SOCKNAL_NSCHEDS 3 +#define SOCKNAL_NSCHEDS_HIGH (SOCKNAL_NSCHEDS << 1) #endif