/* * This file is part of the Chelsio FCoE driver for Linux. * * Copyright (c) 2008-2012 Chelsio Communications, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of this source tree, or the * OpenIB.org BSD license below: * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE.
*/
/* **************************** NOTE ******************************* * How do we calculate MAX FCoE SCSI SGEs? Here is the math: * Max Egress WR size = 512 bytes * One SCSI egress WR has the following fixed no of bytes: * 48 (sizeof(struct fw_scsi_write[read]_wr)) - FW WR * + 32 (sizeof(struct fc_fcp_cmnd)) - Immediate FCP_CMD * ------ * 80 * ------ * That leaves us with 512 - 96 = 432 bytes for data SGE. Using * struct ulptx_sgl header for the SGE consumes: * - 4 bytes for cmnd_sge. * - 12 bytes for the first SGL. * That leaves us with 416 bytes for the remaining SGE pairs. Which is * is 416 / 24 (size(struct ulptx_sge_pair)) = 17 SGE pairs, * or 34 SGEs. Adding the first SGE fetches us 35 SGEs.
*/ #define CSIO_SCSI_MAX_SGE 35 #define CSIO_SCSI_ABRT_TMO_MS 60000 #define CSIO_SCSI_LUNRST_TMO_MS 60000 #define CSIO_SCSI_TM_POLL_MS 2000 /* should be less than * all TM timeouts.
*/ #define CSIO_SCSI_IQ_WRSZ 128 #define CSIO_SCSI_IQSIZE (csio_scsi_iqlen * CSIO_SCSI_IQ_WRSZ)
/* * csio_scsi_start_io - Kick starts the IO SM. * @req: io request SM. * * needs to be called with lock held.
*/ staticinlineint
csio_scsi_start_io(struct csio_ioreq *ioreq)
{
csio_post_event(&ioreq->sm, CSIO_SCSIE_START_IO); return ioreq->drv_status;
}
/* * csio_scsi_start_tm - Kicks off the Task management IO SM. * @req: io request SM. * * needs to be called with lock held.
*/ staticinlineint
csio_scsi_start_tm(struct csio_ioreq *ioreq)
{
csio_post_event(&ioreq->sm, CSIO_SCSIE_START_TM); return ioreq->drv_status;
}
/* * csio_scsi_abort - Abort an IO request * @req: io request SM. * * needs to be called with lock held.
*/ staticinlineint
csio_scsi_abort(struct csio_ioreq *ioreq)
{
csio_post_event(&ioreq->sm, CSIO_SCSIE_ABORT); return ioreq->drv_status;
}
/* * csio_scsi_close - Close an IO request * @req: io request SM. * * needs to be called with lock held.
*/ staticinlineint
csio_scsi_close(struct csio_ioreq *ioreq)
{
csio_post_event(&ioreq->sm, CSIO_SCSIE_CLOSE); return ioreq->drv_status;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.