X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Fklnds%2Fsocklnd%2Fsocklnd_modparams.c;h=2244c525a6cc081b8f450229cbe77e56fdd49768;hp=917d4d7ee87513883c3ef5f3365368a534712960;hb=9c6ebfd11be1cc11629a2960c8c818492e1f0980;hpb=ed88907a96ba81d3558e71ade9def98bdc785169 diff --git a/lnet/klnds/socklnd/socklnd_modparams.c b/lnet/klnds/socklnd/socklnd_modparams.c index 917d4d7..2244c52 100644 --- a/lnet/klnds/socklnd/socklnd_modparams.c +++ b/lnet/klnds/socklnd/socklnd_modparams.c @@ -1,7 +1,8 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: +/* + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * + * Copyright (c) 2011, 2012, Intel Corporation. * - * Copyright (C) 2001, 2002 Cluster File Systems, Inc. * Author: Eric Barton * * Portals is free software; you can redistribute it and/or @@ -32,9 +33,27 @@ static int peer_credits = 8; CFS_MODULE_PARM(peer_credits, "i", int, 0444, "# concurrent sends to 1 peer"); +static int peer_buffer_credits = 0; +CFS_MODULE_PARM(peer_buffer_credits, "i", int, 0444, + "# per-peer router buffer credits"); + +static int peer_timeout = 180; +CFS_MODULE_PARM(peer_timeout, "i", int, 0444, + "Seconds without aliveness news to declare peer dead (<=0 to disable)"); + +/* Number of daemons in each thread pool which is percpt, + * we will estimate reasonable value based on CPUs if it's not set. */ +static unsigned int nscheds; +CFS_MODULE_PARM(nscheds, "i", int, 0444, + "# scheduler daemons in each pool while starting"); + static int nconnds = 4; CFS_MODULE_PARM(nconnds, "i", int, 0444, - "# connection daemons"); + "# connection daemons while starting"); + +static int nconnds_max = 64; +CFS_MODULE_PARM(nconnds_max, "i", int, 0444, + "max # connection daemons"); static int min_reconnectms = 1000; CFS_MODULE_PARM(min_reconnectms, "i", int, 0644, @@ -82,15 +101,19 @@ static int nagle = 0; CFS_MODULE_PARM(nagle, "i", int, 0644, "enable NAGLE?"); +static int round_robin = 1; +CFS_MODULE_PARM(round_robin, "i", int, 0644, + "Round robin for multiple interfaces"); + +static int keepalive = 30; +CFS_MODULE_PARM(keepalive, "i", int, 0644, + "# seconds before send keepalive"); + static int keepalive_idle = 30; CFS_MODULE_PARM(keepalive_idle, "i", int, 0644, "# idle seconds before probe"); -#ifdef HAVE_BGL_SUPPORT -#define DEFAULT_KEEPALIVE_COUNT 100 -#else #define DEFAULT_KEEPALIVE_COUNT 5 -#endif static int keepalive_count = DEFAULT_KEEPALIVE_COUNT; CFS_MODULE_PARM(keepalive_count, "i", int, 0644, "# missed probes == dead"); @@ -107,14 +130,26 @@ static int inject_csum_error = 0; CFS_MODULE_PARM(inject_csum_error, "i", int, 0644, "set non-zero to inject a checksum error"); #ifdef CPU_AFFINITY -static int enable_irq_affinity = 1; +static int enable_irq_affinity = 0; CFS_MODULE_PARM(enable_irq_affinity, "i", int, 0644, "enable IRQ affinity"); #endif -static unsigned int zc_min_frag = (2<<10); -CFS_MODULE_PARM(zc_min_frag, "i", int, 0644, - "minimum fragment to zero copy"); +static int nonblk_zcack = 1; +CFS_MODULE_PARM(nonblk_zcack, "i", int, 0644, + "always send ZC-ACK on non-blocking connection"); + +static unsigned int zc_min_payload = (16 << 10); +CFS_MODULE_PARM(zc_min_payload, "i", int, 0644, + "minimum payload size to zero copy"); + +static unsigned int zc_recv = 0; +CFS_MODULE_PARM(zc_recv, "i", int, 0644, + "enable ZC recv for Chelsio driver"); + +static unsigned int zc_recv_min_nfrags = 16; +CFS_MODULE_PARM(zc_recv_min_nfrags, "i", int, 0644, + "minimum # of fragments to enable ZC recv"); #ifdef SOCKNAL_BACKOFF static int backoff_init = 3; @@ -126,31 +161,77 @@ CFS_MODULE_PARM(backoff_max, "i", int, 0644, "seconds for maximum tcp backoff"); #endif -ksock_tunables_t ksocknal_tunables = { - .ksnd_timeout = &sock_timeout, - .ksnd_credits = &credits, - .ksnd_peercredits = &peer_credits, - .ksnd_nconnds = &nconnds, - .ksnd_min_reconnectms = &min_reconnectms, - .ksnd_max_reconnectms = &max_reconnectms, - .ksnd_eager_ack = &eager_ack, - .ksnd_typed_conns = &typed_conns, - .ksnd_min_bulk = &min_bulk, - .ksnd_tx_buffer_size = &tx_buffer_size, - .ksnd_rx_buffer_size = &rx_buffer_size, - .ksnd_nagle = &nagle, - .ksnd_keepalive_idle = &keepalive_idle, - .ksnd_keepalive_count = &keepalive_count, - .ksnd_keepalive_intvl = &keepalive_intvl, - .ksnd_enable_csum = &enable_csum, - .ksnd_inject_csum_error = &inject_csum_error, - .ksnd_zc_min_frag = &zc_min_frag, +#if SOCKNAL_VERSION_DEBUG +static int protocol = 3; +CFS_MODULE_PARM(protocol, "i", int, 0644, + "protocol version"); +#endif + +ksock_tunables_t ksocknal_tunables; + +int ksocknal_tunables_init(void) +{ + + /* initialize ksocknal_tunables structure */ + ksocknal_tunables.ksnd_timeout = &sock_timeout; + ksocknal_tunables.ksnd_nscheds = &nscheds; + ksocknal_tunables.ksnd_nconnds = &nconnds; + ksocknal_tunables.ksnd_nconnds_max = &nconnds_max; + ksocknal_tunables.ksnd_min_reconnectms = &min_reconnectms; + ksocknal_tunables.ksnd_max_reconnectms = &max_reconnectms; + ksocknal_tunables.ksnd_eager_ack = &eager_ack; + ksocknal_tunables.ksnd_typed_conns = &typed_conns; + ksocknal_tunables.ksnd_min_bulk = &min_bulk; + ksocknal_tunables.ksnd_tx_buffer_size = &tx_buffer_size; + ksocknal_tunables.ksnd_rx_buffer_size = &rx_buffer_size; + ksocknal_tunables.ksnd_nagle = &nagle; + ksocknal_tunables.ksnd_round_robin = &round_robin; + ksocknal_tunables.ksnd_keepalive = &keepalive; + ksocknal_tunables.ksnd_keepalive_idle = &keepalive_idle; + ksocknal_tunables.ksnd_keepalive_count = &keepalive_count; + ksocknal_tunables.ksnd_keepalive_intvl = &keepalive_intvl; + ksocknal_tunables.ksnd_credits = &credits; + ksocknal_tunables.ksnd_peertxcredits = &peer_credits; + ksocknal_tunables.ksnd_peerrtrcredits = &peer_buffer_credits; + ksocknal_tunables.ksnd_peertimeout = &peer_timeout; + ksocknal_tunables.ksnd_enable_csum = &enable_csum; + ksocknal_tunables.ksnd_inject_csum_error = &inject_csum_error; + ksocknal_tunables.ksnd_nonblk_zcack = &nonblk_zcack; + ksocknal_tunables.ksnd_zc_min_payload = &zc_min_payload; + ksocknal_tunables.ksnd_zc_recv = &zc_recv; + ksocknal_tunables.ksnd_zc_recv_min_nfrags = &zc_recv_min_nfrags; + #ifdef CPU_AFFINITY - .ksnd_irq_affinity = &enable_irq_affinity, + if (enable_irq_affinity) { + CWARN("irq_affinity is removed from socklnd because modern " + "computer always has fast CPUs and more cores than " + "# NICs, although you still can set irq_affinity by " + "another way, please check manual for details.\n"); + } + ksocknal_tunables.ksnd_irq_affinity = &enable_irq_affinity; #endif + #ifdef SOCKNAL_BACKOFF - .ksnd_backoff_init = &backoff_init, - .ksnd_backoff_max = &backoff_max, + ksocknal_tunables.ksnd_backoff_init = &backoff_init; + ksocknal_tunables.ksnd_backoff_max = &backoff_max; #endif + +#if SOCKNAL_VERSION_DEBUG + ksocknal_tunables.ksnd_protocol = &protocol; +#endif + +#if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM + ksocknal_tunables.ksnd_sysctl = NULL; +#endif + + if (*ksocknal_tunables.ksnd_zc_min_payload < (2 << 10)) + *ksocknal_tunables.ksnd_zc_min_payload = (2 << 10); + + /* initialize platform-sepcific tunables */ + return ksocknal_lib_tunables_init(); }; +void ksocknal_tunables_fini(void) +{ + ksocknal_lib_tunables_fini(); +}