You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull first round of SCSI updates from James Bottomley: "The patch set is mostly driver updates (bnx2fc, ipr, lpfc, qla4) and a few bug fixes" Pull delayed because google hates James, and sneakily considers his pull requests spam. Why, google, why? * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (60 commits) [SCSI] aacraid: 1024 max outstanding command support for Series 7 and above [SCSI] bnx2fc: adjust duplicate test [SCSI] qla4xxx: Update driver version to 5.03.00-k4 [SCSI] qla4xxx: Fix return code for qla4xxx_session_get_param. [SCSI] qla4xxx: wait for boot target login response during probe. [SCSI] qla4xxx: Added support for force firmware dump [SCSI] qla4xxx: Re-register IRQ handler while retrying initialize of adapter [SCSI] qla4xxx: Throttle active IOCBs to firmware limits [SCSI] qla4xxx: Remove unnecessary code from qla4xxx_init_local_data [SCSI] qla4xxx: Quiesce driver activities while loopback [SCSI] qla4xxx: Rename MBOX_ASTS_IDC_NOTIFY to MBOX_ASTS_IDC_REQUEST_NOTIFICATION [SCSI] qla4xxx: Add spurious interrupt messages under debug level 2 [SCSI] cxgb4i: Remove the scsi host device when removing device [SCSI] bfa: fix strncpy() limiter in bfad_start_ops() [SCSI] qla4xxx: Update driver version to 5.03.00-k3 [SCSI] qla4xxx: Correct the validation to check in get_sys_info mailbox [SCSI] qla4xxx: Pass correct function param to qla4_8xxx_rd_direct [SCSI] lpfc 8.3.37: Update lpfc version for 8.3.37 driver release [SCSI] lpfc 8.3.37: Fixed infinite loop in lpfc_sli4_fcf_rr_next_index_get. [SCSI] lpfc 8.3.37: Fixed crash due to SLI Port invalid resource count ...
This commit is contained in:
+4
-3
@@ -1800,7 +1800,8 @@ F: drivers/bcma/
|
||||
F: include/linux/bcma/
|
||||
|
||||
BROCADE BFA FC SCSI DRIVER
|
||||
M: Krishna C Gudipati <kgudipat@brocade.com>
|
||||
M: Anil Gurumurthy <agurumur@brocade.com>
|
||||
M: Vijaya Mohan Guvva <vmohan@brocade.com>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
S: Supported
|
||||
F: drivers/scsi/bfa/
|
||||
@@ -2074,8 +2075,8 @@ S: Maintained
|
||||
F: include/linux/clk.h
|
||||
|
||||
CISCO FCOE HBA DRIVER
|
||||
M: Abhijeet Joglekar <abjoglek@cisco.com>
|
||||
M: Venkata Siva Vijayendra Bhamidipati <vbhamidi@cisco.com>
|
||||
M: Hiral Patel <hiralpat@cisco.com>
|
||||
M: Suma Ramars <sramars@cisco.com>
|
||||
M: Brian Uchino <buchino@cisco.com>
|
||||
L: linux-scsi@vger.kernel.org
|
||||
S: Supported
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef AAC_DRIVER_BUILD
|
||||
# define AAC_DRIVER_BUILD 29801
|
||||
# define AAC_DRIVER_BUILD 30000
|
||||
# define AAC_DRIVER_BRANCH "-ms"
|
||||
#endif
|
||||
#define MAXIMUM_NUM_CONTAINERS 32
|
||||
|
||||
#define AAC_NUM_MGT_FIB 8
|
||||
#define AAC_NUM_IO_FIB (512 - AAC_NUM_MGT_FIB)
|
||||
#define AAC_NUM_IO_FIB (1024 - AAC_NUM_MGT_FIB)
|
||||
#define AAC_NUM_FIB (AAC_NUM_IO_FIB + AAC_NUM_MGT_FIB)
|
||||
|
||||
#define AAC_MAX_LUN (8)
|
||||
@@ -36,6 +36,10 @@
|
||||
#define CONTAINER_TO_ID(cont) (cont)
|
||||
#define CONTAINER_TO_LUN(cont) (0)
|
||||
|
||||
#define PMC_DEVICE_S7 0x28c
|
||||
#define PMC_DEVICE_S8 0x28d
|
||||
#define PMC_DEVICE_S9 0x28f
|
||||
|
||||
#define aac_phys_to_logical(x) ((x)+1)
|
||||
#define aac_logical_to_phys(x) ((x)?(x)-1:0)
|
||||
|
||||
|
||||
@@ -404,7 +404,13 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
|
||||
dev->max_fib_size = status[1] & 0xFFE0;
|
||||
host->sg_tablesize = status[2] >> 16;
|
||||
dev->sg_tablesize = status[2] & 0xFFFF;
|
||||
host->can_queue = (status[3] & 0xFFFF) - AAC_NUM_MGT_FIB;
|
||||
if (dev->pdev->device == PMC_DEVICE_S7 ||
|
||||
dev->pdev->device == PMC_DEVICE_S8 ||
|
||||
dev->pdev->device == PMC_DEVICE_S9)
|
||||
host->can_queue = ((status[3] >> 16) ? (status[3] >> 16) :
|
||||
(status[3] & 0xFFFF)) - AAC_NUM_MGT_FIB;
|
||||
else
|
||||
host->can_queue = (status[3] & 0xFFFF) - AAC_NUM_MGT_FIB;
|
||||
dev->max_num_aif = status[4] & 0xFFFF;
|
||||
/*
|
||||
* NOTE:
|
||||
@@ -452,6 +458,9 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
|
||||
}
|
||||
}
|
||||
|
||||
if (host->can_queue > AAC_NUM_IO_FIB)
|
||||
host->can_queue = AAC_NUM_IO_FIB;
|
||||
|
||||
/*
|
||||
* Ok now init the communication subsystem
|
||||
*/
|
||||
|
||||
@@ -1034,7 +1034,7 @@ bfad_start_ops(struct bfad_s *bfad) {
|
||||
sizeof(driver_info.host_os_patch) - 1);
|
||||
|
||||
strncpy(driver_info.os_device_name, bfad->pci_name,
|
||||
sizeof(driver_info.os_device_name - 1));
|
||||
sizeof(driver_info.os_device_name) - 1);
|
||||
|
||||
/* FCS driver info init */
|
||||
spin_lock_irqsave(&bfad->bfad_lock, flags);
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
#include "bnx2fc_constants.h"
|
||||
|
||||
#define BNX2FC_NAME "bnx2fc"
|
||||
#define BNX2FC_VERSION "1.0.12"
|
||||
#define BNX2FC_VERSION "1.0.13"
|
||||
|
||||
#define PFX "bnx2fc: "
|
||||
|
||||
@@ -156,6 +156,18 @@
|
||||
#define BNX2FC_RELOGIN_WAIT_TIME 200
|
||||
#define BNX2FC_RELOGIN_WAIT_CNT 10
|
||||
|
||||
#define BNX2FC_STATS(hba, stat, cnt) \
|
||||
do { \
|
||||
u32 val; \
|
||||
\
|
||||
val = fw_stats->stat.cnt; \
|
||||
if (hba->prev_stats.stat.cnt <= val) \
|
||||
val -= hba->prev_stats.stat.cnt; \
|
||||
else \
|
||||
val += (0xfffffff - hba->prev_stats.stat.cnt); \
|
||||
hba->bfw_stats.cnt += val; \
|
||||
} while (0)
|
||||
|
||||
/* bnx2fc driver uses only one instance of fcoe_percpu_s */
|
||||
extern struct fcoe_percpu_s bnx2fc_global;
|
||||
|
||||
@@ -167,6 +179,14 @@ struct bnx2fc_percpu_s {
|
||||
spinlock_t fp_work_lock;
|
||||
};
|
||||
|
||||
struct bnx2fc_fw_stats {
|
||||
u64 fc_crc_cnt;
|
||||
u64 fcoe_tx_pkt_cnt;
|
||||
u64 fcoe_rx_pkt_cnt;
|
||||
u64 fcoe_tx_byte_cnt;
|
||||
u64 fcoe_rx_byte_cnt;
|
||||
};
|
||||
|
||||
struct bnx2fc_hba {
|
||||
struct list_head list;
|
||||
struct cnic_dev *cnic;
|
||||
@@ -207,6 +227,8 @@ struct bnx2fc_hba {
|
||||
struct bnx2fc_rport **tgt_ofld_list;
|
||||
|
||||
/* statistics */
|
||||
struct bnx2fc_fw_stats bfw_stats;
|
||||
struct fcoe_statistics_params prev_stats;
|
||||
struct fcoe_statistics_params *stats_buffer;
|
||||
dma_addr_t stats_buf_dma;
|
||||
struct completion stat_req_done;
|
||||
@@ -280,6 +302,7 @@ struct bnx2fc_rport {
|
||||
#define BNX2FC_FLAG_UPLD_REQ_COMPL 0x7
|
||||
#define BNX2FC_FLAG_EXPL_LOGO 0x8
|
||||
#define BNX2FC_FLAG_DISABLE_FAILED 0x9
|
||||
#define BNX2FC_FLAG_ENABLED 0xa
|
||||
|
||||
u8 src_addr[ETH_ALEN];
|
||||
u32 max_sqes;
|
||||
@@ -468,6 +491,8 @@ int bnx2fc_send_fw_fcoe_init_msg(struct bnx2fc_hba *hba);
|
||||
int bnx2fc_send_fw_fcoe_destroy_msg(struct bnx2fc_hba *hba);
|
||||
int bnx2fc_send_session_ofld_req(struct fcoe_port *port,
|
||||
struct bnx2fc_rport *tgt);
|
||||
int bnx2fc_send_session_enable_req(struct fcoe_port *port,
|
||||
struct bnx2fc_rport *tgt);
|
||||
int bnx2fc_send_session_disable_req(struct fcoe_port *port,
|
||||
struct bnx2fc_rport *tgt);
|
||||
int bnx2fc_send_session_destroy_req(struct bnx2fc_hba *hba,
|
||||
|
||||
@@ -22,7 +22,7 @@ DEFINE_PER_CPU(struct bnx2fc_percpu_s, bnx2fc_percpu);
|
||||
|
||||
#define DRV_MODULE_NAME "bnx2fc"
|
||||
#define DRV_MODULE_VERSION BNX2FC_VERSION
|
||||
#define DRV_MODULE_RELDATE "Jun 04, 2012"
|
||||
#define DRV_MODULE_RELDATE "Dec 21, 2012"
|
||||
|
||||
|
||||
static char version[] =
|
||||
@@ -687,11 +687,16 @@ static struct fc_host_statistics *bnx2fc_get_host_stats(struct Scsi_Host *shost)
|
||||
BNX2FC_HBA_DBG(lport, "FW stat req timed out\n");
|
||||
return bnx2fc_stats;
|
||||
}
|
||||
bnx2fc_stats->invalid_crc_count += fw_stats->rx_stat2.fc_crc_cnt;
|
||||
bnx2fc_stats->tx_frames += fw_stats->tx_stat.fcoe_tx_pkt_cnt;
|
||||
bnx2fc_stats->tx_words += (fw_stats->tx_stat.fcoe_tx_byte_cnt) / 4;
|
||||
bnx2fc_stats->rx_frames += fw_stats->rx_stat0.fcoe_rx_pkt_cnt;
|
||||
bnx2fc_stats->rx_words += (fw_stats->rx_stat0.fcoe_rx_byte_cnt) / 4;
|
||||
BNX2FC_STATS(hba, rx_stat2, fc_crc_cnt);
|
||||
bnx2fc_stats->invalid_crc_count += hba->bfw_stats.fc_crc_cnt;
|
||||
BNX2FC_STATS(hba, tx_stat, fcoe_tx_pkt_cnt);
|
||||
bnx2fc_stats->tx_frames += hba->bfw_stats.fcoe_tx_pkt_cnt;
|
||||
BNX2FC_STATS(hba, tx_stat, fcoe_tx_byte_cnt);
|
||||
bnx2fc_stats->tx_words += ((hba->bfw_stats.fcoe_tx_byte_cnt) / 4);
|
||||
BNX2FC_STATS(hba, rx_stat0, fcoe_rx_pkt_cnt);
|
||||
bnx2fc_stats->rx_frames += hba->bfw_stats.fcoe_rx_pkt_cnt;
|
||||
BNX2FC_STATS(hba, rx_stat0, fcoe_rx_byte_cnt);
|
||||
bnx2fc_stats->rx_words += ((hba->bfw_stats.fcoe_rx_byte_cnt) / 4);
|
||||
|
||||
bnx2fc_stats->dumped_frames = 0;
|
||||
bnx2fc_stats->lip_count = 0;
|
||||
@@ -700,6 +705,8 @@ static struct fc_host_statistics *bnx2fc_get_host_stats(struct Scsi_Host *shost)
|
||||
bnx2fc_stats->loss_of_signal_count = 0;
|
||||
bnx2fc_stats->prim_seq_protocol_err_count = 0;
|
||||
|
||||
memcpy(&hba->prev_stats, hba->stats_buffer,
|
||||
sizeof(struct fcoe_statistics_params));
|
||||
return bnx2fc_stats;
|
||||
}
|
||||
|
||||
@@ -2660,7 +2667,7 @@ static struct scsi_host_template bnx2fc_shost_template = {
|
||||
.can_queue = BNX2FC_CAN_QUEUE,
|
||||
.use_clustering = ENABLE_CLUSTERING,
|
||||
.sg_tablesize = BNX2FC_MAX_BDS_PER_CMD,
|
||||
.max_sectors = 512,
|
||||
.max_sectors = 1024,
|
||||
};
|
||||
|
||||
static struct libfc_function_template bnx2fc_libfc_fcn_templ = {
|
||||
|
||||
@@ -347,7 +347,7 @@ int bnx2fc_send_session_ofld_req(struct fcoe_port *port,
|
||||
* @port: port structure pointer
|
||||
* @tgt: bnx2fc_rport structure pointer
|
||||
*/
|
||||
static int bnx2fc_send_session_enable_req(struct fcoe_port *port,
|
||||
int bnx2fc_send_session_enable_req(struct fcoe_port *port,
|
||||
struct bnx2fc_rport *tgt)
|
||||
{
|
||||
struct kwqe *kwqe_arr[2];
|
||||
@@ -759,8 +759,6 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe)
|
||||
case FCOE_ERROR_CODE_DATA_SOFN_SEQ_ACTIVE_RESET:
|
||||
BNX2FC_TGT_DBG(tgt, "REC TOV popped for xid - 0x%x\n",
|
||||
xid);
|
||||
memset(&io_req->err_entry, 0,
|
||||
sizeof(struct fcoe_err_report_entry));
|
||||
memcpy(&io_req->err_entry, err_entry,
|
||||
sizeof(struct fcoe_err_report_entry));
|
||||
if (!test_bit(BNX2FC_FLAG_SRR_SENT,
|
||||
@@ -847,8 +845,6 @@ ret_err_rqe:
|
||||
goto ret_warn_rqe;
|
||||
}
|
||||
|
||||
memset(&io_req->err_entry, 0,
|
||||
sizeof(struct fcoe_err_report_entry));
|
||||
memcpy(&io_req->err_entry, err_entry,
|
||||
sizeof(struct fcoe_err_report_entry));
|
||||
|
||||
@@ -1124,7 +1120,6 @@ static void bnx2fc_process_ofld_cmpl(struct bnx2fc_hba *hba,
|
||||
struct bnx2fc_interface *interface;
|
||||
u32 conn_id;
|
||||
u32 context_id;
|
||||
int rc;
|
||||
|
||||
conn_id = ofld_kcqe->fcoe_conn_id;
|
||||
context_id = ofld_kcqe->fcoe_conn_context_id;
|
||||
@@ -1153,17 +1148,10 @@ static void bnx2fc_process_ofld_cmpl(struct bnx2fc_hba *hba,
|
||||
"resources\n");
|
||||
set_bit(BNX2FC_FLAG_CTX_ALLOC_FAILURE, &tgt->flags);
|
||||
}
|
||||
goto ofld_cmpl_err;
|
||||
} else {
|
||||
|
||||
/* now enable the session */
|
||||
rc = bnx2fc_send_session_enable_req(port, tgt);
|
||||
if (rc) {
|
||||
printk(KERN_ERR PFX "enable session failed\n");
|
||||
goto ofld_cmpl_err;
|
||||
}
|
||||
/* FW offload request successfully completed */
|
||||
set_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags);
|
||||
}
|
||||
return;
|
||||
ofld_cmpl_err:
|
||||
set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags);
|
||||
wake_up_interruptible(&tgt->ofld_wait);
|
||||
@@ -1210,15 +1198,9 @@ static void bnx2fc_process_enable_conn_cmpl(struct bnx2fc_hba *hba,
|
||||
printk(KERN_ERR PFX "bnx2fc-enbl_cmpl: HBA mis-match\n");
|
||||
goto enbl_cmpl_err;
|
||||
}
|
||||
if (ofld_kcqe->completion_status)
|
||||
goto enbl_cmpl_err;
|
||||
else {
|
||||
if (!ofld_kcqe->completion_status)
|
||||
/* enable successful - rport ready for issuing IOs */
|
||||
set_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags);
|
||||
set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags);
|
||||
wake_up_interruptible(&tgt->ofld_wait);
|
||||
}
|
||||
return;
|
||||
set_bit(BNX2FC_FLAG_ENABLED, &tgt->flags);
|
||||
|
||||
enbl_cmpl_err:
|
||||
set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags);
|
||||
@@ -1251,6 +1233,7 @@ static void bnx2fc_process_conn_disable_cmpl(struct bnx2fc_hba *hba,
|
||||
/* disable successful */
|
||||
BNX2FC_TGT_DBG(tgt, "disable successful\n");
|
||||
clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags);
|
||||
clear_bit(BNX2FC_FLAG_ENABLED, &tgt->flags);
|
||||
set_bit(BNX2FC_FLAG_DISABLED, &tgt->flags);
|
||||
set_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags);
|
||||
wake_up_interruptible(&tgt->upld_wait);
|
||||
|
||||
@@ -654,7 +654,7 @@ int bnx2fc_init_mp_req(struct bnx2fc_cmd *io_req)
|
||||
mp_req->mp_resp_bd = dma_alloc_coherent(&hba->pcidev->dev, sz,
|
||||
&mp_req->mp_resp_bd_dma,
|
||||
GFP_ATOMIC);
|
||||
if (!mp_req->mp_req_bd) {
|
||||
if (!mp_req->mp_resp_bd) {
|
||||
printk(KERN_ERR PFX "unable to alloc MP resp bd\n");
|
||||
bnx2fc_free_mp_resc(io_req);
|
||||
return FAILED;
|
||||
@@ -685,8 +685,8 @@ int bnx2fc_init_mp_req(struct bnx2fc_cmd *io_req)
|
||||
static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
|
||||
{
|
||||
struct fc_lport *lport;
|
||||
struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
|
||||
struct fc_rport_libfc_priv *rp = rport->dd_data;
|
||||
struct fc_rport *rport;
|
||||
struct fc_rport_libfc_priv *rp;
|
||||
struct fcoe_port *port;
|
||||
struct bnx2fc_interface *interface;
|
||||
struct bnx2fc_rport *tgt;
|
||||
@@ -704,6 +704,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
|
||||
unsigned long start = jiffies;
|
||||
|
||||
lport = shost_priv(host);
|
||||
rport = starget_to_rport(scsi_target(sc_cmd->device));
|
||||
port = lport_priv(lport);
|
||||
interface = port->priv;
|
||||
|
||||
@@ -712,6 +713,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
|
||||
rc = FAILED;
|
||||
goto tmf_err;
|
||||
}
|
||||
rp = rport->dd_data;
|
||||
|
||||
rc = fc_block_scsi_eh(sc_cmd);
|
||||
if (rc)
|
||||
|
||||
@@ -33,6 +33,7 @@ static void bnx2fc_upld_timer(unsigned long data)
|
||||
BNX2FC_TGT_DBG(tgt, "upld_timer - Upload compl not received!!\n");
|
||||
/* fake upload completion */
|
||||
clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags);
|
||||
clear_bit(BNX2FC_FLAG_ENABLED, &tgt->flags);
|
||||
set_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags);
|
||||
wake_up_interruptible(&tgt->upld_wait);
|
||||
}
|
||||
@@ -55,10 +56,25 @@ static void bnx2fc_ofld_timer(unsigned long data)
|
||||
* resources are freed up in bnx2fc_offload_session
|
||||
*/
|
||||
clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags);
|
||||
clear_bit(BNX2FC_FLAG_ENABLED, &tgt->flags);
|
||||
set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags);
|
||||
wake_up_interruptible(&tgt->ofld_wait);
|
||||
}
|
||||
|
||||
static void bnx2fc_ofld_wait(struct bnx2fc_rport *tgt)
|
||||
{
|
||||
setup_timer(&tgt->ofld_timer, bnx2fc_ofld_timer, (unsigned long)tgt);
|
||||
mod_timer(&tgt->ofld_timer, jiffies + BNX2FC_FW_TIMEOUT);
|
||||
|
||||
wait_event_interruptible(tgt->ofld_wait,
|
||||
(test_bit(
|
||||
BNX2FC_FLAG_OFLD_REQ_CMPL,
|
||||
&tgt->flags)));
|
||||
if (signal_pending(current))
|
||||
flush_signals(current);
|
||||
del_timer_sync(&tgt->ofld_timer);
|
||||
}
|
||||
|
||||
static void bnx2fc_offload_session(struct fcoe_port *port,
|
||||
struct bnx2fc_rport *tgt,
|
||||
struct fc_rport_priv *rdata)
|
||||
@@ -103,17 +119,7 @@ retry_ofld:
|
||||
* wait for the session is offloaded and enabled. 3 Secs
|
||||
* should be ample time for this process to complete.
|
||||
*/
|
||||
setup_timer(&tgt->ofld_timer, bnx2fc_ofld_timer, (unsigned long)tgt);
|
||||
mod_timer(&tgt->ofld_timer, jiffies + BNX2FC_FW_TIMEOUT);
|
||||
|
||||
wait_event_interruptible(tgt->ofld_wait,
|
||||
(test_bit(
|
||||
BNX2FC_FLAG_OFLD_REQ_CMPL,
|
||||
&tgt->flags)));
|
||||
if (signal_pending(current))
|
||||
flush_signals(current);
|
||||
|
||||
del_timer_sync(&tgt->ofld_timer);
|
||||
bnx2fc_ofld_wait(tgt);
|
||||
|
||||
if (!(test_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags))) {
|
||||
if (test_and_clear_bit(BNX2FC_FLAG_CTX_ALLOC_FAILURE,
|
||||
@@ -131,14 +137,23 @@ retry_ofld:
|
||||
}
|
||||
if (bnx2fc_map_doorbell(tgt)) {
|
||||
printk(KERN_ERR PFX "map doorbell failed - no mem\n");
|
||||
/* upload will take care of cleaning up sess resc */
|
||||
lport->tt.rport_logoff(rdata);
|
||||
goto ofld_err;
|
||||
}
|
||||
clear_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags);
|
||||
rval = bnx2fc_send_session_enable_req(port, tgt);
|
||||
if (rval) {
|
||||
pr_err(PFX "enable session failed\n");
|
||||
goto ofld_err;
|
||||
}
|
||||
bnx2fc_ofld_wait(tgt);
|
||||
if (!(test_bit(BNX2FC_FLAG_ENABLED, &tgt->flags)))
|
||||
goto ofld_err;
|
||||
return;
|
||||
|
||||
ofld_err:
|
||||
/* couldn't offload the session. log off from this rport */
|
||||
BNX2FC_TGT_DBG(tgt, "bnx2fc_offload_session - offload error\n");
|
||||
clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags);
|
||||
/* Free session resources */
|
||||
bnx2fc_free_session_resc(hba, tgt);
|
||||
tgt_init_err:
|
||||
@@ -259,6 +274,19 @@ void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt)
|
||||
spin_unlock_bh(&tgt->tgt_lock);
|
||||
}
|
||||
|
||||
static void bnx2fc_upld_wait(struct bnx2fc_rport *tgt)
|
||||
{
|
||||
setup_timer(&tgt->upld_timer, bnx2fc_upld_timer, (unsigned long)tgt);
|
||||
mod_timer(&tgt->upld_timer, jiffies + BNX2FC_FW_TIMEOUT);
|
||||
wait_event_interruptible(tgt->upld_wait,
|
||||
(test_bit(
|
||||
BNX2FC_FLAG_UPLD_REQ_COMPL,
|
||||
&tgt->flags)));
|
||||
if (signal_pending(current))
|
||||
flush_signals(current);
|
||||
del_timer_sync(&tgt->upld_timer);
|
||||
}
|
||||
|
||||
static void bnx2fc_upload_session(struct fcoe_port *port,
|
||||
struct bnx2fc_rport *tgt)
|
||||
{
|
||||
@@ -279,19 +307,8 @@ static void bnx2fc_upload_session(struct fcoe_port *port,
|
||||
* wait for upload to complete. 3 Secs
|
||||
* should be sufficient time for this process to complete.
|
||||
*/
|
||||
setup_timer(&tgt->upld_timer, bnx2fc_upld_timer, (unsigned long)tgt);
|
||||
mod_timer(&tgt->upld_timer, jiffies + BNX2FC_FW_TIMEOUT);
|
||||
|
||||
BNX2FC_TGT_DBG(tgt, "waiting for disable compl\n");
|
||||
wait_event_interruptible(tgt->upld_wait,
|
||||
(test_bit(
|
||||
BNX2FC_FLAG_UPLD_REQ_COMPL,
|
||||
&tgt->flags)));
|
||||
|
||||
if (signal_pending(current))
|
||||
flush_signals(current);
|
||||
|
||||
del_timer_sync(&tgt->upld_timer);
|
||||
bnx2fc_upld_wait(tgt);
|
||||
|
||||
/*
|
||||
* traverse thru the active_q and tmf_q and cleanup
|
||||
@@ -308,24 +325,13 @@ static void bnx2fc_upload_session(struct fcoe_port *port,
|
||||
bnx2fc_send_session_destroy_req(hba, tgt);
|
||||
|
||||
/* wait for destroy to complete */
|
||||
setup_timer(&tgt->upld_timer,
|
||||
bnx2fc_upld_timer, (unsigned long)tgt);
|
||||
mod_timer(&tgt->upld_timer, jiffies + BNX2FC_FW_TIMEOUT);
|
||||
|
||||
wait_event_interruptible(tgt->upld_wait,
|
||||
(test_bit(
|
||||
BNX2FC_FLAG_UPLD_REQ_COMPL,
|
||||
&tgt->flags)));
|
||||
bnx2fc_upld_wait(tgt);
|
||||
|
||||
if (!(test_bit(BNX2FC_FLAG_DESTROYED, &tgt->flags)))
|
||||
printk(KERN_ERR PFX "ERROR!! destroy timed out\n");
|
||||
|
||||
BNX2FC_TGT_DBG(tgt, "destroy wait complete flags = 0x%lx\n",
|
||||
tgt->flags);
|
||||
if (signal_pending(current))
|
||||
flush_signals(current);
|
||||
|
||||
del_timer_sync(&tgt->upld_timer);
|
||||
|
||||
} else if (test_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags)) {
|
||||
printk(KERN_ERR PFX "ERROR!! DISABLE req failed, destroy"
|
||||
@@ -381,7 +387,9 @@ static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt,
|
||||
tgt->rq_cons_idx = 0;
|
||||
atomic_set(&tgt->num_active_ios, 0);
|
||||
|
||||
if (rdata->flags & FC_RP_FLAGS_RETRY) {
|
||||
if (rdata->flags & FC_RP_FLAGS_RETRY &&
|
||||
rdata->ids.roles & FC_RPORT_ROLE_FCP_TARGET &&
|
||||
!(rdata->ids.roles & FC_RPORT_ROLE_FCP_INITIATOR)) {
|
||||
tgt->dev_type = TYPE_TAPE;
|
||||
tgt->io_timeout = 0; /* use default ULP timeout */
|
||||
} else {
|
||||
@@ -479,7 +487,7 @@ void bnx2fc_rport_event_handler(struct fc_lport *lport,
|
||||
tgt = (struct bnx2fc_rport *)&rp[1];
|
||||
|
||||
/* This can happen when ADISC finds the same target */
|
||||
if (test_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags)) {
|
||||
if (test_bit(BNX2FC_FLAG_ENABLED, &tgt->flags)) {
|
||||
BNX2FC_TGT_DBG(tgt, "already offloaded\n");
|
||||
mutex_unlock(&hba->hba_mutex);
|
||||
return;
|
||||
@@ -494,11 +502,8 @@ void bnx2fc_rport_event_handler(struct fc_lport *lport,
|
||||
BNX2FC_TGT_DBG(tgt, "OFFLOAD num_ofld_sess = %d\n",
|
||||
hba->num_ofld_sess);
|
||||
|
||||
if (test_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags)) {
|
||||
/*
|
||||
* Session is offloaded and enabled. Map
|
||||
* doorbell register for this target
|
||||
*/
|
||||
if (test_bit(BNX2FC_FLAG_ENABLED, &tgt->flags)) {
|
||||
/* Session is offloaded and enabled. */
|
||||
BNX2FC_TGT_DBG(tgt, "sess offloaded\n");
|
||||
/* This counter is protected with hba mutex */
|
||||
hba->num_ofld_sess++;
|
||||
@@ -535,7 +540,7 @@ void bnx2fc_rport_event_handler(struct fc_lport *lport,
|
||||
*/
|
||||
tgt = (struct bnx2fc_rport *)&rp[1];
|
||||
|
||||
if (!(test_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags))) {
|
||||
if (!(test_bit(BNX2FC_FLAG_ENABLED, &tgt->flags))) {
|
||||
mutex_unlock(&hba->hba_mutex);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1317,7 +1317,7 @@ int bnx2i_send_fw_iscsi_init_msg(struct bnx2i_hba *hba)
|
||||
(1ULL << ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_LUN));
|
||||
if (error_mask1) {
|
||||
iscsi_init2.error_bit_map[0] = error_mask1;
|
||||
mask64 &= (u32)(~mask64);
|
||||
mask64 ^= (u32)(mask64);
|
||||
mask64 |= error_mask1;
|
||||
} else
|
||||
iscsi_init2.error_bit_map[0] = (u32) mask64;
|
||||
|
||||
@@ -2131,13 +2131,16 @@ csio_hw_flash_config(struct csio_hw *hw, u32 *fw_cfg_param, char *path)
|
||||
value_to_add = 4 - (cf->size % 4);
|
||||
|
||||
cfg_data = kzalloc(cf->size+value_to_add, GFP_KERNEL);
|
||||
if (cfg_data == NULL)
|
||||
return -ENOMEM;
|
||||
if (cfg_data == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto leave;
|
||||
}
|
||||
|
||||
memcpy((void *)cfg_data, (const void *)cf->data, cf->size);
|
||||
|
||||
if (csio_hw_check_fwconfig(hw, fw_cfg_param) != 0)
|
||||
return -EINVAL;
|
||||
if (csio_hw_check_fwconfig(hw, fw_cfg_param) != 0) {
|
||||
ret = -EINVAL;
|
||||
goto leave;
|
||||
}
|
||||
|
||||
mtype = FW_PARAMS_PARAM_Y_GET(*fw_cfg_param);
|
||||
maddr = FW_PARAMS_PARAM_Z_GET(*fw_cfg_param) << 16;
|
||||
@@ -2149,9 +2152,9 @@ csio_hw_flash_config(struct csio_hw *hw, u32 *fw_cfg_param, char *path)
|
||||
strncpy(path, "/lib/firmware/" CSIO_CF_FNAME, 64);
|
||||
}
|
||||
|
||||
leave:
|
||||
kfree(cfg_data);
|
||||
release_firmware(cf);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,13 +60,6 @@ static struct scsi_transport_template *csio_fcoe_transport_vport;
|
||||
/*
|
||||
* debugfs support
|
||||
*/
|
||||
static int
|
||||
csio_mem_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
file->private_data = inode->i_private;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
csio_mem_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
||||
{
|
||||
@@ -110,7 +103,7 @@ csio_mem_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
||||
|
||||
static const struct file_operations csio_mem_debugfs_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = csio_mem_open,
|
||||
.open = simple_open,
|
||||
.read = csio_mem_read,
|
||||
.llseek = default_llseek,
|
||||
};
|
||||
|
||||
@@ -1564,6 +1564,7 @@ static int t4_uld_state_change(void *handle, enum cxgb4_state state)
|
||||
break;
|
||||
case CXGB4_STATE_DETACH:
|
||||
pr_info("cdev 0x%p, DETACH.\n", cdev);
|
||||
cxgbi_device_unregister(cdev);
|
||||
break;
|
||||
default:
|
||||
pr_info("cdev 0x%p, unknown state %d.\n", cdev, state);
|
||||
|
||||
@@ -495,7 +495,8 @@ void fnic_eth_send(struct fcoe_ctlr *fip, struct sk_buff *skb)
|
||||
}
|
||||
|
||||
fnic_queue_wq_eth_desc(wq, skb, pa, skb->len,
|
||||
fnic->vlan_hw_insert, fnic->vlan_id, 1);
|
||||
0 /* hw inserts cos value */,
|
||||
fnic->vlan_id, 1);
|
||||
spin_unlock_irqrestore(&fnic->wq_lock[0], flags);
|
||||
}
|
||||
|
||||
@@ -563,7 +564,8 @@ static int fnic_send_frame(struct fnic *fnic, struct fc_frame *fp)
|
||||
}
|
||||
|
||||
fnic_queue_wq_desc(wq, skb, pa, tot_len, fr_eof(fp),
|
||||
fnic->vlan_hw_insert, fnic->vlan_id, 1, 1, 1);
|
||||
0 /* hw inserts cos value */,
|
||||
fnic->vlan_id, 1, 1, 1);
|
||||
fnic_send_frame_end:
|
||||
spin_unlock_irqrestore(&fnic->wq_lock[0], flags);
|
||||
|
||||
|
||||
+2
-8
@@ -1107,14 +1107,8 @@ static int gdth_init_pci(struct pci_dev *pdev, gdth_pci_str *pcistr,
|
||||
pci_read_config_word(pdev, PCI_COMMAND, &command);
|
||||
command |= 6;
|
||||
pci_write_config_word(pdev, PCI_COMMAND, command);
|
||||
if (pci_resource_start(pdev, 8) == 1UL)
|
||||
pci_resource_start(pdev, 8) = 0UL;
|
||||
i = 0xFEFF0001UL;
|
||||
pci_write_config_dword(pdev, PCI_ROM_ADDRESS, i);
|
||||
gdth_delay(1);
|
||||
pci_write_config_dword(pdev, PCI_ROM_ADDRESS,
|
||||
pci_resource_start(pdev, 8));
|
||||
|
||||
gdth_delay(1);
|
||||
|
||||
dp6m_ptr = ha->brd;
|
||||
|
||||
/* Ensure that it is safe to access the non HW portions of DPMEM.
|
||||
|
||||
+972
-324
File diff suppressed because it is too large
Load Diff
+68
-33
@@ -32,14 +32,15 @@
|
||||
#include <linux/libata.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/blk-iopoll.h>
|
||||
#include <scsi/scsi.h>
|
||||
#include <scsi/scsi_cmnd.h>
|
||||
|
||||
/*
|
||||
* Literals
|
||||
*/
|
||||
#define IPR_DRIVER_VERSION "2.5.4"
|
||||
#define IPR_DRIVER_DATE "(July 11, 2012)"
|
||||
#define IPR_DRIVER_VERSION "2.6.0"
|
||||
#define IPR_DRIVER_DATE "(November 16, 2012)"
|
||||
|
||||
/*
|
||||
* IPR_MAX_CMD_PER_LUN: This defines the maximum number of outstanding
|
||||
@@ -82,6 +83,7 @@
|
||||
|
||||
#define IPR_SUBS_DEV_ID_57B4 0x033B
|
||||
#define IPR_SUBS_DEV_ID_57B2 0x035F
|
||||
#define IPR_SUBS_DEV_ID_57C0 0x0352
|
||||
#define IPR_SUBS_DEV_ID_57C3 0x0353
|
||||
#define IPR_SUBS_DEV_ID_57C4 0x0354
|
||||
#define IPR_SUBS_DEV_ID_57C6 0x0357
|
||||
@@ -94,6 +96,10 @@
|
||||
#define IPR_SUBS_DEV_ID_574D 0x0356
|
||||
#define IPR_SUBS_DEV_ID_57C8 0x035D
|
||||
|
||||
#define IPR_SUBS_DEV_ID_57D5 0x03FB
|
||||
#define IPR_SUBS_DEV_ID_57D6 0x03FC
|
||||
#define IPR_SUBS_DEV_ID_57D7 0x03FF
|
||||
#define IPR_SUBS_DEV_ID_57D8 0x03FE
|
||||
#define IPR_NAME "ipr"
|
||||
|
||||
/*
|
||||
@@ -298,6 +304,9 @@ IPR_PCII_NO_HOST_RRQ | IPR_PCII_IOARRIN_LOST | IPR_PCII_MMIO_ERROR)
|
||||
* Misc literals
|
||||
*/
|
||||
#define IPR_NUM_IOADL_ENTRIES IPR_MAX_SGLIST
|
||||
#define IPR_MAX_MSIX_VECTORS 0x5
|
||||
#define IPR_MAX_HRRQ_NUM 0x10
|
||||
#define IPR_INIT_HRRQ 0x0
|
||||
|
||||
/*
|
||||
* Adapter interface types
|
||||
@@ -404,7 +413,7 @@ struct ipr_config_table_entry64 {
|
||||
__be64 dev_id;
|
||||
__be64 lun;
|
||||
__be64 lun_wwn[2];
|
||||
#define IPR_MAX_RES_PATH_LENGTH 24
|
||||
#define IPR_MAX_RES_PATH_LENGTH 48
|
||||
__be64 res_path;
|
||||
struct ipr_std_inq_data std_inq_data;
|
||||
u8 reserved2[4];
|
||||
@@ -459,9 +468,39 @@ struct ipr_supported_device {
|
||||
u8 reserved2[16];
|
||||
}__attribute__((packed, aligned (4)));
|
||||
|
||||
struct ipr_hrr_queue {
|
||||
struct ipr_ioa_cfg *ioa_cfg;
|
||||
__be32 *host_rrq;
|
||||
dma_addr_t host_rrq_dma;
|
||||
#define IPR_HRRQ_REQ_RESP_HANDLE_MASK 0xfffffffc
|
||||
#define IPR_HRRQ_RESP_BIT_SET 0x00000002
|
||||
#define IPR_HRRQ_TOGGLE_BIT 0x00000001
|
||||
#define IPR_HRRQ_REQ_RESP_HANDLE_SHIFT 2
|
||||
#define IPR_ID_HRRQ_SELE_ENABLE 0x02
|
||||
volatile __be32 *hrrq_start;
|
||||
volatile __be32 *hrrq_end;
|
||||
volatile __be32 *hrrq_curr;
|
||||
|
||||
struct list_head hrrq_free_q;
|
||||
struct list_head hrrq_pending_q;
|
||||
spinlock_t _lock;
|
||||
spinlock_t *lock;
|
||||
|
||||
volatile u32 toggle_bit;
|
||||
u32 size;
|
||||
u32 min_cmd_id;
|
||||
u32 max_cmd_id;
|
||||
u8 allow_interrupts:1;
|
||||
u8 ioa_is_dead:1;
|
||||
u8 allow_cmds:1;
|
||||
|
||||
struct blk_iopoll iopoll;
|
||||
};
|
||||
|
||||
/* Command packet structure */
|
||||
struct ipr_cmd_pkt {
|
||||
__be16 reserved; /* Reserved by IOA */
|
||||
u8 reserved; /* Reserved by IOA */
|
||||
u8 hrrq_id;
|
||||
u8 request_type;
|
||||
#define IPR_RQTYPE_SCSICDB 0x00
|
||||
#define IPR_RQTYPE_IOACMD 0x01
|
||||
@@ -1022,6 +1061,10 @@ struct ipr_hostrcb64_fabric_desc {
|
||||
struct ipr_hostrcb64_config_element elem[1];
|
||||
}__attribute__((packed, aligned (8)));
|
||||
|
||||
#define for_each_hrrq(hrrq, ioa_cfg) \
|
||||
for (hrrq = (ioa_cfg)->hrrq; \
|
||||
hrrq < ((ioa_cfg)->hrrq + (ioa_cfg)->hrrq_num); hrrq++)
|
||||
|
||||
#define for_each_fabric_cfg(fabric, cfg) \
|
||||
for (cfg = (fabric)->elem; \
|
||||
cfg < ((fabric)->elem + be16_to_cpu((fabric)->num_entries)); \
|
||||
@@ -1308,6 +1351,7 @@ struct ipr_chip_cfg_t {
|
||||
u16 max_cmds;
|
||||
u8 cache_line_size;
|
||||
u8 clear_isr;
|
||||
u32 iopoll_weight;
|
||||
struct ipr_interrupt_offsets regs;
|
||||
};
|
||||
|
||||
@@ -1317,6 +1361,7 @@ struct ipr_chip_t {
|
||||
u16 intr_type;
|
||||
#define IPR_USE_LSI 0x00
|
||||
#define IPR_USE_MSI 0x01
|
||||
#define IPR_USE_MSIX 0x02
|
||||
u16 sis_type;
|
||||
#define IPR_SIS32 0x00
|
||||
#define IPR_SIS64 0x01
|
||||
@@ -1375,13 +1420,10 @@ struct ipr_ioa_cfg {
|
||||
|
||||
struct list_head queue;
|
||||
|
||||
u8 allow_interrupts:1;
|
||||
u8 in_reset_reload:1;
|
||||
u8 in_ioa_bringdown:1;
|
||||
u8 ioa_unit_checked:1;
|
||||
u8 ioa_is_dead:1;
|
||||
u8 dump_taken:1;
|
||||
u8 allow_cmds:1;
|
||||
u8 allow_ml_add_del:1;
|
||||
u8 needs_hard_reset:1;
|
||||
u8 dual_raid:1;
|
||||
@@ -1413,21 +1455,7 @@ struct ipr_ioa_cfg {
|
||||
char trace_start[8];
|
||||
#define IPR_TRACE_START_LABEL "trace"
|
||||
struct ipr_trace_entry *trace;
|
||||
u32 trace_index:IPR_NUM_TRACE_INDEX_BITS;
|
||||
|
||||
/*
|
||||
* Queue for free command blocks
|
||||
*/
|
||||
char ipr_free_label[8];
|
||||
#define IPR_FREEQ_LABEL "free-q"
|
||||
struct list_head free_q;
|
||||
|
||||
/*
|
||||
* Queue for command blocks outstanding to the adapter
|
||||
*/
|
||||
char ipr_pending_label[8];
|
||||
#define IPR_PENDQ_LABEL "pend-q"
|
||||
struct list_head pending_q;
|
||||
atomic_t trace_index;
|
||||
|
||||
char cfg_table_start[8];
|
||||
#define IPR_CFG_TBL_START "cfg"
|
||||
@@ -1452,16 +1480,10 @@ struct ipr_ioa_cfg {
|
||||
struct list_head hostrcb_free_q;
|
||||
struct list_head hostrcb_pending_q;
|
||||
|
||||
__be32 *host_rrq;
|
||||
dma_addr_t host_rrq_dma;
|
||||
#define IPR_HRRQ_REQ_RESP_HANDLE_MASK 0xfffffffc
|
||||
#define IPR_HRRQ_RESP_BIT_SET 0x00000002
|
||||
#define IPR_HRRQ_TOGGLE_BIT 0x00000001
|
||||
#define IPR_HRRQ_REQ_RESP_HANDLE_SHIFT 2
|
||||
volatile __be32 *hrrq_start;
|
||||
volatile __be32 *hrrq_end;
|
||||
volatile __be32 *hrrq_curr;
|
||||
volatile u32 toggle_bit;
|
||||
struct ipr_hrr_queue hrrq[IPR_MAX_HRRQ_NUM];
|
||||
u32 hrrq_num;
|
||||
atomic_t hrrq_index;
|
||||
u16 identify_hrrq_index;
|
||||
|
||||
struct ipr_bus_attributes bus_attr[IPR_MAX_NUM_BUSES];
|
||||
|
||||
@@ -1507,6 +1529,17 @@ struct ipr_ioa_cfg {
|
||||
u32 max_cmds;
|
||||
struct ipr_cmnd **ipr_cmnd_list;
|
||||
dma_addr_t *ipr_cmnd_list_dma;
|
||||
|
||||
u16 intr_flag;
|
||||
unsigned int nvectors;
|
||||
|
||||
struct {
|
||||
unsigned short vec;
|
||||
char desc[22];
|
||||
} vectors_info[IPR_MAX_MSIX_VECTORS];
|
||||
|
||||
u32 iopoll_weight;
|
||||
|
||||
}; /* struct ipr_ioa_cfg */
|
||||
|
||||
struct ipr_cmnd {
|
||||
@@ -1544,6 +1577,7 @@ struct ipr_cmnd {
|
||||
struct scsi_device *sdev;
|
||||
} u;
|
||||
|
||||
struct ipr_hrr_queue *hrrq;
|
||||
struct ipr_ioa_cfg *ioa_cfg;
|
||||
};
|
||||
|
||||
@@ -1717,7 +1751,8 @@ struct ipr_ucode_image_header {
|
||||
if (ipr_is_device(hostrcb)) { \
|
||||
if ((hostrcb)->ioa_cfg->sis64) { \
|
||||
printk(KERN_ERR IPR_NAME ": %s: " fmt, \
|
||||
ipr_format_res_path(hostrcb->hcam.u.error64.fd_res_path, \
|
||||
ipr_format_res_path(hostrcb->ioa_cfg, \
|
||||
hostrcb->hcam.u.error64.fd_res_path, \
|
||||
hostrcb->rp_buffer, \
|
||||
sizeof(hostrcb->rp_buffer)), \
|
||||
__VA_ARGS__); \
|
||||
|
||||
@@ -466,11 +466,13 @@ enum intr_type_t {
|
||||
MSIX,
|
||||
};
|
||||
|
||||
#define LPFC_CT_CTX_MAX 64
|
||||
struct unsol_rcv_ct_ctx {
|
||||
uint32_t ctxt_id;
|
||||
uint32_t SID;
|
||||
uint32_t flags;
|
||||
#define UNSOL_VALID 0x00000001
|
||||
uint32_t valid;
|
||||
#define UNSOL_INVALID 0
|
||||
#define UNSOL_VALID 1
|
||||
uint16_t oxid;
|
||||
uint16_t rxid;
|
||||
};
|
||||
@@ -750,6 +752,15 @@ struct lpfc_hba {
|
||||
void __iomem *ctrl_regs_memmap_p;/* Kernel memory mapped address for
|
||||
PCI BAR2 */
|
||||
|
||||
void __iomem *pci_bar0_memmap_p; /* Kernel memory mapped address for
|
||||
PCI BAR0 with dual-ULP support */
|
||||
void __iomem *pci_bar2_memmap_p; /* Kernel memory mapped address for
|
||||
PCI BAR2 with dual-ULP support */
|
||||
void __iomem *pci_bar4_memmap_p; /* Kernel memory mapped address for
|
||||
PCI BAR4 with dual-ULP support */
|
||||
#define PCI_64BIT_BAR0 0
|
||||
#define PCI_64BIT_BAR2 2
|
||||
#define PCI_64BIT_BAR4 4
|
||||
void __iomem *MBslimaddr; /* virtual address for mbox cmds */
|
||||
void __iomem *HAregaddr; /* virtual address for host attn reg */
|
||||
void __iomem *CAregaddr; /* virtual address for chip attn reg */
|
||||
@@ -938,7 +949,7 @@ struct lpfc_hba {
|
||||
|
||||
spinlock_t ct_ev_lock; /* synchronize access to ct_ev_waiters */
|
||||
struct list_head ct_ev_waiters;
|
||||
struct unsol_rcv_ct_ctx ct_ctx[64];
|
||||
struct unsol_rcv_ct_ctx ct_ctx[LPFC_CT_CTX_MAX];
|
||||
uint32_t ctx_idx;
|
||||
|
||||
uint8_t menlo_flag; /* menlo generic flags */
|
||||
|
||||
@@ -955,9 +955,9 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
|
||||
spin_lock_irqsave(&phba->ct_ev_lock, flags);
|
||||
if (phba->sli_rev == LPFC_SLI_REV4) {
|
||||
evt_dat->immed_dat = phba->ctx_idx;
|
||||
phba->ctx_idx = (phba->ctx_idx + 1) % 64;
|
||||
phba->ctx_idx = (phba->ctx_idx + 1) % LPFC_CT_CTX_MAX;
|
||||
/* Provide warning for over-run of the ct_ctx array */
|
||||
if (phba->ct_ctx[evt_dat->immed_dat].flags &
|
||||
if (phba->ct_ctx[evt_dat->immed_dat].valid ==
|
||||
UNSOL_VALID)
|
||||
lpfc_printf_log(phba, KERN_WARNING, LOG_ELS,
|
||||
"2717 CT context array entry "
|
||||
@@ -973,7 +973,7 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
|
||||
piocbq->iocb.unsli3.rcvsli3.ox_id;
|
||||
phba->ct_ctx[evt_dat->immed_dat].SID =
|
||||
piocbq->iocb.un.rcvels.remoteID;
|
||||
phba->ct_ctx[evt_dat->immed_dat].flags = UNSOL_VALID;
|
||||
phba->ct_ctx[evt_dat->immed_dat].valid = UNSOL_VALID;
|
||||
} else
|
||||
evt_dat->immed_dat = piocbq->iocb.ulpContext;
|
||||
|
||||
@@ -1012,6 +1012,47 @@ error_ct_unsol_exit:
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* lpfc_bsg_ct_unsol_abort - handler ct abort to management plane
|
||||
* @phba: Pointer to HBA context object.
|
||||
* @dmabuf: pointer to a dmabuf that describes the FC sequence
|
||||
*
|
||||
* This function handles abort to the CT command toward management plane
|
||||
* for SLI4 port.
|
||||
*
|
||||
* If the pending context of a CT command to management plane present, clears
|
||||
* such context and returns 1 for handled; otherwise, it returns 0 indicating
|
||||
* no context exists.
|
||||
**/
|
||||
int
|
||||
lpfc_bsg_ct_unsol_abort(struct lpfc_hba *phba, struct hbq_dmabuf *dmabuf)
|
||||
{
|
||||
struct fc_frame_header fc_hdr;
|
||||
struct fc_frame_header *fc_hdr_ptr = &fc_hdr;
|
||||
int ctx_idx, handled = 0;
|
||||
uint16_t oxid, rxid;
|
||||
uint32_t sid;
|
||||
|
||||
memcpy(fc_hdr_ptr, dmabuf->hbuf.virt, sizeof(struct fc_frame_header));
|
||||
sid = sli4_sid_from_fc_hdr(fc_hdr_ptr);
|
||||
oxid = be16_to_cpu(fc_hdr_ptr->fh_ox_id);
|
||||
rxid = be16_to_cpu(fc_hdr_ptr->fh_rx_id);
|
||||
|
||||
for (ctx_idx = 0; ctx_idx < LPFC_CT_CTX_MAX; ctx_idx++) {
|
||||
if (phba->ct_ctx[ctx_idx].valid != UNSOL_VALID)
|
||||
continue;
|
||||
if (phba->ct_ctx[ctx_idx].rxid != rxid)
|
||||
continue;
|
||||
if (phba->ct_ctx[ctx_idx].oxid != oxid)
|
||||
continue;
|
||||
if (phba->ct_ctx[ctx_idx].SID != sid)
|
||||
continue;
|
||||
phba->ct_ctx[ctx_idx].valid = UNSOL_INVALID;
|
||||
handled = 1;
|
||||
}
|
||||
return handled;
|
||||
}
|
||||
|
||||
/**
|
||||
* lpfc_bsg_hba_set_event - process a SET_EVENT bsg vendor command
|
||||
* @job: SET_EVENT fc_bsg_job
|
||||
@@ -1318,7 +1359,7 @@ lpfc_issue_ct_rsp(struct lpfc_hba *phba, struct fc_bsg_job *job, uint32_t tag,
|
||||
icmd->ulpClass = CLASS3;
|
||||
if (phba->sli_rev == LPFC_SLI_REV4) {
|
||||
/* Do not issue unsol response if oxid not marked as valid */
|
||||
if (!(phba->ct_ctx[tag].flags & UNSOL_VALID)) {
|
||||
if (phba->ct_ctx[tag].valid != UNSOL_VALID) {
|
||||
rc = IOCB_ERROR;
|
||||
goto issue_ct_rsp_exit;
|
||||
}
|
||||
@@ -1352,7 +1393,7 @@ lpfc_issue_ct_rsp(struct lpfc_hba *phba, struct fc_bsg_job *job, uint32_t tag,
|
||||
phba->sli4_hba.rpi_ids[ndlp->nlp_rpi];
|
||||
|
||||
/* The exchange is done, mark the entry as invalid */
|
||||
phba->ct_ctx[tag].flags &= ~UNSOL_VALID;
|
||||
phba->ct_ctx[tag].valid = UNSOL_INVALID;
|
||||
} else
|
||||
icmd->ulpContext = (ushort) tag;
|
||||
|
||||
|
||||
@@ -164,8 +164,7 @@ void lpfc_hb_timeout_handler(struct lpfc_hba *);
|
||||
|
||||
void lpfc_ct_unsol_event(struct lpfc_hba *, struct lpfc_sli_ring *,
|
||||
struct lpfc_iocbq *);
|
||||
void lpfc_sli4_ct_abort_unsol_event(struct lpfc_hba *, struct lpfc_sli_ring *,
|
||||
struct lpfc_iocbq *);
|
||||
int lpfc_ct_handle_unsol_abort(struct lpfc_hba *, struct hbq_dmabuf *);
|
||||
int lpfc_ns_cmd(struct lpfc_vport *, int, uint8_t, uint32_t);
|
||||
int lpfc_fdmi_cmd(struct lpfc_vport *, struct lpfc_nodelist *, int);
|
||||
void lpfc_fdmi_tmo(unsigned long);
|
||||
@@ -427,6 +426,7 @@ int lpfc_bsg_request(struct fc_bsg_job *);
|
||||
int lpfc_bsg_timeout(struct fc_bsg_job *);
|
||||
int lpfc_bsg_ct_unsol_event(struct lpfc_hba *, struct lpfc_sli_ring *,
|
||||
struct lpfc_iocbq *);
|
||||
int lpfc_bsg_ct_unsol_abort(struct lpfc_hba *, struct hbq_dmabuf *);
|
||||
void __lpfc_sli_ringtx_put(struct lpfc_hba *, struct lpfc_sli_ring *,
|
||||
struct lpfc_iocbq *);
|
||||
struct lpfc_iocbq *lpfc_sli_ringtx_get(struct lpfc_hba *,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user