コード例 #1
0
ファイル: zfcp_dbf.c プロジェクト: 274914765/C
/**
 * zfcp_san_dbf_event_els_request - trace event for issued ELS
 * @fsf_req: request containing issued ELS
 */
void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *fsf_req)
{
    struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data;

    zfcp_san_dbf_event_els("oels", 2, fsf_req,
                   fc_host_port_id(els->adapter->scsi_host),
                   els->d_id, *(u8 *) zfcp_sg_to_address(els->req),
                   zfcp_sg_to_address(els->req), els->req->length);
}
コード例 #2
0
ファイル: zfcp_dbf.c プロジェクト: 3sOx/asuswrt-merlin
void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *fsf_req)
{
	struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data;

	_zfcp_san_dbf_event_common_els("rels", 2, fsf_req, els->d_id,
				       fc_host_port_id(els->adapter->scsi_host),
				       *(u8 *) zfcp_sg_to_address(els->req),
				       zfcp_sg_to_address(els->resp),
				       els->resp->length);
}
コード例 #3
0
/**
 * zfcp_qdio_sbals_from_sg - fill SBALs from scatter-gather list
 * @fsf_req: request to be processed
 * @sbtype: SBALE flags
 * @sg: scatter-gather list
 * @sg_count: number of elements in scatter-gather list
 * @max_sbals: upper bound for number of SBALs to be used
 */
int
zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
                        struct scatterlist *sgl, int sg_count, int max_sbals)
{
	int sg_index;
	struct scatterlist *sg_segment;
	int retval;
	volatile struct qdio_buffer_element *sbale;
	int bytes = 0;

	/* figure out last allowed SBAL */
	zfcp_qdio_sbal_limit(fsf_req, max_sbals);

	/* set storage-block type for current SBAL */
	sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0);
	sbale->flags |= sbtype;

	/* process all segements of scatter-gather list */
	for_each_sg(sgl, sg_segment, sg_count, sg_index) {
		retval = zfcp_qdio_sbals_from_segment(
				fsf_req,
				sbtype,
				zfcp_sg_to_address(sg_segment),
				sg_segment->length);
		if (retval < 0) {
			bytes = retval;
			goto out;
		} else
                        bytes += retval;
	}
コード例 #4
0
ファイル: zfcp_dbf.c プロジェクト: 274914765/C
/**
 * zfcp_san_dbf_event_ct_response - trace event for completion of CT request
 * @fsf_req: request containing CT response
 */
void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req)
{
    struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data;
    struct zfcp_port *port = ct->port;
    struct zfcp_adapter *adapter = port->adapter;
    struct ct_hdr *hdr = zfcp_sg_to_address(ct->resp);
    struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf;
    struct zfcp_san_dbf_record_ct_response *rct = &r->u.ct_resp;
    unsigned long flags;

    spin_lock_irqsave(&adapter->san_dbf_lock, flags);
    memset(r, 0, sizeof(*r));
    strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE);
    r->fsf_reqid = (unsigned long)fsf_req;
    r->fsf_seqno = fsf_req->seq_no;
    r->s_id = port->d_id;
    r->d_id = fc_host_port_id(adapter->scsi_host);
    rct->cmd_rsp_code = hdr->cmd_rsp_code;
    rct->revision = hdr->revision;
    rct->reason_code = hdr->reason_code;
    rct->expl = hdr->reason_code_expl;
    rct->vendor_unique = hdr->vendor_unique;
    rct->len = min((int)ct->resp->length - (int)sizeof(struct ct_hdr),
               ZFCP_DBF_CT_PAYLOAD);
    memcpy(rct->payload, (void *)hdr + sizeof(struct ct_hdr), rct->len);
    debug_event(adapter->san_dbf, 3, r, sizeof(*r));
    spin_unlock_irqrestore(&adapter->san_dbf_lock, flags);
}
コード例 #5
0
ファイル: zfcp_dbf.c プロジェクト: 3sOx/asuswrt-merlin
void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req)
{
	struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data;
	struct zfcp_port *port = ct->port;
	struct zfcp_adapter *adapter = port->adapter;

	_zfcp_san_dbf_event_common_ct("rctc", fsf_req, port->d_id,
				      fc_host_port_id(adapter->scsi_host),
				      zfcp_sg_to_address(ct->resp),
				      ct->resp->length);
}
コード例 #6
0
ファイル: zfcp_qdio.c プロジェクト: wxlong/Test
/**
 * zfcp_qdio_sbals_from_sg - fill SBALs from scatter-gather list
 * @fsf_req: request to be processed
 * @sbtype: SBALE flags
 * @sg: scatter-gather list
 * @sg_count: number of elements in scatter-gather list
 * @max_sbals: upper bound for number of SBALs to be used
 */
inline int
zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
                        struct scatterlist *sg,	int sg_count, int max_sbals)
{
    int sg_index;
    struct scatterlist *sg_segment;
    int retval;
    volatile struct qdio_buffer_element *sbale;
    int bytes = 0;

    /* figure out last allowed SBAL */
    zfcp_qdio_sbal_limit(fsf_req, max_sbals);

    /* set storage-block type for current SBAL */
    sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0);
    sbale->flags |= sbtype;

    /* process all segements of scatter-gather list */
    for (sg_index = 0, sg_segment = sg, bytes = 0;
            sg_index < sg_count;
            sg_index++, sg_segment++) {
        retval = zfcp_qdio_sbals_from_segment(
                     fsf_req,
                     sbtype,
                     zfcp_sg_to_address(sg_segment),
                     sg_segment->length);
        if (retval < 0) {
            bytes = retval;
            goto out;
        } else
            bytes += retval;
    }
    /* assume that no other SBALEs are to follow in the same SBAL */
    sbale = zfcp_qdio_sbale_curr(fsf_req);
    sbale->flags |= SBAL_FLAGS_LAST_ENTRY;

out:
#ifdef ZFCP_STAT_REQSIZES
    if (sbtype == SBAL_FLAGS0_TYPE_READ) {
        zfcp_statistics_inc(&zfcp_data.read_sguse_head, sg_count);
        zfcp_statistics_inc(&zfcp_data.read_req_head, bytes);
    } else	{
        zfcp_statistics_inc(&zfcp_data.write_sguse_head, sg_count);
        zfcp_statistics_inc(&zfcp_data.write_req_head, bytes);
    }
#endif

    return bytes;
}