Skip to contentSkip to conversation

be2iscsi: Enabling MSIX and mcc_rings

PATCH In review Jayamohan Kallickal 2 participants 4 messages Oct 13, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 be2iscsi: Enabling MSIX and mcc_rings

This patch adds

1) Turns on msix
2) mcc_ring support for sending FW commands
3) Support for Ring Mode of WRB Posting

---
 drivers/scsi/be2iscsi/be.h       |   24 +-
 drivers/scsi/be2iscsi/be_cmds.c  |  234 ++++++++++-
 drivers/scsi/be2iscsi/be_cmds.h  |   31 ++-
 drivers/scsi/be2iscsi/be_iscsi.c |   16 +-
 drivers/scsi/be2iscsi/be_main.c  |  926 +++++++++++++++++++++++++++++---------
 drivers/scsi/be2iscsi/be_main.h  |   45 +-
 drivers/scsi/be2iscsi/be_mgmt.c  |   83 +++-
 drivers/scsi/be2iscsi/be_mgmt.h  |   17 +-
 8 files changed, 1097 insertions(+), 279 deletions(-)
drivers/scsi/be2iscsi/be.h +9 -15
index b36020d..a93a504 100644
@@ -20,8 +20,10 @@
 
 #include <linux/pci.h>
 #include <linux/if_vlan.h>
-
-#define FW_VER_LEN 32
+#include <linux/blk-iopoll.h>
+#define FW_VER_LEN	32
+#define MCC_Q_LEN	128
+#define MCC_CQ_LEN	256
 
 struct be_dma_mem {
 	void *va;
@@ -74,18 +76,14 @@ static inline void queue_tail_inc(struct be_queue_info *q)
 
 struct be_eq_obj {
 	struct be_queue_info q;
-	char desc[32];
-
-	/* Adaptive interrupt coalescing (AIC) info */
-	bool enable_aic;
-	u16 min_eqd;		/* in usecs */
-	u16 max_eqd;		/* in usecs */
-	u16 cur_eqd;		/* in usecs */
+	struct beiscsi_hba *phba;
+	struct be_queue_info *cq;
+	struct blk_iopoll	iopoll;
 };
 
 struct be_mcc_obj {
-	struct be_queue_info *q;
-	struct be_queue_info *cq;
+	struct be_queue_info q;
+	struct be_queue_info cq;
 };
 
 struct be_ctrl_info {
@@ -176,8 +174,4 @@ static inline void swap_dws(void *wrb, int len)
 	} while (len);
 #endif /* __BIG_ENDIAN */
 }
-
-extern void beiscsi_cq_notify(struct be_ctrl_info *ctrl, u16 qid, bool arm,
-			      u16 num_popped);
-
 #endif /* BEISCSI_H */
drivers/scsi/be2iscsi/be_cmds.c +226 -8

334 lines not on this page · raw message

drivers/scsi/be2iscsi/be_cmds.h +28 -3
index c20d686..ff8c775 100644
@@ -47,6 +47,8 @@ struct be_mcc_wrb {
 
 #define CQE_FLAGS_VALID_MASK (1 << 31)
 #define CQE_FLAGS_ASYNC_MASK (1 << 30)
+#define CQE_FLAGS_COMPLETED_MASK 	(1 << 28)
+#define CQE_FLAGS_CONSUMED_MASK 	(1 << 27)
 
 /* Completion Status */
 #define MCC_STATUS_SUCCESS 0x0
@@ -382,7 +384,6 @@ struct be_cmd_req_modify_eq_delay {
 
 #define ETH_ALEN	6
 
-
 struct be_cmd_req_get_mac_addr {
 	struct be_cmd_req_hdr hdr;
 	u32 nic_port_count;
@@ -417,14 +418,21 @@ int beiscsi_cmd_cq_create(struct be_ctrl_info *ctrl,
 
 int beiscsi_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q,
 			  int type);
+int be_cmd_mccq_create(struct beiscsi_hba *phba,
+			struct be_queue_info *mccq,
+			struct be_queue_info *cq);
+
 int be_poll_mcc(struct be_ctrl_info *ctrl);
-unsigned char mgmt_check_supported_fw(struct be_ctrl_info *ctrl);
-int be_cmd_get_mac_addr(struct be_ctrl_info *ctrl, u8 *mac_addr);
+unsigned char mgmt_check_supported_fw(struct be_ctrl_info *ctrl,
+				      struct beiscsi_hba *phba);
+int be_cmd_get_mac_addr(struct beiscsi_hba *phba, u8 *mac_addr);
 
 /*ISCSI Functuions */
 int be_cmd_fw_initialize(struct be_ctrl_info *ctrl);
 
 struct be_mcc_wrb *wrb_from_mbox(struct be_dma_mem *mbox_mem);
+struct be_mcc_wrb *wrb_from_mccq(struct beiscsi_hba *phba);
+int be_mcc_notify_wait(struct beiscsi_hba *phba);
 
 int be_mbox_notify(struct be_ctrl_info *ctrl);
 
@@ -531,6 +539,23 @@ struct amap_sol_cqe {
 	u8 valid;		/* dword 3 */
 } __packed;
 
+#define SOL_ICD_INDEX_MASK	0x0003FFC0
+struct amap_sol_cqe_ring {
+	u8 hw_sts[8];		/* dword 0 */
+	u8 i_sts[8];		/* dword 0 */
+	u8 i_resp[8];		/* dword 0 */
+	u8 i_flags[7];		/* dword 0 */
+	u8 s;			/* dword 0 */
+	u8 i_exp_cmd_sn[32];	/* dword 1 */
+	u8 code[6];		/* dword 2 */
+	u8 icd_index[12];	/* dword 2 */
+	u8 rsvd[6];		/* dword 2 */
+	u8 i_cmd_wnd[8];	/* dword 2 */
+	u8 i_res_cnt[31];	/* dword 3 */
+	u8 valid;		/* dword 3 */
+} __packed;
+
+
 
 /**
  * Post WRB Queue Doorbell Register used by the host Storage
drivers/scsi/be2iscsi/be_iscsi.c +6 -10
index 2fd2544..c2f0c90 100644
@@ -67,11 +67,11 @@ struct iscsi_cls_session *beiscsi_session_create(struct iscsi_endpoint *ep,
 		cmds_max = beiscsi_ep->phba->params.wrbs_per_cxn;
 	}
 
-	 cls_session = iscsi_session_setup(&beiscsi_iscsi_transport,
-					   shost, cmds_max,
-					   sizeof(*beiscsi_sess),
-					   sizeof(*io_task),
-					   initial_cmdsn, ISCSI_MAX_TARGET);
+	cls_session = iscsi_session_setup(&beiscsi_iscsi_transport,
+					  shost, cmds_max,
+					  sizeof(*beiscsi_sess),
+					  sizeof(*io_task),
+					  initial_cmdsn, ISCSI_MAX_TARGET);
 	if (!cls_session)
 		return NULL;
 	sess = cls_session->dd_data;
@@ -297,7 +297,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost,
 
 	switch (param) {
 	case ISCSI_HOST_PARAM_HWADDRESS:
-		be_cmd_get_mac_addr(&phba->ctrl, phba->mac_address);
+		be_cmd_get_mac_addr(phba, phba->mac_address);
 		len = sysfs_format_mac(buf, phba->mac_address, ETH_ALEN);
 		break;
 	default:
@@ -377,16 +377,12 @@ int beiscsi_conn_start(struct iscsi_cls_conn *cls_conn)
 	struct beiscsi_conn *beiscsi_conn = conn->dd_data;
 	struct beiscsi_endpoint *beiscsi_ep;
 	struct beiscsi_offload_params params;
-	struct iscsi_session *session = conn->session;
-	struct Scsi_Host *shost = iscsi_session_to_shost(session->cls_session);
-	struct beiscsi_hba *phba = iscsi_host_priv(shost);
 
 	memset(&params, 0, sizeof(struct beiscsi_offload_params));
 	beiscsi_ep = beiscsi_conn->ep;
 	if (!beiscsi_ep)
 		SE_DEBUG(DBG_LVL_1, "In beiscsi_conn_start , no beiscsi_ep\n");
 
-	free_mgmt_sgl_handle(phba, beiscsi_conn->plogin_sgl_handle);
 	beiscsi_conn->login_in_progress = 0;
 	beiscsi_set_params_for_offld(beiscsi_conn, &params);
 	beiscsi_offload_connection(beiscsi_conn, &params);
drivers/scsi/be2iscsi/be_main.c +717 -209

1,567 lines not on this page · raw message

drivers/scsi/be2iscsi/be_main.h +25 -20

136 lines not on this page · raw message

drivers/scsi/be2iscsi/be_mgmt.c +70 -13

170 lines not on this page · raw message

drivers/scsi/be2iscsi/be_mgmt.h +16 -1
index 00e816e..37ddbff 100644
@@ -175,7 +175,9 @@ struct mgmt_hba_attributes {
 	u8 phy_port;
 	u32 firmware_post_status;
 	u32 hba_mtu[8];
-	u32 future_u32[4];
+	u8 iscsi_features;
+	u8 future_u8[3];
+	u32 future_u32[3];
 } __packed;
 
 struct mgmt_controller_attributes {
@@ -204,6 +206,19 @@ struct be_mgmt_controller_attributes_resp {
 	struct mgmt_controller_attributes params;
 } __packed;
 
+struct be_mgmt_fw_cmd_info {
+	struct be_cmd_req_hdr hdr;
+	void   *pdata_buffer;
+	unsigned int data_length;
+} __packed;
+
+struct be_mgmt_fw_cmd_info_resp {
+	struct be_cmd_resp_hdr hdr;
+	void   *pdata_buffer;
+	unsigned int data_length;
+} __packed;
+
+
 /* configuration management */
 
 #define GET_MGMT_CONTROLLER_WS(phba)    (phba->pmgmt_ws)
Signature · 1 line
1.6.4
#1 lore raw
Quoted 12 lines · Jayamohan Kallickal

This patch adds

1) Turns on msix
2) mcc_ring support for sending FW commands
3) Support for Ring Mode of WRB Posting

drivers/scsi/be2iscsi/be_mgmt.h +3 -0
+struct be_mgmt_fw_cmd_info {
+	struct be_cmd_req_hdr hdr;
+	void   *pdata_buffer;

drivers/scsi/be2iscsi/be_mgmt.h struct be_mgmt_controller_attributes_resp { · line 221

Quoted 10 lines
drivers/scsi/be2iscsi/be_mgmt.h +10 -0
+	unsigned int data_length;
+} __packed;
+
+struct be_mgmt_fw_cmd_info_resp {
+	struct be_cmd_resp_hdr hdr;
+	void   *pdata_buffer;
+	unsigned int data_length;
+} __packed;
+
+

Did you meant to send another patch with this one or did you not mean to include the mgmt_fw code in here? be_mgmt_fw_cmd_info_resp is not used and be_mgmt_fw_cmd_info is used in mgmt_fw_cmd, but that function is never called.

#2 lore raw

I have put in that code as infrastructure needed when we implement the blob that we had discussed. Yes, it needs the changes in scsi_transport_iscsi ,then, I will call the mgmt_fw_cmd

----- Original Message -----
From: Mike Christie
[mailto:[email protected]]
To: Jayamohan Kalickal
[mailto:[email protected]]
Cc: [email protected]
Sent:
Mon, 12 Oct 2009 20:12:31 -0700
Subject: Re: [PATCH 1/1] be2iscsi: Enabling
MSIX and mcc_rings

Quoted 24 lines
Quoted 12 lines · Jayamohan Kallickal

This patch adds

1) Turns on msix
2) mcc_ring support for sending FW commands
3) Support for Ring Mode of WRB Posting

drivers/scsi/be2iscsi/be_mgmt.h +3 -0
+struct be_mgmt_fw_cmd_info {
+	struct be_cmd_req_hdr hdr;
+	void   *pdata_buffer;

drivers/scsi/be2iscsi/be_mgmt.h struct be_mgmt_controller_attributes_resp { · line 221

Quoted 10 lines
drivers/scsi/be2iscsi/be_mgmt.h +10 -0
+	unsigned int data_length;
+} __packed;
+
+struct be_mgmt_fw_cmd_info_resp {
+	struct be_cmd_resp_hdr hdr;
+	void   *pdata_buffer;
+	unsigned int data_length;
+} __packed;
+
+
Quoted 9 lines

Did you meant to send another patch with this one or did you not mean to include the mgmt_fw code in here? be_mgmt_fw_cmd_info_resp is not used and be_mgmt_fw_cmd_info is used in mgmt_fw_cmd, but that function is never called.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

___________________________________________________________________________________
This message, together with any attachment(s), contains confidential and proprietary information of ServerEngines Corporation and is intended only for the designated recipient(s) named above. Any unauthorized review, printing, retention, copying, disclosure or distribution is strictly prohibited. If you are not the intended recipient of this message, please immediately advise the sender by reply email message and delete all copies of this message and any attachment(s). Thank you.

#3 lore raw
Quoted 4 lines · Jayamohan Kalickal

I have put in that code as infrastructure needed when we implement the blob that we had discussed. Yes, it needs the changes in scsi_transport_iscsi ,then, I will call the mgmt_fw_cmd

Ah ok. You will not want to include it with this patch then. Include the mgmt stuff when you are sending the other code.