/* bnx2i.h: QLogic NetXtreme II iSCSI driver. * * Copyright (c) 2006 - 2013 Broadcom Corporation * Copyright (c) 2007, 2008 Red Hat, Inc. All rights reserved. * Copyright (c) 2007, 2008 Mike Christie * Copyright (c) 2014, QLogic Corporation * * 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. * * Written by: Anil Veerabhadrappa (anilgv@broadcom.com) * Previously Maintained by: Eddie Wai (eddie.wai@broadcom.com) * Maintained by: QLogic-Storage-Upstream@qlogic.com
*/
#define ADD_STATS_64(__hba, field, len) \ do { \ if (spin_trylock(&__hba->stat_lock)) { \ if (__hba->stats.field##_lo + len < \
__hba->stats.field##_lo) \
__hba->stats.field##_hi++; \
__hba->stats.field##_lo += len; \
spin_unlock(&__hba->stat_lock); \
} \
} while (0)
#else #define GET_STATS_64(__hba, dst, field) \ do { \
u64 val, *out; \
\
val = __hba->bnx2i_stats.field; \
out = (u64 *)&__hba->stats.field##_lo; \
*out = cpu_to_le64(val); \
out = (u64 *)&dst->field##_lo; \
*out = cpu_to_le64(val); \
} while (0)
#define ADD_STATS_64(__hba, field, len) \ do { \
__hba->bnx2i_stats.field += len; \
} while (0) #endif
/** * struct generic_pdu_resc - login pdu resource structure * * @req_buf: driver buffer used to stage payload associated with * the login request * @req_dma_addr: dma address for iscsi login request payload buffer * @req_buf_size: actual login request payload length * @req_wr_ptr: pointer into login request buffer when next data is * to be written * @resp_hdr: iscsi header where iscsi login response header is to * be recreated * @resp_buf: buffer to stage login response payload * @resp_dma_addr: login response payload buffer dma address * @resp_buf_size: login response paylod length * @resp_wr_ptr: pointer into login response buffer when next data is * to be written * @req_bd_tbl: iscsi login request payload BD table * @req_bd_dma: login request BD table dma address * @resp_bd_tbl: iscsi login response payload BD table * @resp_bd_dma: login request BD table dma address * * following structure defines buffer info for generic pdus such as iSCSI Login, * Logout and NOP
*/ struct generic_pdu_resc { char *req_buf;
dma_addr_t req_dma_addr;
u32 req_buf_size; char *req_wr_ptr; struct iscsi_hdr resp_hdr; char *resp_buf;
dma_addr_t resp_dma_addr;
u32 resp_buf_size; char *resp_wr_ptr; char *req_bd_tbl;
dma_addr_t req_bd_dma; char *resp_bd_tbl;
dma_addr_t resp_bd_dma;
};
/** * struct bd_resc_page - tracks DMA'able memory allocated for BD tables * * @link: list head to link elements * @max_ptrs: maximun pointers that can be stored in this page * @num_valid: number of pointer valid in this page * @page: base addess for page pointer array * * structure to track DMA'able memory allocated for command BD tables
*/ struct bd_resc_page { struct list_head link;
u32 max_ptrs;
u32 num_valid; void *page[1];
};
/** * struct bnx2i_hba - bnx2i adapter structure * * @link: list head to link elements * @cnic: pointer to cnic device * @pcidev: pointer to pci dev * @netdev: pointer to netdev structure * @regview: mapped PCI register space * @age: age, incremented by every recovery * @cnic_dev_type: cnic device type, 5706/5708/5709/57710 * @mail_queue_access: mailbox queue access mode, applicable to 5709 only * @reg_with_cnic: indicates whether the device is register with CNIC * @adapter_state: adapter state, UP, GOING_DOWN, LINK_DOWN * @mtu_supported: Ethernet MTU supported * @shost: scsi host pointer * @max_sqes: SQ size * @max_rqes: RQ size * @max_cqes: CQ size * @num_ccell: number of command cells per connection * @ofld_conns_active: active connection list * @eh_wait: wait queue for the endpoint to shutdown * @max_active_conns: max offload connections supported by this device * @cid_que: iscsi cid queue * @ep_rdwr_lock: read / write lock to synchronize various ep lists * @ep_ofld_list: connection list for pending offload completion * @ep_active_list: connection list for active offload endpoints * @ep_destroy_list: connection list for pending offload completion * @mp_bd_tbl: BD table to be used with middle path requests * @mp_bd_dma: DMA address of 'mp_bd_tbl' memory buffer * @dummy_buffer: Dummy buffer to be used with zero length scsicmd reqs * @dummy_buf_dma: DMA address of 'dummy_buffer' memory buffer * @lock: lock to synchonize access to hba structure * @hba_shutdown_tmo: Timeout value to shutdown each connection * @conn_teardown_tmo: Timeout value to tear down each connection * @conn_ctx_destroy_tmo: Timeout value to destroy context of each connection * @pci_did: PCI device ID * @pci_vid: PCI vendor ID * @pci_sdid: PCI subsystem device ID * @pci_svid: PCI subsystem vendor ID * @pci_func: PCI function number in system pci tree * @pci_devno: PCI device number in system pci tree * @num_wqe_sent: statistic counter, total wqe's sent * @num_cqe_rcvd: statistic counter, total cqe's received * @num_intr_claimed: statistic counter, total interrupts claimed * @link_changed_count: statistic counter, num of link change notifications * received * @ipaddr_changed_count: statistic counter, num times IP address changed while * at least one connection is offloaded * @num_sess_opened: statistic counter, total num sessions opened * @num_conn_opened: statistic counter, total num conns opened on this hba * @ctx_ccell_tasks: captures number of ccells and tasks supported by * currently offloaded connection, used to decode * context memory * @stat_lock: spin lock used by the statistic collector (32 bit) * @stats: local iSCSI statistic collection place holder * * Adapter Data Structure
*/ struct bnx2i_hba { struct list_head link; struct cnic_dev *cnic; struct pci_dev *pcidev; struct net_device *netdev; void __iomem *regview;
resource_size_t reg_base;
int hba_shutdown_tmo; int conn_teardown_tmo; int conn_ctx_destroy_tmo; /* * PCI related info.
*/
u16 pci_did;
u16 pci_vid;
u16 pci_sdid;
u16 pci_svid;
u16 pci_func;
u16 pci_devno;
/* * Following are a bunch of statistics useful during development * and later stage for score boarding.
*/
u32 num_wqe_sent;
u32 num_cqe_rcvd;
u32 num_intr_claimed;
u32 link_changed_count;
u32 ipaddr_changed_count;
u32 num_sess_opened;
u32 num_conn_opened; unsignedint ctx_ccell_tasks;
/** * struct bnx2i_endpoint - representation of tcp connection in NX2 world * * @link: list head to link elements * @hba: adapter to which this connection belongs * @conn: iscsi connection this EP is linked to * @cls_ep: associated iSCSI endpoint pointer * @cm_sk: cnic sock struct * @hba_age: age to detect if 'iscsid' issues ep_disconnect() * after HBA reset is completed by bnx2i/cnic/bnx2 * modules * @state: tracks offload connection state machine * @timestamp: tracks the start time when the ep begins to connect * @num_active_cmds: tracks the number of outstanding commands for this ep * @ec_shift: the amount of shift as part of the event coal calc * @qp: QP information * @ids: contains chip allocated *context id* & driver assigned * *iscsi cid* * @ofld_timer: offload timer to detect timeout * @ofld_wait: wait queue * * Endpoint Structure - equivalent of tcp socket structure
*/ struct bnx2i_endpoint { struct list_head link; struct bnx2i_hba *hba; struct bnx2i_conn *conn; struct iscsi_endpoint *cls_ep; struct cnic_sock *cm_sk;
u32 hba_age;
u32 state; unsignedlong timestamp;
atomic_t num_active_cmds;
u32 ec_shift;
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.