* [PATCH 2/7] be2iscsi: Fix port speed typo in driver.
2014-01-13 0:42 [PATCH 1/7] be2iscsi: Fix handling timed out MBX completion from FW Jayamohan Kallickal
@ 2014-01-13 0:42 ` Jayamohan Kallickal
2014-01-13 0:42 ` [PATCH 3/7] be2iscsi : Fix IRQ_Affinity support " Jayamohan Kallickal
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Jayamohan Kallickal @ 2014-01-13 0:42 UTC (permalink / raw)
To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, John Soni Jose
The 100Mbps port speed macro used was not proper.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
drivers/scsi/be2iscsi/be_iscsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index 867f3d3..2843a67 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -795,7 +795,7 @@ static int beiscsi_get_port_speed(struct Scsi_Host *shost)
ihost->port_speed = ISCSI_PORT_SPEED_10MBPS;
break;
case BE2ISCSI_LINK_SPEED_100MBPS:
- ihost->port_speed = BE2ISCSI_LINK_SPEED_100MBPS;
+ ihost->port_speed = ISCSI_PORT_SPEED_100MBPS;
break;
case BE2ISCSI_LINK_SPEED_1GBPS:
ihost->port_speed = ISCSI_PORT_SPEED_1GBPS;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 3/7] be2iscsi : Fix IRQ_Affinity support in driver.
2014-01-13 0:42 [PATCH 1/7] be2iscsi: Fix handling timed out MBX completion from FW Jayamohan Kallickal
2014-01-13 0:42 ` [PATCH 2/7] be2iscsi: Fix port speed typo in driver Jayamohan Kallickal
@ 2014-01-13 0:42 ` Jayamohan Kallickal
2014-01-13 0:42 ` [PATCH 4/7] be2iscsi : Fix statistics update in the driver Jayamohan Kallickal
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Jayamohan Kallickal @ 2014-01-13 0:42 UTC (permalink / raw)
To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, John Soni Jose
Provides IRQ_Affinity setting for the driver. Enabling IRQ_Affinity
is through module params. Default IRQ_AFFINITY support is OFF.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
drivers/scsi/be2iscsi/be_cmds.h | 9 +++-
drivers/scsi/be2iscsi/be_main.c | 97 +++++++++++++++++++++++++++++++++++++--
drivers/scsi/be2iscsi/be_main.h | 22 +++++++--
drivers/scsi/be2iscsi/be_mgmt.c | 63 +++++++++++++++++++++++--
drivers/scsi/be2iscsi/be_mgmt.h | 49 ++++++++++++++++++--
5 files changed, 222 insertions(+), 18 deletions(-)
diff --git a/drivers/scsi/be2iscsi/be_cmds.h b/drivers/scsi/be2iscsi/be_cmds.h
index 770b6c8..69f849e 100644
--- a/drivers/scsi/be2iscsi/be_cmds.h
+++ b/drivers/scsi/be2iscsi/be_cmds.h
@@ -174,6 +174,7 @@ struct be_mcc_mailbox {
#define OPCODE_COMMON_EQ_DESTROY 55
#define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58
#define OPCODE_COMMON_FUNCTION_RESET 61
+#define OPCODE_COMMON_GET_CNTL_ADV_ATTRIB 121
/**
* LIST of opcodes that are common between Initiator and Target
@@ -197,6 +198,8 @@ struct be_mcc_mailbox {
#define OPCODE_COMMON_ISCSI_WRBQ_CREATE 66
#define OPCODE_COMMON_ISCSI_WRBQ_DESTROY 67
+#define MBOX_CMD_V2 0x01
+
struct be_cmd_req_hdr {
u8 opcode; /* dword 0 */
u8 subsystem; /* dword 0 */
@@ -966,6 +969,9 @@ struct amap_it_dmsg_cqe_v2 {
#define DB_DEF_PDU_WRB_INDEX_SHIFT 16
#define DB_DEF_PDU_NUM_POSTED_SHIFT 24
+#define BEISCSI_IFD_STATE_DISABLE 0x0
+#define BEISCSI_IFD_STATE_ENABLE 0x1
+
struct fragnum_bits_for_sgl_cra_in {
struct be_cmd_req_hdr hdr;
u32 num_bits;
@@ -1002,7 +1008,8 @@ struct tcp_connect_and_offload_in {
u16 hdr_ring_id;
u16 data_ring_id;
u8 do_offload;
- u8 rsvd0[3];
+ u8 ifd_state;
+ u8 rsvd0[2];
} __packed;
struct tcp_connect_and_offload_out {
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 1a1729b..89bf558 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -47,6 +47,7 @@
static unsigned int be_iopoll_budget = 10;
static unsigned int be_max_phys_size = 64;
static unsigned int enable_msix = 1;
+static unsigned int beiscsi_irq_affinity_enable;
MODULE_DEVICE_TABLE(pci, beiscsi_pci_id_table);
MODULE_DESCRIPTION(DRV_DESC " " BUILD_STR);
@@ -59,6 +60,7 @@ module_param(be_max_phys_size, uint, S_IRUGO);
MODULE_PARM_DESC(be_max_phys_size,
"Maximum Size (In Kilobytes) of physically contiguous "
"memory that can be allocated. Range is 16 - 128");
+module_param(beiscsi_irq_affinity_enable, uint, 0);
#define beiscsi_disp_param(_name)\
ssize_t \
@@ -1026,6 +1028,46 @@ static irqreturn_t be_isr(int irq, void *dev_id)
}
}
+static void beiscsi_set_irq_affinity_params(struct beiscsi_hba *phba,
+ uint16_t cpu_index, uint16_t eqcq_index, uint16_t msix_vec)
+{
+ struct hwi_controller *phwi_ctrlr;
+ struct hwi_context_memory *phwi_context;
+
+ phwi_ctrlr = phba->phwi_ctrlr;
+ phwi_context = phwi_ctrlr->phwi_ctxt;
+
+ if (msix_vec) {
+ if (cpu_online(cpu_index))
+ cpumask_set_cpu(cpu_index,
+ &phba->msix_cpu_map[
+ cpu_index].affinity_mask);
+ else
+ cpumask_copy(&phba->msix_cpu_map[
+ cpu_index].affinity_mask,
+ cpu_online_mask);
+
+ phba->msix_cpu_map[cpu_index].eq_id =
+ phwi_context->be_eq[eqcq_index].q.id;
+ phba->msix_cpu_map[cpu_index].cq_id =
+ phwi_context->be_cq[eqcq_index].id;
+ phba->msix_cpu_map[cpu_index].cpu_id = cpu_index;
+ phba->msix_cpu_map[cpu_index].nvec = msix_vec;
+ phba->msix_cpu_map[cpu_index].node_id =
+ cpu_to_node(cpu_index);
+
+ irq_set_affinity_hint(msix_vec,
+ &phba->msix_cpu_map[
+ cpu_index].affinity_mask);
+ } else {
+ phba->msix_cpu_map[cpu_index].eq_id =
+ phba->msix_cpu_map[eqcq_index].eq_id;
+ phba->msix_cpu_map[cpu_index].cq_id =
+ phba->msix_cpu_map[eqcq_index].cq_id;
+ phba->msix_cpu_map[cpu_index].cpu_id = cpu_index;
+ }
+}
+
static int beiscsi_init_irqs(struct beiscsi_hba *phba)
{
struct pci_dev *pcidev = phba->pcidev;
@@ -1059,7 +1101,11 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
kfree(phba->msi_name[i]);
goto free_msix_irqs;
}
+ if (beiscsi_irq_affinity_enable)
+ beiscsi_set_irq_affinity_params(phba,
+ i, i, msix_vec);
}
+
phba->msi_name[i] = kzalloc(BEISCSI_MSI_NAME, GFP_KERNEL);
if (!phba->msi_name[i]) {
ret = -ENOMEM;
@@ -1078,6 +1124,12 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
goto free_msix_irqs;
}
+ if (beiscsi_irq_affinity_enable) {
+ j = i;
+ while (i++ < num_online_cpus())
+ beiscsi_set_irq_affinity_params(phba,
+ i, (i - j), 0);
+ }
} else {
ret = request_irq(pcidev->irq, be_isr, IRQF_SHARED,
"beiscsi", phba);
@@ -4663,10 +4715,9 @@ beiscsi_offload_connection(struct beiscsi_conn *beiscsi_conn,
/* Check for the adapter family */
if (is_chip_be2_be3r(phba))
- beiscsi_offload_cxn_v0(params, pwrb_handle,
- phba->init_mem);
+ beiscsi_offload_cxn_v0(phba, params, pwrb_handle);
else
- beiscsi_offload_cxn_v2(params, pwrb_handle);
+ beiscsi_offload_cxn_v2(phba, params, pwrb_handle);
be_dws_le_to_cpu(pwrb_handle->pwrb,
sizeof(struct iscsi_target_context_update_wrb));
@@ -4860,6 +4911,8 @@ int beiscsi_iotask_v2(struct iscsi_task *task, struct scatterlist *sg,
struct beiscsi_hba *phba = beiscsi_conn->phba;
struct iscsi_wrb *pwrb = NULL;
unsigned int doorbell = 0;
+ uint8_t cpu_num;
+ u8 cq_num;
pwrb = io_task->pwrb_handle->pwrb;
@@ -4891,6 +4944,13 @@ int beiscsi_iotask_v2(struct iscsi_task *task, struct scatterlist *sg,
io_task->psgl_handle->sgl_index);
hwi_write_sgl_v2(pwrb, sg, num_sg, io_task);
+ if (phba->func_caps & BE_ADAPTER_IFD_CAP) {
+ cpu_num = get_cpu();
+ cq_num = phba->msix_cpu_map[cpu_num].cq_id;
+ AMAP_SET_BITS(struct amap_iscsi_wrb_v2, cq_id, pwrb, cq_num);
+ put_cpu();
+ }
+
AMAP_SET_BITS(struct amap_iscsi_wrb_v2, ptr2nextwrb, pwrb,
io_task->pwrb_handle->nxt_wrb_index);
@@ -4917,6 +4977,7 @@ static int beiscsi_iotask(struct iscsi_task *task, struct scatterlist *sg,
struct beiscsi_hba *phba = beiscsi_conn->phba;
struct iscsi_wrb *pwrb = NULL;
unsigned int doorbell = 0;
+ uint8_t cpu_num, cq_num;
pwrb = io_task->pwrb_handle->pwrb;
io_task->cmd_bhs->iscsi_hdr.exp_statsn = 0;
@@ -4948,6 +5009,13 @@ static int beiscsi_iotask(struct iscsi_task *task, struct scatterlist *sg,
hwi_write_sgl(pwrb, sg, num_sg, io_task);
+ if (phba->func_caps & BE_ADAPTER_IFD_CAP) {
+ cpu_num = get_cpu();
+ cq_num = phba->msix_cpu_map[cpu_num].cq_id;
+ AMAP_SET_BITS(struct amap_iscsi_wrb, cq_id, pwrb, cq_num);
+ put_cpu();
+ }
+
AMAP_SET_BITS(struct amap_iscsi_wrb, ptr2nextwrb, pwrb,
io_task->pwrb_handle->nxt_wrb_index);
be_dws_le_to_cpu(pwrb, sizeof(struct iscsi_wrb));
@@ -4972,6 +5040,7 @@ static int beiscsi_mtask(struct iscsi_task *task)
unsigned int doorbell = 0;
unsigned int cid;
unsigned int pwrb_typeoffset = 0;
+ uint8_t cpu_num, cq_num;
cid = beiscsi_conn->beiscsi_conn_cid;
pwrb = io_task->pwrb_handle->pwrb;
@@ -5003,6 +5072,19 @@ static int beiscsi_mtask(struct iscsi_task *task)
pwrb_typeoffset = SKH_WRB_TYPE_OFFSET;
}
+ if (phba->func_caps & BE_ADAPTER_IFD_CAP) {
+ cpu_num = get_cpu();
+ cq_num = phba->msix_cpu_map[cpu_num].cq_id;
+
+ if (is_chip_be2_be3r(phba))
+ AMAP_SET_BITS(struct amap_iscsi_wrb,
+ cq_id, pwrb, cq_num);
+ else
+ AMAP_SET_BITS(struct amap_iscsi_wrb_v2,
+ cq_id, pwrb, cq_num);
+ put_cpu();
+ }
+
switch (task->hdr->opcode & ISCSI_OPCODE_MASK) {
case ISCSI_OP_LOGIN:
@@ -5587,6 +5669,15 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
phba->num_cpus = 1;
}
+
+ if (beiscsi_irq_affinity_enable) {
+ if (mgmt_get_adapter_caps(phba))
+ beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_INIT,
+ "BM_%d : Error in getting Capabilites"
+ "IRQ_Affinity setting is disabled\n");
+ } else
+ phba->func_caps = BEISCSI_IFD_STATE_DISABLE;
+
phba->shost->max_id = phba->params.cxns_per_ctrl;
beiscsi_get_params(phba);
phba->shost->can_queue = phba->params.ios_per_ctrl;
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index 31fa27b..0076119 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -234,6 +234,15 @@ struct sgl_handle {
struct iscsi_sge *pfrag;
};
+struct msix_vec_map {
+ cpumask_t affinity_mask;
+ u16 eq_id;
+ u16 cq_id;
+ u32 nvec;
+ unsigned int cpu_id;
+ unsigned int node_id;
+};
+
struct hba_parameters {
unsigned int ios_per_ctrl;
unsigned int cxns_per_ctrl;
@@ -412,12 +421,13 @@ struct beiscsi_hba {
unsigned int interface_handle;
struct mgmt_session_info boot_sess;
struct invalidate_command_table inv_tbl[128];
-
+ struct msix_vec_map msix_cpu_map[MAX_CPUS];
unsigned int attr_log_enable;
int (*iotask_fn)(struct iscsi_task *,
struct scatterlist *sg,
uint32_t num_sg, uint32_t xferlen,
uint32_t writedir);
+ uint32_t func_caps;
};
struct beiscsi_session {
@@ -479,20 +489,21 @@ struct be_cmd_bhs {
struct beiscsi_io_task {
struct wrb_handle *pwrb_handle;
+ struct be_cmd_bhs *cmd_bhs;
+ unsigned short bhs_len;
struct sgl_handle *psgl_handle;
+ struct hwi_wrb_context *pwrb_context;
struct beiscsi_conn *conn;
struct scsi_cmnd *scsi_cmnd;
+ uint8_t wrb_type;
unsigned int cmd_sn;
unsigned int flags;
unsigned short cid;
unsigned short header_len;
itt_t libiscsi_itt;
- struct be_cmd_bhs *cmd_bhs;
struct be_bus_address bhs_pa;
- unsigned short bhs_len;
dma_addr_t mtask_addr;
uint32_t mtask_data_count;
- uint8_t wrb_type;
};
struct be_nonio_bhs {
@@ -745,7 +756,8 @@ struct amap_iscsi_wrb {
u8 ptr2nextwrb[8]; /* DWORD 1 */
u8 r2t_exp_dtl[24]; /* DWORD 1 */
u8 sgl_icd_idx[12]; /* DWORD 2 */
- u8 rsvd0[20]; /* DWORD 2 */
+ u8 cq_id[10]; /* DWORD 2 */
+ u8 rsvd0[10]; /* DWORD 2 */
u8 exp_data_sn[32]; /* DWORD 3 */
u8 iscsi_bhs_addr_hi[32]; /* DWORD 4 */
u8 iscsi_bhs_addr_lo[32]; /* DWORD 5 */
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 088bdf7..1b6c3fb 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -758,11 +758,47 @@ int mgmt_open_connection(struct beiscsi_hba *phba,
sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma));
sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF);
sge->len = cpu_to_le32(nonemb_cmd->size);
+
+ /* Enable interrupt redirection for CXN */
+ if (phba->func_caps & BE_ADAPTER_IFD_CAP)
+ req->ifd_state = BEISCSI_IFD_STATE_ENABLE;
+
be_mcc_notify(phba);
spin_unlock(&ctrl->mbox_lock);
return tag;
}
+int mgmt_get_adapter_caps(struct beiscsi_hba *phba)
+{
+ struct be_ctrl_info *ctrl = &phba->ctrl;
+ struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
+ struct be_mgmt_cntl_additional_attrib *req = embedded_payload(wrb);
+ int status = 0;
+
+ spin_lock(&ctrl->mbox_lock);
+ memset(wrb, 0, sizeof(*wrb));
+
+ be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
+ be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
+ OPCODE_COMMON_GET_CNTL_ADV_ATTRIB,
+ sizeof(*req));
+ status = be_mbox_notify(ctrl);
+
+ if (status) {
+ beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_INIT,
+ "BG_%d : Failed in mgmt_get_adapter_caps\n");
+ spin_unlock(&ctrl->mbox_lock);
+ phba->func_caps = BEISCSI_IFD_STATE_DISABLE;
+ return status;
+ }
+
+ phba->func_caps = req->params.func_caps;
+ spin_unlock(&ctrl->mbox_lock);
+ return status;
+}
+
+
+
unsigned int mgmt_get_all_if_id(struct beiscsi_hba *phba)
{
struct be_ctrl_info *ctrl = &phba->ctrl;
@@ -1525,11 +1561,13 @@ beiscsi_phys_port_disp(struct device *dev, struct device_attribute *attr,
phba->fw_config.phys_port);
}
-void beiscsi_offload_cxn_v0(struct beiscsi_offload_params *params,
- struct wrb_handle *pwrb_handle,
- struct be_mem_descriptor *mem_descr)
+void beiscsi_offload_cxn_v0(struct beiscsi_hba *phba,
+ struct beiscsi_offload_params *params,
+ struct wrb_handle *pwrb_handle)
{
struct iscsi_wrb *pwrb = pwrb_handle->pwrb;
+ struct be_mem_descriptor *mem_descr = phba->init_mem;
+ uint8_t cpu_num, cq_num;
memset(pwrb, 0, sizeof(*pwrb));
AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb,
@@ -1588,12 +1626,21 @@ void beiscsi_offload_cxn_v0(struct beiscsi_offload_params *params,
AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb,
pad_buffer_addr_lo, pwrb,
mem_descr->mem_array[0].bus_address.u.a32.address_lo);
+
+ if (phba->func_caps & BE_ADAPTER_IFD_CAP) {
+ cpu_num = get_cpu();
+ cq_num = phba->msix_cpu_map[cpu_num].cq_id;
+ AMAP_SET_BITS(struct amap_iscsi_wrb, cq_id, pwrb, cq_num);
+ put_cpu();
+ }
}
-void beiscsi_offload_cxn_v2(struct beiscsi_offload_params *params,
+void beiscsi_offload_cxn_v2(struct beiscsi_hba *phba,
+ struct beiscsi_offload_params *params,
struct wrb_handle *pwrb_handle)
{
struct iscsi_wrb *pwrb = pwrb_handle->pwrb;
+ uint8_t cpu_num, cq_num;
memset(pwrb, 0, sizeof(*pwrb));
@@ -1660,4 +1707,12 @@ void beiscsi_offload_cxn_v2(struct beiscsi_offload_params *params,
pwrb,
(params->dw[offsetof(struct amap_beiscsi_offload_params,
exp_statsn) / 32] + 1));
+
+ if (phba->func_caps & BE_ADAPTER_IFD_CAP) {
+ cpu_num = get_cpu();
+ cq_num = phba->msix_cpu_map[cpu_num].cq_id;
+ AMAP_SET_BITS(struct amap_iscsi_wrb_v2, cq_id, pwrb, cq_num);
+ put_cpu();
+ }
+
}
diff --git a/drivers/scsi/be2iscsi/be_mgmt.h b/drivers/scsi/be2iscsi/be_mgmt.h
index 01b8c97..e1dd796 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.h
+++ b/drivers/scsi/be2iscsi/be_mgmt.h
@@ -221,6 +221,41 @@ struct be_mgmt_controller_attributes_resp {
struct mgmt_controller_attributes params;
} __packed;
+#define BE_ADAPTER_IFD_CAP 0x01
+struct mgmt_cntrl_additional_attrib {
+ u16 ipl_file_number;
+ u8 ipl_file_version;
+ u8 rsvd0;
+ u8 on_die_temp;
+ u8 rsvd1[3];
+ u32 func_caps;
+ u32 rsvd2[4];
+ u8 fcoe_universal_bios_version[32];
+ u8 fcoe_x86_bios_version[32];
+ u8 fcoe_efi_bios_version[32];
+ u8 fcoe_fcode_version[32];
+ u8 uefi_bios_version[32];
+ u8 uefi_nic_version[32];
+ u8 uefi_fcode_version[32];
+ u8 uefi_iscsi_version[32];
+ u8 iscsi_x86_bios_version[32];
+ u8 pxe_x86_bios_version[32];
+ u8 fcoe_default_wwpn[8];
+ u8 ext_phy_version[32];
+ u8 fc_universal_bios_version[32];
+ u8 fc_x86_bios_version[32];
+ u8 fc_efi_bios_version[32];
+ u8 fc_fcode_version[32];
+ u8 ext_phy_crc_label[8];
+ u8 rsvd3[88];
+} __packed;
+
+struct be_mgmt_cntl_additional_attrib {
+ struct be_cmd_req_hdr hdr;
+ struct mgmt_cntrl_additional_attrib params;
+} __packed;
+
+
struct be_bsg_vendor_cmd {
struct be_cmd_req_hdr hdr;
unsigned short region;
@@ -269,6 +304,8 @@ struct beiscsi_endpoint {
int mgmt_get_fw_config(struct be_ctrl_info *ctrl,
struct beiscsi_hba *phba);
+int mgmt_get_adapter_caps(struct beiscsi_hba *phba);
+
unsigned int mgmt_invalidate_connection(struct beiscsi_hba *phba,
struct beiscsi_endpoint *beiscsi_ep,
unsigned short cid,
@@ -328,12 +365,14 @@ ssize_t beiscsi_free_session_disp(struct device *dev,
ssize_t beiscsi_phys_port_disp(struct device *dev,
struct device_attribute *attr, char *buf);
-void beiscsi_offload_cxn_v0(struct beiscsi_offload_params *params,
- struct wrb_handle *pwrb_handle,
- struct be_mem_descriptor *mem_descr);
-
-void beiscsi_offload_cxn_v2(struct beiscsi_offload_params *params,
+void beiscsi_offload_cxn_v0(struct beiscsi_hba *phba,
+ struct beiscsi_offload_params *params,
struct wrb_handle *pwrb_handle);
+
+void beiscsi_offload_cxn_v2(struct beiscsi_hba *phba,
+ struct beiscsi_offload_params *params,
+ struct wrb_handle *pwrb_handle);
+
void beiscsi_ue_detect(struct beiscsi_hba *phba);
#endif
--
1.7.10.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 4/7] be2iscsi : Fix statistics update in the driver.
2014-01-13 0:42 [PATCH 1/7] be2iscsi: Fix handling timed out MBX completion from FW Jayamohan Kallickal
2014-01-13 0:42 ` [PATCH 2/7] be2iscsi: Fix port speed typo in driver Jayamohan Kallickal
2014-01-13 0:42 ` [PATCH 3/7] be2iscsi : Fix IRQ_Affinity support " Jayamohan Kallickal
@ 2014-01-13 0:42 ` Jayamohan Kallickal
2014-01-17 8:47 ` Mike Christie
2014-01-13 0:42 ` [PATCH 5/7] be2iscsi: Fix doorbell format for EQ/CQ/RQ s per SLI spec Jayamohan Kallickal
` (3 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Jayamohan Kallickal @ 2014-01-13 0:42 UTC (permalink / raw)
To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, John Soni Jose
Statistics counters which are added is
- NOP IN/OUT counters
- Login PDU counters
- Text PDU counters
- Logout PDU counters
- ASYNC_PDU counters
- Reject PDU counters
- Digest Error counters
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
drivers/scsi/be2iscsi/be_iscsi.c | 12 ++++++++++--
drivers/scsi/be2iscsi/be_main.c | 30 +++++++++++++++++++++++++++++-
drivers/scsi/be2iscsi/be_main.h | 19 +++++++++++++++++++
3 files changed, 58 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index 2843a67..9ba2a64 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -899,6 +899,7 @@ void beiscsi_conn_get_stats(struct iscsi_cls_conn *cls_conn,
struct iscsi_stats *stats)
{
struct iscsi_conn *conn = cls_conn->dd_data;
+ struct beiscsi_conn *beiscsi_conn = conn->dd_data;
struct beiscsi_hba *phba = NULL;
phba = ((struct beiscsi_conn *)conn->dd_data)->phba;
@@ -914,8 +915,15 @@ void beiscsi_conn_get_stats(struct iscsi_cls_conn *cls_conn,
stats->tmfrsp_pdus = conn->tmfrsp_pdus_cnt;
stats->tmfcmd_pdus = conn->tmfcmd_pdus_cnt;
stats->r2t_pdus = conn->r2t_pdus_cnt;
- stats->digest_err = 0;
- stats->timeout_err = 0;
+ stats->noptx_pdus = beiscsi_conn->noptx_pdus;
+ stats->noprx_pdus = beiscsi_conn->noprx_pdus;
+ stats->login_pdus = beiscsi_conn->login_pdus;
+ stats->text_pdus = beiscsi_conn->text_pdus;
+ stats->textrsp_pdus = beiscsi_conn->textrsp_pdus;
+ stats->logout_pdus = beiscsi_conn->logoutrsp_pdus;
+ stats->async_pdus = beiscsi_conn->async_pdus;
+ stats->rjt_pdus = beiscsi_conn->rjt_pdus;
+ stats->digest_err = beiscsi_conn->digest_err;
stats->custom_length = 0;
strcpy(stats->custom[0].desc, "eh_abort_cnt");
stats->custom[0].value = conn->eh_abort_cnt;
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 89bf558..a045f06 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -1180,8 +1180,10 @@ beiscsi_process_async_pdu(struct beiscsi_conn *beiscsi_conn,
case ISCSI_OP_NOOP_IN:
pbuffer = NULL;
buf_len = 0;
+ beiscsi_conn->noprx_pdus++;
break;
case ISCSI_OP_ASYNC_EVENT:
+ beiscsi_conn->async_pdus++;
break;
case ISCSI_OP_REJECT:
WARN_ON(!pbuffer);
@@ -1189,6 +1191,7 @@ beiscsi_process_async_pdu(struct beiscsi_conn *beiscsi_conn,
beiscsi_log(phba, KERN_ERR,
BEISCSI_LOG_CONFIG | BEISCSI_LOG_IO,
"BM_%d : In ISCSI_OP_REJECT\n");
+ beiscsi_conn->rjt_pdus++;
break;
case ISCSI_OP_LOGIN_RSP:
case ISCSI_OP_TEXT_RSP:
@@ -1196,6 +1199,9 @@ beiscsi_process_async_pdu(struct beiscsi_conn *beiscsi_conn,
io_task = task->dd_data;
login_hdr = (struct iscsi_hdr *)ppdu;
login_hdr->itt = io_task->libiscsi_itt;
+
+ if (login_hdr->opcode == ISCSI_OP_TEXT_RSP)
+ beiscsi_conn->textrsp_pdus++;
break;
default:
beiscsi_log(phba, KERN_WARNING,
@@ -1404,6 +1410,8 @@ be_complete_io(struct beiscsi_conn *beiscsi_conn,
return;
}
+
+ conn->scsirsp_pdus_cnt++;
task->sc->result = (DID_OK << 16) | status;
if (rsp != ISCSI_STATUS_CMD_COMPLETED) {
task->sc->result = DID_ERROR << 16;
@@ -1464,6 +1472,8 @@ be_complete_logout(struct beiscsi_conn *beiscsi_conn,
hdr->dlength[2] = 0;
hdr->hlength = 0;
hdr->itt = io_task->libiscsi_itt;
+
+ beiscsi_conn->logoutrsp_pdus++;
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr, NULL, 0);
}
@@ -1485,6 +1495,8 @@ be_complete_tmf(struct beiscsi_conn *beiscsi_conn,
csol_cqe->cmd_wnd - 1);
hdr->itt = io_task->libiscsi_itt;
+
+ conn->tmfrsp_pdus_cnt++;
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr, NULL, 0);
}
@@ -1539,6 +1551,8 @@ be_complete_nopin_resp(struct beiscsi_conn *beiscsi_conn,
hdr->opcode = ISCSI_OP_NOOP_IN;
hdr->itt = io_task->libiscsi_itt;
+
+ beiscsi_conn->noprx_pdus++;
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr, NULL, 0);
}
@@ -2240,7 +2254,14 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
"BM_%d : Ignoring %s[%d] on CID : %d\n",
cqe_desc[code], code, cid);
break;
+ case CXN_KILLED_HDR_DIGEST_ERR:
case SOL_CMD_KILLED_DATA_DIGEST_ERR:
+ beiscsi_conn->digest_err++;
+ beiscsi_log(phba, KERN_ERR,
+ BEISCSI_LOG_CONFIG | BEISCSI_LOG_IO,
+ "BM_%d : Cmd Notification %s[%d] on CID : %d\n",
+ cqe_desc[code], code, cid);
+ break;
case CMD_KILLED_INVALID_STATSN_RCVD:
case CMD_KILLED_INVALID_R2T_RCVD:
case CMD_CXN_KILLED_LUN_INVALID:
@@ -2254,6 +2275,7 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
cqe_desc[code], code, cid);
break;
case UNSOL_DATA_DIGEST_ERROR_NOTIFY:
+ beiscsi_conn->digest_err++;
beiscsi_log(phba, KERN_ERR,
BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG,
"BM_%d : Dropping %s[%d] on DPDU ring on CID : %d\n",
@@ -2266,7 +2288,6 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
case CXN_KILLED_PDU_SIZE_EXCEEDS_DSL:
case CXN_KILLED_BURST_LEN_MISMATCH:
case CXN_KILLED_AHS_RCVD:
- case CXN_KILLED_HDR_DIGEST_ERR:
case CXN_KILLED_UNKNOWN_HDR:
case CXN_KILLED_STALE_ITT_TTT_RCVD:
case CXN_KILLED_INVALID_ITT_TTT_RCVD:
@@ -4923,6 +4944,7 @@ int beiscsi_iotask_v2(struct iscsi_task *task, struct scatterlist *sg,
AMAP_SET_BITS(struct amap_iscsi_wrb_v2, type, pwrb,
INI_WR_CMD);
AMAP_SET_BITS(struct amap_iscsi_wrb_v2, dsp, pwrb, 1);
+ conn->txdata_octets += (xferlen + sg_dma_len(sg));
} else {
AMAP_SET_BITS(struct amap_iscsi_wrb_v2, type, pwrb,
INI_RD_CMD);
@@ -4987,6 +5009,7 @@ static int beiscsi_iotask(struct iscsi_task *task, struct scatterlist *sg,
AMAP_SET_BITS(struct amap_iscsi_wrb, type, pwrb,
INI_WR_CMD);
AMAP_SET_BITS(struct amap_iscsi_wrb, dsp, pwrb, 1);
+ conn->txdata_octets += (xferlen + sg_dma_len(sg));
} else {
AMAP_SET_BITS(struct amap_iscsi_wrb, type, pwrb,
INI_RD_CMD);
@@ -5090,6 +5113,7 @@ static int beiscsi_mtask(struct iscsi_task *task)
case ISCSI_OP_LOGIN:
AMAP_SET_BITS(struct amap_iscsi_wrb, cmdsn_itt, pwrb, 1);
ADAPTER_SET_WRB_TYPE(pwrb, TGT_DM_CMD, pwrb_typeoffset);
+ beiscsi_conn->login_pdus++;
hwi_write_buffer(pwrb, task);
break;
case ISCSI_OP_NOOP_OUT:
@@ -5110,18 +5134,22 @@ static int beiscsi_mtask(struct iscsi_task *task)
AMAP_SET_BITS(struct amap_iscsi_wrb_v2,
dmsg, pwrb, 0);
}
+ beiscsi_conn->noptx_pdus++;
hwi_write_buffer(pwrb, task);
break;
case ISCSI_OP_TEXT:
ADAPTER_SET_WRB_TYPE(pwrb, TGT_DM_CMD, pwrb_typeoffset);
+ beiscsi_conn->text_pdus++;
hwi_write_buffer(pwrb, task);
break;
case ISCSI_OP_SCSI_TMFUNC:
ADAPTER_SET_WRB_TYPE(pwrb, INI_TMF_CMD, pwrb_typeoffset);
+ conn->tmfcmd_pdus_cnt++;
hwi_write_buffer(pwrb, task);
break;
case ISCSI_OP_LOGOUT:
ADAPTER_SET_WRB_TYPE(pwrb, HWH_TYPE_LOGOUT, pwrb_typeoffset);
+ beiscsi_conn->logout_pdus++;
hwi_write_buffer(pwrb, task);
break;
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index 0076119..d21ad9e 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -449,6 +449,25 @@ struct beiscsi_conn {
struct sgl_handle *plogin_sgl_handle;
struct beiscsi_session *beiscsi_sess;
struct iscsi_task *task;
+
+ /* CXN statistics */
+ /* Xmit Counters */
+ uint32_t noptx_pdus;
+ uint32_t login_pdus;
+ uint32_t text_pdus;
+ uint32_t logout_pdus;
+ uint32_t snack_pdus;
+
+ /* Rx Counters */
+ uint32_t noprx_pdus;
+ uint32_t textrsp_pdus;
+ uint32_t logoutrsp_pdus;
+ uint32_t async_pdus;
+ uint32_t rjt_pdus;
+
+ /* Error Counters */
+ uint32_t digest_err;
+ uint32_t format_err;
};
/* This structure is used by the chip */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 4/7] be2iscsi : Fix statistics update in the driver.
2014-01-13 0:42 ` [PATCH 4/7] be2iscsi : Fix statistics update in the driver Jayamohan Kallickal
@ 2014-01-17 8:47 ` Mike Christie
0 siblings, 0 replies; 10+ messages in thread
From: Mike Christie @ 2014-01-17 8:47 UTC (permalink / raw)
To: Jayamohan Kallickal
Cc: jbottomley, linux-scsi, Jayamohan Kallickal, John Soni Jose
On 01/12/2014 06:42 PM, Jayamohan Kallickal wrote:
>
> diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
> index 0076119..d21ad9e 100644
> --- a/drivers/scsi/be2iscsi/be_main.h
> +++ b/drivers/scsi/be2iscsi/be_main.h
> @@ -449,6 +449,25 @@ struct beiscsi_conn {
> struct sgl_handle *plogin_sgl_handle;
> struct beiscsi_session *beiscsi_sess;
> struct iscsi_task *task;
> +
> + /* CXN statistics */
> + /* Xmit Counters */
> + uint32_t noptx_pdus;
> + uint32_t login_pdus;
> + uint32_t text_pdus;
> + uint32_t logout_pdus;
> + uint32_t snack_pdus;
> +
> + /* Rx Counters */
> + uint32_t noprx_pdus;
> + uint32_t textrsp_pdus;
> + uint32_t logoutrsp_pdus;
> + uint32_t async_pdus;
> + uint32_t rjt_pdus;
> +
> + /* Error Counters */
> + uint32_t digest_err;
> + uint32_t format_err;
> };
>
You should put these on the iscsi_conn struct then have
__iscsi_complete_pdu handle the counters.
libiscsi should then also setup processing of those stats. You should
make a libiscsi helper which the drivers call. See iscsi_tcp
iscsi_sw_tcp_conn_get_stats call to iscsi_tcp_conn_get_stats for an
example for how it is done with libiscsi_tcp and lower level stats it
manages.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 5/7] be2iscsi: Fix doorbell format for EQ/CQ/RQ s per SLI spec.
2014-01-13 0:42 [PATCH 1/7] be2iscsi: Fix handling timed out MBX completion from FW Jayamohan Kallickal
` (2 preceding siblings ...)
2014-01-13 0:42 ` [PATCH 4/7] be2iscsi : Fix statistics update in the driver Jayamohan Kallickal
@ 2014-01-13 0:42 ` Jayamohan Kallickal
2014-01-17 8:53 ` Mike Christie
2014-01-13 0:42 ` [PATCH 6/7] be2iscsi: Fix the session cleanup when reboot/shutdown happens Jayamohan Kallickal
` (2 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Jayamohan Kallickal @ 2014-01-13 0:42 UTC (permalink / raw)
To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, John Soni Jose
The doorbel format has been updated to support additonal functionalities
of SKH-R adapter. These changes are made such that older FW also works fine.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
drivers/scsi/be2iscsi/be_cmds.c | 12 +++++++++++-
drivers/scsi/be2iscsi/be_cmds.h | 6 +++---
drivers/scsi/be2iscsi/be_main.c | 23 +++++++++++++++++++++--
drivers/scsi/be2iscsi/be_main.h | 13 +++++++++++--
4 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c
index b14949a..4e1074a 100644
--- a/drivers/scsi/be2iscsi/be_cmds.c
+++ b/drivers/scsi/be2iscsi/be_cmds.c
@@ -436,10 +436,20 @@ static void beiscsi_cq_notify(struct beiscsi_hba *phba, u16 qid, bool arm,
u16 num_popped)
{
u32 val = 0;
- val |= qid & DB_CQ_RING_ID_MASK;
+
if (arm)
val |= 1 << DB_CQ_REARM_SHIFT;
+
val |= num_popped << DB_CQ_NUM_POPPED_SHIFT;
+
+ /* Setting lower order CQ_ID Bits */
+ val |= qid & DB_CQ_RING_ID_LOW_MASK;
+
+ /* Setting Higher order CQ_ID Bits */
+ val |= (((qid >> DB_CQ_HIGH_FEILD_SHIFT) &
+ DB_CQ_RING_ID_HIGH_MASK)
+ << DB_CQ_HIGH_SET_SHIFT);
+
iowrite32(val, phba->db_va + DB_CQ_OFFSET);
}
diff --git a/drivers/scsi/be2iscsi/be_cmds.h b/drivers/scsi/be2iscsi/be_cmds.h
index 69f849e..59abd27 100644
--- a/drivers/scsi/be2iscsi/be_cmds.h
+++ b/drivers/scsi/be2iscsi/be_cmds.h
@@ -103,7 +103,7 @@ struct be_mcc_compl {
/********** MCC door bell ************/
#define DB_MCCQ_OFFSET 0x140
-#define DB_MCCQ_RING_ID_MASK 0x7FF /* bits 0 - 10 */
+#define DB_MCCQ_RING_ID_MASK 0xFFFF /* bits 0 - 15 */
/* Number of entries posted */
#define DB_MCCQ_NUM_POSTED_SHIFT 16 /* bits 16 - 29 */
@@ -1025,8 +1025,8 @@ struct be_mcc_wrb_context {
int *users_final_status;
} __packed;
-#define DB_DEF_PDU_RING_ID_MASK 0x3FF /* bits 0 - 9 */
-#define DB_DEF_PDU_CQPROC_MASK 0x3FFF /* bits 0 - 9 */
+#define DB_DEF_PDU_RING_ID_MASK 0x3FFF /* bits 0 - 13 */
+#define DB_DEF_PDU_CQPROC_MASK 0x3FFF /* bits 16 - 29 */
#define DB_DEF_PDU_REARM_SHIFT 14
#define DB_DEF_PDU_EVENT_SHIFT 15
#define DB_DEF_PDU_CQPROC_SHIFT 16
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index a045f06..8e19b90 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -811,14 +811,23 @@ static void hwi_ring_eq_db(struct beiscsi_hba *phba,
unsigned char rearm, unsigned char event)
{
u32 val = 0;
- val |= id & DB_EQ_RING_ID_MASK;
+
if (rearm)
val |= 1 << DB_EQ_REARM_SHIFT;
if (clr_interrupt)
val |= 1 << DB_EQ_CLR_SHIFT;
if (event)
val |= 1 << DB_EQ_EVNT_SHIFT;
+
val |= num_processed << DB_EQ_NUM_POPPED_SHIFT;
+ /* Setting lower order EQ_ID Bits */
+ val |= (id & DB_EQ_RING_ID_LOW_MASK);
+
+ /* Setting Higher order EQ_ID Bits */
+ val |= (((id >> DB_EQ_HIGH_FEILD_SHIFT) &
+ DB_EQ_RING_ID_HIGH_MASK)
+ << DB_EQ_HIGH_SET_SHIFT);
+
iowrite32(val, phba->db_va + DB_EQ_OFFSET);
}
@@ -1155,10 +1164,20 @@ static void hwi_ring_cq_db(struct beiscsi_hba *phba,
unsigned char rearm, unsigned char event)
{
u32 val = 0;
- val |= id & DB_CQ_RING_ID_MASK;
+
if (rearm)
val |= 1 << DB_CQ_REARM_SHIFT;
+
val |= num_processed << DB_CQ_NUM_POPPED_SHIFT;
+
+ /* Setting lower order CQ_ID Bits */
+ val |= (id & DB_CQ_RING_ID_LOW_MASK);
+
+ /* Setting Higher order CQ_ID Bits */
+ val |= (((id >> DB_CQ_HIGH_FEILD_SHIFT) &
+ DB_CQ_RING_ID_HIGH_MASK)
+ << DB_CQ_HIGH_SET_SHIFT);
+
iowrite32(val, phba->db_va + DB_CQ_OFFSET);
}
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index d21ad9e..62c5a24 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -135,11 +135,15 @@
#define DB_RXULP0_OFFSET 0xA0
/********* Event Q door bell *************/
#define DB_EQ_OFFSET DB_CQ_OFFSET
-#define DB_EQ_RING_ID_MASK 0x1FF /* bits 0 - 8 */
+#define DB_EQ_RING_ID_LOW_MASK 0x1FF /* bits 0 - 8 */
/* Clear the interrupt for this eq */
#define DB_EQ_CLR_SHIFT (9) /* bit 9 */
/* Must be 1 */
#define DB_EQ_EVNT_SHIFT (10) /* bit 10 */
+/* Higher Order EQ_ID bit */
+#define DB_EQ_RING_ID_HIGH_MASK 0x1F /* bits 11 - 15 */
+#define DB_EQ_HIGH_SET_SHIFT 11
+#define DB_EQ_HIGH_FEILD_SHIFT 9
/* Number of event entries processed */
#define DB_EQ_NUM_POPPED_SHIFT (16) /* bits 16 - 28 */
/* Rearm bit */
@@ -147,7 +151,12 @@
/********* Compl Q door bell *************/
#define DB_CQ_OFFSET 0x120
-#define DB_CQ_RING_ID_MASK 0x3FF /* bits 0 - 9 */
+#define DB_CQ_RING_ID_LOW_MASK 0x3FF /* bits 0 - 9 */
+/* Higher Order CQ_ID bit */
+#define DB_CQ_RING_ID_HIGH_MASK 0x1F /* bits 11 - 15 */
+#define DB_CQ_HIGH_SET_SHIFT 11
+#define DB_CQ_HIGH_FEILD_SHIFT 10
+
/* Number of event entries processed */
#define DB_CQ_NUM_POPPED_SHIFT (16) /* bits 16 - 28 */
/* Rearm bit */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 5/7] be2iscsi: Fix doorbell format for EQ/CQ/RQ s per SLI spec.
2014-01-13 0:42 ` [PATCH 5/7] be2iscsi: Fix doorbell format for EQ/CQ/RQ s per SLI spec Jayamohan Kallickal
@ 2014-01-17 8:53 ` Mike Christie
0 siblings, 0 replies; 10+ messages in thread
From: Mike Christie @ 2014-01-17 8:53 UTC (permalink / raw)
To: Jayamohan Kallickal
Cc: jbottomley, linux-scsi, Jayamohan Kallickal, John Soni Jose
On 01/12/2014 06:42 PM, Jayamohan Kallickal wrote:
> diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c
> index b14949a..4e1074a 100644
> --- a/drivers/scsi/be2iscsi/be_cmds.c
> +++ b/drivers/scsi/be2iscsi/be_cmds.c
> @@ -436,10 +436,20 @@ static void beiscsi_cq_notify(struct beiscsi_hba *phba, u16 qid, bool arm,
> u16 num_popped)
> {
> u32 val = 0;
> - val |= qid & DB_CQ_RING_ID_MASK;
> +
> if (arm)
> val |= 1 << DB_CQ_REARM_SHIFT;
> +
> val |= num_popped << DB_CQ_NUM_POPPED_SHIFT;
> +
> + /* Setting lower order CQ_ID Bits */
> + val |= qid & DB_CQ_RING_ID_LOW_MASK;
> +
> + /* Setting Higher order CQ_ID Bits */
> + val |= (((qid >> DB_CQ_HIGH_FEILD_SHIFT) &
> + DB_CQ_RING_ID_HIGH_MASK)
> + << DB_CQ_HIGH_SET_SHIFT);
> +
> iowrite32(val, phba->db_va + DB_CQ_OFFSET);
> @@ -1155,10 +1164,20 @@ static void hwi_ring_cq_db(struct beiscsi_hba *phba,
> unsigned char rearm, unsigned char event)
> {
> u32 val = 0;
> - val |= id & DB_CQ_RING_ID_MASK;
> +
> if (rearm)
> val |= 1 << DB_CQ_REARM_SHIFT;
> +
> val |= num_processed << DB_CQ_NUM_POPPED_SHIFT;
> +
> + /* Setting lower order CQ_ID Bits */
> + val |= (id & DB_CQ_RING_ID_LOW_MASK);
> +
> + /* Setting Higher order CQ_ID Bits */
> + val |= (((id >> DB_CQ_HIGH_FEILD_SHIFT) &
> + DB_CQ_RING_ID_HIGH_MASK)
> + << DB_CQ_HIGH_SET_SHIFT);
> +
> iowrite32(val, phba->db_va + DB_CQ_OFFSET);
> }
>
Are these 2 functions doing the same thing?
I think hwi_ring_cq_db is also doing the same operations, but with
different values. You should make a function.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 6/7] be2iscsi: Fix the session cleanup when reboot/shutdown happens
2014-01-13 0:42 [PATCH 1/7] be2iscsi: Fix handling timed out MBX completion from FW Jayamohan Kallickal
` (3 preceding siblings ...)
2014-01-13 0:42 ` [PATCH 5/7] be2iscsi: Fix doorbell format for EQ/CQ/RQ s per SLI spec Jayamohan Kallickal
@ 2014-01-13 0:42 ` Jayamohan Kallickal
2014-01-13 0:42 ` [PATCH 7/7] be2iscsi : Bump driver version Jayamohan Kallickal
2014-01-13 0:42 ` [PATCH 0/7] be2iscsi: Update to 10.2.84.0 Jayamohan Kallickal
6 siblings, 0 replies; 10+ messages in thread
From: Jayamohan Kallickal @ 2014-01-13 0:42 UTC (permalink / raw)
To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, John Soni Jose
In iSCSI Boot scenario, when machine is reboot/shutdown phase
the active sessions are not closed. Driver queue cleanup is
done as part of unload and device is disabled.
Sessions are still active, iSCSI commands are issued from
session which comes to driver, as driver cleanup and device
disabled there is kernel stack dump with errors.
Fix is invoking iscsi_session_failure with ISCSI_ERR_INVALID_HOST
on all the active sessions when shutdown routine is called.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
drivers/scsi/be2iscsi/be.h | 1 +
drivers/scsi/be2iscsi/be_cmds.c | 17 ++++++++++++++++-
drivers/scsi/be2iscsi/be_cmds.h | 1 +
drivers/scsi/be2iscsi/be_iscsi.c | 1 +
drivers/scsi/be2iscsi/be_main.c | 2 ++
drivers/scsi/be2iscsi/be_main.h | 5 +++++
6 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/be2iscsi/be.h b/drivers/scsi/be2iscsi/be.h
index 23c73fe..1bfb0bd 100644
--- a/drivers/scsi/be2iscsi/be.h
+++ b/drivers/scsi/be2iscsi/be.h
@@ -139,6 +139,7 @@ struct be_ctrl_info {
#define PAGE_SHIFT_4K 12
#define PAGE_SIZE_4K (1 << PAGE_SHIFT_4K)
#define mcc_timeout 120000 /* 12s timeout */
+#define BEISCSI_LOGOUT_SYNC_DELAY 250
/* Returns number of pages spanned by the data starting at the given addr */
#define PAGES_4K_SPANNED(_address, size) \
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c
index 4e1074a..757d10d 100644
--- a/drivers/scsi/be2iscsi/be_cmds.c
+++ b/drivers/scsi/be2iscsi/be_cmds.c
@@ -400,8 +400,23 @@ static struct be_mcc_compl *be_mcc_compl_get(struct beiscsi_hba *phba)
return NULL;
}
-static void be2iscsi_fail_session(struct iscsi_cls_session *cls_session)
+/**
+ * be2iscsi_fail_session(): Closing session with appropriate error
+ * @cls_session: ptr to session
+ *
+ * Depending on adapter state appropriate error flag is passed.
+ **/
+void be2iscsi_fail_session(struct iscsi_cls_session *cls_session)
{
+ struct Scsi_Host *shost = iscsi_session_to_shost(cls_session);
+ struct beiscsi_hba *phba = iscsi_host_priv(shost);
+ uint32_t iscsi_err_flag;
+
+ if (phba->state & BE_ADAPTER_STATE_SHUTDOWN)
+ iscsi_err_flag = ISCSI_ERR_INVALID_HOST;
+ else
+ iscsi_err_flag = ISCSI_ERR_CONN_FAILED;
+
iscsi_session_failure(cls_session->dd_data, ISCSI_ERR_CONN_FAILED);
}
diff --git a/drivers/scsi/be2iscsi/be_cmds.h b/drivers/scsi/be2iscsi/be_cmds.h
index 59abd27..64b60e7 100644
--- a/drivers/scsi/be2iscsi/be_cmds.h
+++ b/drivers/scsi/be2iscsi/be_cmds.h
@@ -1325,4 +1325,5 @@ void be_wrb_hdr_prepare(struct be_mcc_wrb *wrb, int payload_len,
void be_cmd_hdr_prepare(struct be_cmd_req_hdr *req_hdr,
u8 subsystem, u8 opcode, int cmd_len);
+void be2iscsi_fail_session(struct iscsi_cls_session *cls_session);
#endif /* !BEISCSI_CMDS_H */
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index 9ba2a64..0a605cd 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -1371,6 +1371,7 @@ void beiscsi_ep_disconnect(struct iscsi_endpoint *ep)
beiscsi_mccq_compl(phba, tag, NULL, NULL);
beiscsi_close_conn(beiscsi_ep, tcp_upload_flag);
free_ep:
+ msleep(BEISCSI_LOGOUT_SYNC_DELAY);
beiscsi_free_ep(beiscsi_ep);
beiscsi_unbind_conn_to_cid(phba, beiscsi_ep->ep_cid);
iscsi_destroy_endpoint(beiscsi_ep->openiscsi_ep);
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 8e19b90..89da085 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -5411,6 +5411,8 @@ static void beiscsi_shutdown(struct pci_dev *pcidev)
return;
}
+ phba->state = BE_ADAPTER_STATE_SHUTDOWN;
+ iscsi_host_for_each_session(phba->shost, be2iscsi_fail_session);
beiscsi_quiesce(phba, BEISCSI_CLEAN_UNLOAD);
pci_disable_device(pcidev);
}
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index 62c5a24..3806a09 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -97,9 +97,14 @@
#define INVALID_SESS_HANDLE 0xFFFFFFFF
+/**
+ * Adapter States
+ **/
#define BE_ADAPTER_LINK_UP 0x001
#define BE_ADAPTER_LINK_DOWN 0x002
#define BE_ADAPTER_PCI_ERR 0x004
+#define BE_ADAPTER_STATE_SHUTDOWN 0x008
+
#define BEISCSI_CLEAN_UNLOAD 0x01
#define BEISCSI_EEH_UNLOAD 0x02
--
1.7.10.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 7/7] be2iscsi : Bump driver version
2014-01-13 0:42 [PATCH 1/7] be2iscsi: Fix handling timed out MBX completion from FW Jayamohan Kallickal
` (4 preceding siblings ...)
2014-01-13 0:42 ` [PATCH 6/7] be2iscsi: Fix the session cleanup when reboot/shutdown happens Jayamohan Kallickal
@ 2014-01-13 0:42 ` Jayamohan Kallickal
2014-01-13 0:42 ` [PATCH 0/7] be2iscsi: Update to 10.2.84.0 Jayamohan Kallickal
6 siblings, 0 replies; 10+ messages in thread
From: Jayamohan Kallickal @ 2014-01-13 0:42 UTC (permalink / raw)
To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal, John Soni Jose
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
drivers/scsi/be2iscsi/be_main.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index 3806a09..ea98713 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -36,7 +36,7 @@
#include <scsi/scsi_transport_iscsi.h>
#define DRV_NAME "be2iscsi"
-#define BUILD_STR "10.0.659.0"
+#define BUILD_STR "10.2.84.0"
#define BE_NAME "Emulex OneConnect" \
"Open-iSCSI Driver version" BUILD_STR
#define DRV_DESC BE_NAME " " "Driver"
--
1.7.10.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 0/7] be2iscsi: Update to 10.2.84.0
2014-01-13 0:42 [PATCH 1/7] be2iscsi: Fix handling timed out MBX completion from FW Jayamohan Kallickal
` (5 preceding siblings ...)
2014-01-13 0:42 ` [PATCH 7/7] be2iscsi : Bump driver version Jayamohan Kallickal
@ 2014-01-13 0:42 ` Jayamohan Kallickal
6 siblings, 0 replies; 10+ messages in thread
From: Jayamohan Kallickal @ 2014-01-13 0:42 UTC (permalink / raw)
To: jbottomley, linux-scsi, michaelc; +Cc: Jayamohan Kallickal
This patchset updates be2iscsi driver to 10.2.84.0
and contains the following patches based of scsi.git
for-next-base
`
PATCH 0001 - Fix handling MBX completion time out
PATCH 0002 - Fix typo in port speed
PATCH 0003 - Fix IRQ Affinity Support in driver
PATCH 0004 - Fix updating statistics in driver
PATCH 0005 - Fix DoorBell FOrmat for EQ and CQ
PATCH 0006 - Fix Session Cleanup
PATCH 0007 - Bump the driver version
Thanks
Jay
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
^ permalink raw reply [flat|nested] 10+ messages in thread