All of lore.kernel.org
 help / color / mirror / Atom feed
From: jsmart2021@gmail.com (James Smart)
Subject: [PATCH v2 5/7] lpfc: add nvmet discovery_event op support
Date: Tue, 14 May 2019 14:58:06 -0700	[thread overview]
Message-ID: <20190514215808.10572-6-jsmart2021@gmail.com> (raw)
In-Reply-To: <20190514215808.10572-1-jsmart2021@gmail.com>

This patch adds support for the nvmet discovery op. When the callback
routine is called, the driver will call the routine to generate an RSCN
to the port on the other end of the link.

Signed-off-by: Dick Kennedy <dick.kennedy at broadcom.com>
Signed-off-by: James Smart <jsmart2021 at gmail.com>
Reviewed-by: Hannes Reinecke <hare at suse.com>
---
 drivers/scsi/lpfc/lpfc_nvmet.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c
index 361e2b103648..1eb02a0b8db6 100644
--- a/drivers/scsi/lpfc/lpfc_nvmet.c
+++ b/drivers/scsi/lpfc/lpfc_nvmet.c
@@ -1141,6 +1141,22 @@ lpfc_nvmet_defer_rcv(struct nvmet_fc_target_port *tgtport,
 	spin_unlock_irqrestore(&ctxp->ctxlock, iflag);
 }
 
+static void
+lpfc_nvmet_discovery_event(struct nvmet_fc_target_port *tgtport)
+{
+	struct lpfc_nvmet_tgtport *tgtp;
+	struct lpfc_hba *phba;
+	uint32_t rc;
+
+	tgtp = tgtport->private;
+	phba = tgtp->phba;
+
+	rc = lpfc_issue_els_rscn(phba->pport, 0);
+	lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
+			"6420 NVMET subsystem change: Notification %s\n",
+			(rc) ? "Failed" : "Sent");
+}
+
 static struct nvmet_fc_target_template lpfc_tgttemplate = {
 	.targetport_delete = lpfc_nvmet_targetport_delete,
 	.xmt_ls_rsp     = lpfc_nvmet_xmt_ls_rsp,
@@ -1148,6 +1164,7 @@ static struct nvmet_fc_target_template lpfc_tgttemplate = {
 	.fcp_abort      = lpfc_nvmet_xmt_fcp_abort,
 	.fcp_req_release = lpfc_nvmet_xmt_fcp_release,
 	.defer_rcv	= lpfc_nvmet_defer_rcv,
+	.discovery_event = lpfc_nvmet_discovery_event,
 
 	.max_hw_queues  = 1,
 	.max_sgl_segments = LPFC_NVMET_DEFAULT_SEGS,
-- 
2.13.7

  parent reply	other threads:[~2019-05-14 21:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14 21:58 [PATCH v2 0/7] nvmet/nvmet_fc: add events for discovery controller rescan James Smart
2019-05-14 21:58 ` [PATCH v2 1/7] nvmet: add transport discovery change op James Smart
2019-05-29 22:21   ` Sagi Grimberg
2019-05-29 22:27     ` James Smart
2019-05-29 22:42       ` Sagi Grimberg
2019-05-29 22:58         ` James Smart
2019-05-30  1:04           ` Sagi Grimberg
2019-05-14 21:58 ` [PATCH v2 2/7] nvmet_fc: add transport discovery change event callback support James Smart
2019-05-14 21:58 ` [PATCH v2 3/7] nvme-fcloop: Add support for nvmet discovery_event op James Smart
2019-05-14 21:58 ` [PATCH v2 4/7] lpfc: Add support to generate RSCN events for nport James Smart
2019-05-14 21:58 ` James Smart [this message]
2019-05-14 21:58 ` [PATCH v2 6/7] lpfc: Add support for translating an RSCN rcv into a discovery rescan James Smart
2019-05-14 21:58 ` [PATCH v2 7/7] lpfc: Add sysfs interface to post NVME RSCN James Smart
2019-05-29 23:12 ` [PATCH v2 0/7] nvmet/nvmet_fc: add events for discovery controller rescan Arun Easi
2019-05-30 18:04   ` Sagi Grimberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190514215808.10572-6-jsmart2021@gmail.com \
    --to=jsmart2021@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.