diff --git a/iscsi-scst/README b/iscsi-scst/README index acd95f070..c6b61c0a4 100644 --- a/iscsi-scst/README +++ b/iscsi-scst/README @@ -146,6 +146,15 @@ CAUTION: Working of target and initiator on the same host isn't ======== supported. See SCST README file for details. +Performance advices +------------------- + +1. If you use Windows XP or Windows 2003+ as initiators, you should +consider to decrease TcpAckFrequency parameter to 1. See +http://support.microsoft.com/kb/328890/ or google for "TcpAckFrequency" +for more details. + + Known issues ------------ diff --git a/scst/ToDo b/scst/ToDo index 5b064fcb2..b8b17f4a4 100644 --- a/scst/ToDo +++ b/scst/ToDo @@ -1,6 +1,8 @@ To be done ---------- + - See http://scst.sourceforge.net/contributing.html + - Kernel build integration (patch). - Reimplement VDISK handler with usage of async. read/write operations diff --git a/scst/include/scst.h b/scst/include/scst.h index c3b44309c..51e728947 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -34,6 +34,8 @@ #include +#include "scst_sgv.h" + /* * Version numbers, the same as for the kernel. * @@ -1339,17 +1341,6 @@ struct scst_mgmt_cmd { void *tgt_priv; }; -struct scst_mem_lim { - /* How much memory allocated under this object */ - atomic_t alloced_pages; - - /* - * How much memory allowed to allocated under this object. Put here - * mostly to save a possible cache miss accessing scst_max_dev_cmd_mem. - */ - int max_allowed_pages; -}; - struct scst_device { struct scst_dev_type *handler; /* corresponding dev handler */ @@ -2676,36 +2667,6 @@ static inline void scst_thr_data_put(struct scst_thr_data_hdr *data) data->free_fn(data); } -/* SGV pool routines and flag bits */ - -/* Set if the allocated object must be not from the cache */ -#define SCST_POOL_ALLOC_NO_CACHED 1 - -/* Set if there should not be any memory allocations on a cache miss */ -#define SCST_POOL_NO_ALLOC_ON_CACHE_MISS 2 - -/* Set an object should be returned even if it doesn't have SG vector built */ -#define SCST_POOL_RETURN_OBJ_ON_ALLOC_FAIL 4 - -struct sgv_pool_obj; -struct sgv_pool; - -struct sgv_pool *sgv_pool_create(const char *name, int clustered); -void sgv_pool_destroy(struct sgv_pool *pool); - -void sgv_pool_set_allocator(struct sgv_pool *pool, - struct page *(*alloc_pages_fn)(struct scatterlist *, gfp_t, void *), - void (*free_pages_fn)(struct scatterlist *, int, void *)); - -struct scatterlist *sgv_pool_alloc(struct sgv_pool *pool, unsigned int size, - gfp_t gfp_mask, int flags, int *count, - struct sgv_pool_obj **sgv, struct scst_mem_lim *mem_lim, void *priv); -void sgv_pool_free(struct sgv_pool_obj *sgv, struct scst_mem_lim *mem_lim); - -void *sgv_get_priv(struct sgv_pool_obj *sgv); - -void scst_init_mem_lim(struct scst_mem_lim *mem_lim); - /** ** Generic parse() support routines. ** Done via pointer on functions to avoid unneeded dereferences on diff --git a/scst/include/scst_sgv.h b/scst/include/scst_sgv.h new file mode 100644 index 000000000..7b94fceda --- /dev/null +++ b/scst/include/scst_sgv.h @@ -0,0 +1,60 @@ +/* + * include/scst_sgv.h + * + * Copyright (C) 2004 - 2008 Vladislav Bolkhovitin + * Copyright (C) 2004 - 2005 Leonid Stoljar + * Copyright (C) 2007 - 2008 CMS Distribution Limited + * + * Include file for SCST SGV cache. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, version 2 + * of the License. + * + * 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 for more details. + */ + +/* SGV pool routines and flag bits */ + +/* Set if the allocated object must be not from the cache */ +#define SCST_POOL_ALLOC_NO_CACHED 1 + +/* Set if there should not be any memory allocations on a cache miss */ +#define SCST_POOL_NO_ALLOC_ON_CACHE_MISS 2 + +/* Set an object should be returned even if it doesn't have SG vector built */ +#define SCST_POOL_RETURN_OBJ_ON_ALLOC_FAIL 4 + +struct sgv_pool_obj; +struct sgv_pool; + +struct scst_mem_lim { + /* How much memory allocated under this object */ + atomic_t alloced_pages; + + /* + * How much memory allowed to allocated under this object. Put here + * mostly to save a possible cache miss accessing scst_max_dev_cmd_mem. + */ + int max_allowed_pages; +}; + +struct sgv_pool *sgv_pool_create(const char *name, int clustered); +void sgv_pool_destroy(struct sgv_pool *pool); + +void sgv_pool_set_allocator(struct sgv_pool *pool, + struct page *(*alloc_pages_fn)(struct scatterlist *, gfp_t, void *), + void (*free_pages_fn)(struct scatterlist *, int, void *)); + +struct scatterlist *sgv_pool_alloc(struct sgv_pool *pool, unsigned int size, + gfp_t gfp_mask, int flags, int *count, + struct sgv_pool_obj **sgv, struct scst_mem_lim *mem_lim, void *priv); +void sgv_pool_free(struct sgv_pool_obj *sgv, struct scst_mem_lim *mem_lim); + +void *sgv_get_priv(struct sgv_pool_obj *sgv); + +void scst_init_mem_lim(struct scst_mem_lim *mem_lim); diff --git a/scst/src/Makefile b/scst/src/Makefile index 75c921423..bd9fe746f 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -71,6 +71,7 @@ install: all modules_install install -d $(INSTALL_DIR_H) install -m 644 ../include/scst.h $(INSTALL_DIR_H) + install -m 644 ../include/scst_sgv.h $(INSTALL_DIR_H) install -m 644 ../include/scst_debug.h $(INSTALL_DIR_H) install -m 644 ../include/scst_user.h $(INSTALL_DIR_H) install -m 644 ../include/scst_const.h $(INSTALL_DIR_H) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 327dcbd3c..46d1ebd35 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -603,7 +603,7 @@ static int scst_parse_cmd(struct scst_cmd *cmd) cmd->expected_transfer_len, cmd->cdb[0], dev->handler->name, cmd->tgtt->name, cmd->bufflen); - PRINT_BUFF_FLAG(TRACE_MINOR, "Suspicious CDB", + PRINT_BUFF_FLAG(TRACE_MGMT_MINOR, "Suspicious CDB", cmd->cdb, cmd->cdb_len); } #endif