Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7401055 authored by Jitendra Bhivare's avatar Jitendra Bhivare Committed by Martin K. Petersen
Browse files

scsi: be2iscsi: Fix iSCSI cmd cleanup IOCTL



Prepare the IOCTL with appropriate sizes of buffers of V0 and V1.
Set missing chute number in V1 IOCTL.

Signed-off-by: default avatarJitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 3f7f62ee
Loading
Loading
Loading
Loading
+18 −15
Original line number Original line Diff line number Diff line
@@ -1700,31 +1700,34 @@ int beiscsi_cmd_iscsi_cleanup(struct beiscsi_hba *phba, unsigned short ulp)
	struct be_ctrl_info *ctrl = &phba->ctrl;
	struct be_ctrl_info *ctrl = &phba->ctrl;
	struct iscsi_cleanup_req_v1 *req_v1;
	struct iscsi_cleanup_req_v1 *req_v1;
	struct iscsi_cleanup_req *req;
	struct iscsi_cleanup_req *req;
	u16 hdr_ring_id, data_ring_id;
	struct be_mcc_wrb *wrb;
	struct be_mcc_wrb *wrb;
	int status;
	int status;


	mutex_lock(&ctrl->mbox_lock);
	mutex_lock(&ctrl->mbox_lock);
	wrb = wrb_from_mbox(&ctrl->mbox_mem);
	wrb = wrb_from_mbox(&ctrl->mbox_mem);

	hdr_ring_id = HWI_GET_DEF_HDRQ_ID(phba, ulp);
	data_ring_id = HWI_GET_DEF_BUFQ_ID(phba, ulp);
	if (is_chip_be2_be3r(phba)) {
		req = embedded_payload(wrb);
		req = embedded_payload(wrb);
		be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
		be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
		be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI,
		be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI,
				   OPCODE_COMMON_ISCSI_CLEANUP, sizeof(*req));
				   OPCODE_COMMON_ISCSI_CLEANUP, sizeof(*req));

       /**
	* TODO: Check with FW folks the chute value to be set.
	* For now, use the ULP_MASK as the chute value.
	*/
	if (is_chip_be2_be3r(phba)) {
		req->chute = (1 << ulp);
		req->chute = (1 << ulp);
		req->hdr_ring_id = HWI_GET_DEF_HDRQ_ID(phba, ulp);
		/* BE2/BE3 FW creates 8-bit ring id */
		req->data_ring_id = HWI_GET_DEF_BUFQ_ID(phba, ulp);
		req->hdr_ring_id = hdr_ring_id;
		req->data_ring_id = data_ring_id;
	} else {
	} else {
		req_v1 = (struct iscsi_cleanup_req_v1 *)req;
		req_v1 = embedded_payload(wrb);
		be_wrb_hdr_prepare(wrb, sizeof(*req_v1), true, 0);
		be_cmd_hdr_prepare(&req_v1->hdr, CMD_SUBSYSTEM_ISCSI,
				   OPCODE_COMMON_ISCSI_CLEANUP,
				   sizeof(*req_v1));
		req_v1->hdr.version = 1;
		req_v1->hdr.version = 1;
		req_v1->hdr_ring_id = cpu_to_le16(HWI_GET_DEF_HDRQ_ID(phba,
		req_v1->chute = (1 << ulp);
								      ulp));
		req_v1->hdr_ring_id = cpu_to_le16(hdr_ring_id);
		req_v1->data_ring_id = cpu_to_le16(HWI_GET_DEF_BUFQ_ID(phba,
		req_v1->data_ring_id = cpu_to_le16(data_ring_id);
								       ulp));
	}
	}


	status = be_mbox_notify(ctrl);
	status = be_mbox_notify(ctrl);
+1 −2
Original line number Original line Diff line number Diff line
@@ -3814,7 +3814,6 @@ static int hwi_init_port(struct beiscsi_hba *phba)
			/**
			/**
			 * Now that the default PDU rings have been created,
			 * Now that the default PDU rings have been created,
			 * let EP know about it.
			 * let EP know about it.
			 * Call beiscsi_cmd_iscsi_cleanup before posting?
			 */
			 */
			beiscsi_hdq_post_handles(phba, BEISCSI_DEFQ_HDR,
			beiscsi_hdq_post_handles(phba, BEISCSI_DEFQ_HDR,
						 ulp_num);
						 ulp_num);