* [PATCH 01/20] libfc: Replace ->seq_els_rsp_send callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 8:27 ` Johannes Thumshirn
2016-10-18 8:37 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 02/20] libfc: Replace ->lport_reset " Hannes Reinecke
` (20 subsequent siblings)
21 siblings, 2 replies; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The 'seq_els_rsp_send' callback only ever had one implementation,
so we might as well drop it and use the function directly.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/fcoe/fcoe_ctlr.c | 2 +-
drivers/scsi/libfc/fc_disc.c | 4 ++--
drivers/scsi/libfc/fc_exch.c | 8 +++-----
drivers/scsi/libfc/fc_lport.c | 6 +++---
drivers/scsi/libfc/fc_rport.c | 26 +++++++++++++-------------
include/scsi/libfc.h | 10 ++--------
6 files changed, 24 insertions(+), 32 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index 4aacd60..6cedc51 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -3031,7 +3031,7 @@ static void fcoe_ctlr_disc_recv(struct fc_lport *lport, struct fc_frame *fp)
rjt_data.reason = ELS_RJT_UNSUP;
rjt_data.explan = ELS_EXPL_NONE;
- lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data);
+ fc_seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data);
fc_frame_free(fp);
}
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index ad3965f..4e31152 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -154,7 +154,7 @@ static void fc_disc_recv_rscn_req(struct fc_disc *disc, struct fc_frame *fp)
break;
}
}
- lport->tt.seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
+ fc_seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
/*
* If not doing a complete rediscovery, do GPN_ID on
@@ -182,7 +182,7 @@ static void fc_disc_recv_rscn_req(struct fc_disc *disc, struct fc_frame *fp)
FC_DISC_DBG(disc, "Received a bad RSCN frame\n");
rjt_data.reason = ELS_RJT_LOGIC;
rjt_data.explan = ELS_EXPL_NONE;
- lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data);
+ fc_seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data);
fc_frame_free(fp);
}
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 9921dbb..3f58aeb 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -1222,8 +1222,8 @@ static void fc_exch_set_addr(struct fc_exch *ep,
*
* The received frame is not freed.
*/
-static void fc_seq_els_rsp_send(struct fc_frame *fp, enum fc_els_cmd els_cmd,
- struct fc_seq_els_data *els_data)
+void fc_seq_els_rsp_send(struct fc_frame *fp, enum fc_els_cmd els_cmd,
+ struct fc_seq_els_data *els_data)
{
switch (els_cmd) {
case ELS_LS_RJT:
@@ -1242,6 +1242,7 @@ static void fc_seq_els_rsp_send(struct fc_frame *fp, enum fc_els_cmd els_cmd,
FC_LPORT_DBG(fr_dev(fp), "Invalid ELS CMD:%x\n", els_cmd);
}
}
+EXPORT_SYMBOL_GPL(fc_seq_els_rsp_send);
/**
* fc_seq_send_last() - Send a sequence that is the last in the exchange
@@ -2635,9 +2636,6 @@ int fc_exch_init(struct fc_lport *lport)
if (!lport->tt.seq_send)
lport->tt.seq_send = fc_seq_send;
- if (!lport->tt.seq_els_rsp_send)
- lport->tt.seq_els_rsp_send = fc_seq_els_rsp_send;
-
if (!lport->tt.exch_done)
lport->tt.exch_done = fc_exch_done;
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 81ad8ac..bf79c9b 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -412,7 +412,7 @@ static void fc_lport_recv_rlir_req(struct fc_lport *lport, struct fc_frame *fp)
FC_LPORT_DBG(lport, "Received RLIR request while in state %s\n",
fc_lport_state(lport));
- lport->tt.seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
+ fc_seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
fc_frame_free(fp);
}
@@ -481,7 +481,7 @@ static void fc_lport_recv_rnid_req(struct fc_lport *lport,
if (!req) {
rjt_data.reason = ELS_RJT_LOGIC;
rjt_data.explan = ELS_EXPL_NONE;
- lport->tt.seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data);
+ fc_seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data);
} else {
fmt = req->rnid_fmt;
len = sizeof(*rp);
@@ -521,7 +521,7 @@ static void fc_lport_recv_rnid_req(struct fc_lport *lport,
*/
static void fc_lport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp)
{
- lport->tt.seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
+ fc_seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
fc_lport_enter_reset(lport);
fc_frame_free(fp);
}
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index a867874..4ca0f40 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -967,7 +967,7 @@ static void fc_rport_recv_flogi_req(struct fc_lport *lport,
reject_put:
kref_put(&rdata->kref, lport->tt.rport_destroy);
reject:
- lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
+ fc_seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
fc_frame_free(rx_fp);
}
@@ -1416,7 +1416,7 @@ static void fc_rport_recv_rtv_req(struct fc_rport_priv *rdata,
if (!fp) {
rjt_data.reason = ELS_RJT_UNAB;
rjt_data.reason = ELS_EXPL_INSUF_RES;
- lport->tt.seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data);
+ fc_seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data);
goto drop;
}
rtv = fc_frame_payload_get(fp, sizeof(*rtv));
@@ -1591,7 +1591,7 @@ static void fc_rport_recv_adisc_req(struct fc_rport_priv *rdata,
if (!adisc) {
rjt_data.reason = ELS_RJT_PROT;
rjt_data.explan = ELS_EXPL_INV_LEN;
- lport->tt.seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data);
+ fc_seq_els_rsp_send(in_fp, ELS_LS_RJT, &rjt_data);
goto drop;
}
@@ -1667,7 +1667,7 @@ static void fc_rport_recv_rls_req(struct fc_rport_priv *rdata,
goto out;
out_rjt:
- lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
+ fc_seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
out:
fc_frame_free(rx_fp);
}
@@ -1734,11 +1734,11 @@ static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp)
fc_rport_recv_adisc_req(rdata, fp);
break;
case ELS_RRQ:
- lport->tt.seq_els_rsp_send(fp, ELS_RRQ, NULL);
+ fc_seq_els_rsp_send(fp, ELS_RRQ, NULL);
fc_frame_free(fp);
break;
case ELS_REC:
- lport->tt.seq_els_rsp_send(fp, ELS_REC, NULL);
+ fc_seq_els_rsp_send(fp, ELS_REC, NULL);
fc_frame_free(fp);
break;
case ELS_RLS:
@@ -1759,14 +1759,14 @@ static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp)
reject:
els_data.reason = ELS_RJT_UNAB;
els_data.explan = ELS_EXPL_PLOGI_REQD;
- lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &els_data);
+ fc_seq_els_rsp_send(fp, ELS_LS_RJT, &els_data);
fc_frame_free(fp);
return;
busy:
els_data.reason = ELS_RJT_BUSY;
els_data.explan = ELS_EXPL_NONE;
- lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &els_data);
+ fc_seq_els_rsp_send(fp, ELS_LS_RJT, &els_data);
fc_frame_free(fp);
return;
}
@@ -1812,7 +1812,7 @@ static void fc_rport_recv_req(struct fc_lport *lport, struct fc_frame *fp)
default:
els_data.reason = ELS_RJT_UNSUP;
els_data.explan = ELS_EXPL_NONE;
- lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &els_data);
+ fc_seq_els_rsp_send(fp, ELS_LS_RJT, &els_data);
fc_frame_free(fp);
break;
}
@@ -1939,7 +1939,7 @@ static void fc_rport_recv_plogi_req(struct fc_lport *lport,
return;
reject:
- lport->tt.seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data);
+ fc_seq_els_rsp_send(fp, ELS_LS_RJT, &rjt_data);
fc_frame_free(fp);
}
@@ -2055,7 +2055,7 @@ static void fc_rport_recv_prli_req(struct fc_rport_priv *rdata,
rjt_data.reason = ELS_RJT_PROT;
rjt_data.explan = ELS_EXPL_INV_LEN;
reject:
- lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
+ fc_seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
drop:
fc_frame_free(rx_fp);
}
@@ -2126,7 +2126,7 @@ static void fc_rport_recv_prlo_req(struct fc_rport_priv *rdata,
rjt_data.reason = ELS_RJT_PROT;
rjt_data.explan = ELS_EXPL_INV_LEN;
reject:
- lport->tt.seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
+ fc_seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
drop:
fc_frame_free(rx_fp);
}
@@ -2146,7 +2146,7 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp)
struct fc_rport_priv *rdata;
u32 sid;
- lport->tt.seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
+ fc_seq_els_rsp_send(fp, ELS_LS_ACC, NULL);
sid = fc_frame_sid(fp);
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index f5aa54b..0e95803 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -553,14 +553,6 @@ struct libfc_function_template {
struct fc_frame *);
/*
- * Send an ELS response using information from the received frame.
- *
- * STATUS: OPTIONAL
- */
- void (*seq_els_rsp_send)(struct fc_frame *, enum fc_els_cmd,
- struct fc_seq_els_data *);
-
- /*
* Abort an exchange and sequence. Generally called because of a
* exchange timeout or an abort from the upper layer.
*
@@ -1138,6 +1130,8 @@ void fc_fill_hdr(struct fc_frame *, const struct fc_frame *,
*****************************/
int fc_exch_init(struct fc_lport *);
void fc_exch_update_stats(struct fc_lport *lport);
+void fc_seq_els_rsp_send(struct fc_frame *, enum fc_els_cmd,
+ struct fc_seq_els_data *);
struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *,
struct fc_exch_mgr *,
bool (*match)(struct fc_frame *));
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 01/20] libfc: Replace ->seq_els_rsp_send callback with function call
2016-10-18 8:01 ` [PATCH 01/20] libfc: Replace ->seq_els_rsp_send callback with function call Hannes Reinecke
@ 2016-10-18 8:27 ` Johannes Thumshirn
2016-10-18 8:37 ` Johannes Thumshirn
1 sibling, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:27 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:35AM +0200, Hannes Reinecke wrote:
> The 'seq_els_rsp_send' callback only ever had one implementation,
> so we might as well drop it and use the function directly.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH 01/20] libfc: Replace ->seq_els_rsp_send callback with function call
2016-10-18 8:01 ` [PATCH 01/20] libfc: Replace ->seq_els_rsp_send callback with function call Hannes Reinecke
2016-10-18 8:27 ` Johannes Thumshirn
@ 2016-10-18 8:37 ` Johannes Thumshirn
1 sibling, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:37 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:35AM +0200, Hannes Reinecke wrote:
> The 'seq_els_rsp_send' callback only ever had one implementation,
> so we might as well drop it and use the function directly.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 02/20] libfc: Replace ->lport_reset callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
2016-10-18 8:01 ` [PATCH 01/20] libfc: Replace ->seq_els_rsp_send callback with function call Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 8:41 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 03/20] libfc: Replace ->lport_recv " Hannes Reinecke
` (19 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->lport_reset callback only ever had one implementation,
which already is exported. So remove it and use the function
directly.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/fnic/fnic_scsi.c | 2 +-
drivers/scsi/libfc/fc_fcp.c | 2 +-
drivers/scsi/libfc/fc_lport.c | 3 ---
include/scsi/libfc.h | 7 -------
4 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index d9fd2f8..bfaba06 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -2543,7 +2543,7 @@ int fnic_reset(struct Scsi_Host *shost)
* Reset local port, this will clean up libFC exchanges,
* reset remote port sessions, and if link is up, begin flogi
*/
- ret = lp->tt.lport_reset(lp);
+ ret = fc_lport_reset(lp);
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
"Returning from fnic reset %s\n",
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index c033946..831de3e 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -2224,7 +2224,7 @@ int fc_eh_host_reset(struct scsi_cmnd *sc_cmd)
fc_block_scsi_eh(sc_cmd);
- lport->tt.lport_reset(lport);
+ fc_lport_reset(lport);
wait_tmo = jiffies + FC_HOST_RESET_TIMEOUT;
while (!fc_fcp_lport_queue_ready(lport) && time_before(jiffies,
wait_tmo))
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index bf79c9b..05f83a6 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -1868,9 +1868,6 @@ int fc_lport_init(struct fc_lport *lport)
if (!lport->tt.lport_recv)
lport->tt.lport_recv = fc_lport_recv_req;
- if (!lport->tt.lport_reset)
- lport->tt.lport_reset = fc_lport_reset;
-
fc_host_port_type(lport->host) = FC_PORTTYPE_NPORT;
fc_host_node_name(lport->host) = lport->wwnn;
fc_host_port_name(lport->host) = lport->wwpn;
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 0e95803..7ee0d27 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -628,13 +628,6 @@ struct libfc_function_template {
void (*lport_recv)(struct fc_lport *, struct fc_frame *);
/*
- * Reset the local port.
- *
- * STATUS: OPTIONAL
- */
- int (*lport_reset)(struct fc_lport *);
-
- /*
* Set the local port FC_ID.
*
* This may be provided by the LLD to allow it to be
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 02/20] libfc: Replace ->lport_reset callback with function call
2016-10-18 8:01 ` [PATCH 02/20] libfc: Replace ->lport_reset " Hannes Reinecke
@ 2016-10-18 8:41 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:41 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:36AM +0200, Hannes Reinecke wrote:
> The ->lport_reset callback only ever had one implementation,
> which already is exported. So remove it and use the function
> directly.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 03/20] libfc: Replace ->lport_recv with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
2016-10-18 8:01 ` [PATCH 01/20] libfc: Replace ->seq_els_rsp_send callback with function call Hannes Reinecke
2016-10-18 8:01 ` [PATCH 02/20] libfc: Replace ->lport_reset " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 8:42 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 04/20] libfc: Replace ->exch_seq_send callback " Hannes Reinecke
` (18 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->lport_recv callback only ever had one implementation,
so call the function directly and remove the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/libfc/fc_exch.c | 4 ++--
drivers/scsi/libfc/fc_lport.c | 9 +++------
include/scsi/libfc.h | 8 +-------
3 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 3f58aeb..cc320a9 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -1527,7 +1527,7 @@ static void fc_exch_recv_req(struct fc_lport *lport, struct fc_exch_mgr *mp,
* The upper-level protocol may request one later, if needed.
*/
if (fh->fh_rx_id == htons(FC_XID_UNKNOWN))
- return lport->tt.lport_recv(lport, fp);
+ return fc_lport_recv(lport, fp);
reject = fc_seq_lookup_recip(lport, mp, fp);
if (reject == FC_RJT_NONE) {
@@ -1548,7 +1548,7 @@ static void fc_exch_recv_req(struct fc_lport *lport, struct fc_exch_mgr *mp,
* first.
*/
if (!fc_invoke_resp(ep, sp, fp))
- lport->tt.lport_recv(lport, fp);
+ fc_lport_recv(lport, fp);
fc_exch_release(ep); /* release from lookup */
} else {
FC_LPORT_DBG(lport, "exch/seq lookup failed: reject %x\n",
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 05f83a6..42dcb72 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -944,15 +944,14 @@ struct fc4_prov fc_lport_els_prov = {
};
/**
- * fc_lport_recv_req() - The generic lport request handler
+ * fc_lport_recv() - The generic lport request handler
* @lport: The lport that received the request
* @fp: The frame the request is in
*
* Locking Note: This function should not be called with the lport
* lock held because it may grab the lock.
*/
-static void fc_lport_recv_req(struct fc_lport *lport,
- struct fc_frame *fp)
+void fc_lport_recv(struct fc_lport *lport, struct fc_frame *fp)
{
struct fc_frame_header *fh = fc_frame_header_get(fp);
struct fc_seq *sp = fr_seq(fp);
@@ -983,6 +982,7 @@ static void fc_lport_recv_req(struct fc_lport *lport,
if (sp)
lport->tt.exch_done(sp);
}
+EXPORT_SYMBOL(fc_lport_recv);
/**
* fc_lport_reset() - Reset a local port
@@ -1865,9 +1865,6 @@ int fc_lport_config(struct fc_lport *lport)
*/
int fc_lport_init(struct fc_lport *lport)
{
- if (!lport->tt.lport_recv)
- lport->tt.lport_recv = fc_lport_recv_req;
-
fc_host_port_type(lport->host) = FC_PORTTYPE_NPORT;
fc_host_node_name(lport->host) = lport->wwnn;
fc_host_port_name(lport->host) = lport->wwpn;
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 7ee0d27..7bba81e 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -621,13 +621,6 @@ struct libfc_function_template {
void (*rport_flush_queue)(void);
/*
- * Receive a frame for a local port.
- *
- * STATUS: OPTIONAL
- */
- void (*lport_recv)(struct fc_lport *, struct fc_frame *);
-
- /*
* Set the local port FC_ID.
*
* This may be provided by the LLD to allow it to be
@@ -1060,6 +1053,7 @@ static inline bool fc_fcp_is_read(const struct fc_fcp_pkt *fsp)
void fc_vports_linkchange(struct fc_lport *);
int fc_lport_config(struct fc_lport *);
int fc_lport_reset(struct fc_lport *);
+void fc_lport_recv(struct fc_lport *lport, struct fc_frame *fp);
int fc_set_mfs(struct fc_lport *, u32 mfs);
struct fc_lport *libfc_vport_create(struct fc_vport *, int privsize);
struct fc_lport *fc_vport_id_lookup(struct fc_lport *, u32 port_id);
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 03/20] libfc: Replace ->lport_recv with function call
2016-10-18 8:01 ` [PATCH 03/20] libfc: Replace ->lport_recv " Hannes Reinecke
@ 2016-10-18 8:42 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:42 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:37AM +0200, Hannes Reinecke wrote:
> The ->lport_recv callback only ever had one implementation,
> so call the function directly and remove the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 04/20] libfc: Replace ->exch_seq_send callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (2 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 03/20] libfc: Replace ->lport_recv " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 8:45 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 05/20] libfc: Replace ->rport_destroy " Hannes Reinecke
` (17 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->exch_seq_send callback only ever had one implementation,
so we can call the function directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/libfc/fc_elsct.c | 2 +-
drivers/scsi/libfc/fc_exch.c | 37 ++++++++++++++++++++++++++-----------
drivers/scsi/libfc/fc_fcp.c | 11 +++++------
drivers/scsi/libfc/fc_lport.c | 8 ++++----
drivers/scsi/libfc/fc_rport.c | 4 ++--
include/scsi/libfc.h | 38 +++++++-------------------------------
6 files changed, 45 insertions(+), 55 deletions(-)
diff --git a/drivers/scsi/libfc/fc_elsct.c b/drivers/scsi/libfc/fc_elsct.c
index c2384d5..6384a98 100644
--- a/drivers/scsi/libfc/fc_elsct.c
+++ b/drivers/scsi/libfc/fc_elsct.c
@@ -67,7 +67,7 @@ struct fc_seq *fc_elsct_send(struct fc_lport *lport, u32 did,
fc_fill_fc_hdr(fp, r_ctl, did, lport->port_id, fh_type,
FC_FCTL_REQ, 0);
- return lport->tt.exch_seq_send(lport, fp, resp, NULL, arg, timer_msec);
+ return fc_exch_seq_send(lport, fp, resp, NULL, arg, timer_msec);
}
EXPORT_SYMBOL(fc_elsct_send);
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index cc320a9..f5c3c1d 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -2127,6 +2127,24 @@ static void fc_exch_rrq_resp(struct fc_seq *sp, struct fc_frame *fp, void *arg)
* @arg: The argument to be passed to the response handler
* @timer_msec: The timeout period for the exchange
*
+ * The exchange response handler is set in this routine to resp()
+ * function pointer. It can be called in two scenarios: if a timeout
+ * occurs or if a response frame is received for the exchange. The
+ * fc_frame pointer in response handler will also indicate timeout
+ * as error using IS_ERR related macros.
+ *
+ * The exchange destructor handler is also set in this routine.
+ * The destructor handler is invoked by EM layer when exchange
+ * is about to free, this can be used by caller to free its
+ * resources along with exchange free.
+ *
+ * The arg is passed back to resp and destructor handler.
+ *
+ * The timeout value (in msec) for an exchange is set if non zero
+ * timer_msec argument is specified. The timer is canceled when
+ * it fires or when the exchange is done. The exchange timeout handler
+ * is registered by EM layer.
+ *
* The frame pointer with some of the header's fields must be
* filled before calling this routine, those fields are:
*
@@ -2137,14 +2155,13 @@ static void fc_exch_rrq_resp(struct fc_seq *sp, struct fc_frame *fp, void *arg)
* - frame control
* - parameter or relative offset
*/
-static struct fc_seq *fc_exch_seq_send(struct fc_lport *lport,
- struct fc_frame *fp,
- void (*resp)(struct fc_seq *,
- struct fc_frame *fp,
- void *arg),
- void (*destructor)(struct fc_seq *,
- void *),
- void *arg, u32 timer_msec)
+struct fc_seq *fc_exch_seq_send(struct fc_lport *lport,
+ struct fc_frame *fp,
+ void (*resp)(struct fc_seq *,
+ struct fc_frame *fp,
+ void *arg),
+ void (*destructor)(struct fc_seq *, void *),
+ void *arg, u32 timer_msec)
{
struct fc_exch *ep;
struct fc_seq *sp = NULL;
@@ -2197,6 +2214,7 @@ static struct fc_seq *fc_exch_seq_send(struct fc_lport *lport,
fc_exch_delete(ep);
return NULL;
}
+EXPORT_SYMBOL(fc_exch_seq_send);
/**
* fc_exch_rrq() - Send an ELS RRQ (Reinstate Recovery Qualifier) command
@@ -2630,9 +2648,6 @@ int fc_exch_init(struct fc_lport *lport)
if (!lport->tt.seq_set_resp)
lport->tt.seq_set_resp = fc_seq_set_resp;
- if (!lport->tt.exch_seq_send)
- lport->tt.exch_seq_send = fc_exch_seq_send;
-
if (!lport->tt.seq_send)
lport->tt.seq_send = fc_seq_send;
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 831de3e..5cf1d2e 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -196,7 +196,7 @@ static void fc_fcp_pkt_hold(struct fc_fcp_pkt *fsp)
* @seq: The sequence that the FCP packet is on (required by destructor API)
* @fsp: The FCP packet to be released
*
- * This routine is called by a destructor callback in the exch_seq_send()
+ * This routine is called by a destructor callback in the fc_exch_seq_send()
* routine of the libfc Transport Template. The 'struct fc_seq' is a required
* argument even though it is not used by this routine.
*
@@ -1206,8 +1206,7 @@ static int fc_fcp_cmd_send(struct fc_lport *lport, struct fc_fcp_pkt *fsp,
rpriv->local_port->port_id, FC_TYPE_FCP,
FC_FCTL_REQ, 0);
- seq = lport->tt.exch_seq_send(lport, fp, resp, fc_fcp_pkt_destroy,
- fsp, 0);
+ seq = fc_exch_seq_send(lport, fp, resp, fc_fcp_pkt_destroy, fsp, 0);
if (!seq) {
rc = -1;
goto unlock;
@@ -1757,9 +1756,9 @@ static void fc_fcp_srr(struct fc_fcp_pkt *fsp, enum fc_rctl r_ctl, u32 offset)
rpriv->local_port->port_id, FC_TYPE_FCP,
FC_FCTL_REQ, 0);
- seq = lport->tt.exch_seq_send(lport, fp, fc_fcp_srr_resp,
- fc_fcp_pkt_destroy,
- fsp, get_fsp_rec_tov(fsp));
+ seq = fc_exch_seq_send(lport, fp, fc_fcp_srr_resp,
+ fc_fcp_pkt_destroy,
+ fsp, get_fsp_rec_tov(fsp));
if (!seq)
goto retry;
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 42dcb72..1a4f176 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -2006,8 +2006,8 @@ static int fc_lport_els_request(struct fc_bsg_job *job,
info->nents = job->reply_payload.sg_cnt;
info->sg = job->reply_payload.sg_list;
- if (!lport->tt.exch_seq_send(lport, fp, fc_lport_bsg_resp,
- NULL, info, tov)) {
+ if (!fc_exch_seq_send(lport, fp, fc_lport_bsg_resp,
+ NULL, info, tov)) {
kfree(info);
return -ECOMM;
}
@@ -2067,8 +2067,8 @@ static int fc_lport_ct_request(struct fc_bsg_job *job,
info->nents = job->reply_payload.sg_cnt;
info->sg = job->reply_payload.sg_list;
- if (!lport->tt.exch_seq_send(lport, fp, fc_lport_bsg_resp,
- NULL, info, tov)) {
+ if (!fc_exch_seq_send(lport, fp, fc_lport_bsg_resp,
+ NULL, info, tov)) {
kfree(info);
return -ECOMM;
}
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 4ca0f40..d275df0 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -1282,8 +1282,8 @@ static void fc_rport_enter_prli(struct fc_rport_priv *rdata)
FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0);
kref_get(&rdata->kref);
- if (!lport->tt.exch_seq_send(lport, fp, fc_rport_prli_resp,
- NULL, rdata, 2 * lport->r_a_tov)) {
+ if (!fc_exch_seq_send(lport, fp, fc_rport_prli_resp,
+ NULL, rdata, 2 * lport->r_a_tov)) {
fc_rport_error_retry(rdata, -FC_EX_XMIT_ERR);
kref_put(&rdata->kref, lport->tt.rport_destroy);
}
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 7bba81e..5e8a208 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -485,37 +485,6 @@ struct libfc_function_template {
void *arg, u32 timer_msec);
/*
- * Send the FC frame payload using a new exchange and sequence.
- *
- * The exchange response handler is set in this routine to resp()
- * function pointer. It can be called in two scenarios: if a timeout
- * occurs or if a response frame is received for the exchange. The
- * fc_frame pointer in response handler will also indicate timeout
- * as error using IS_ERR related macros.
- *
- * The exchange destructor handler is also set in this routine.
- * The destructor handler is invoked by EM layer when exchange
- * is about to free, this can be used by caller to free its
- * resources along with exchange free.
- *
- * The arg is passed back to resp and destructor handler.
- *
- * The timeout value (in msec) for an exchange is set if non zero
- * timer_msec argument is specified. The timer is canceled when
- * it fires or when the exchange is done. The exchange timeout handler
- * is registered by EM layer.
- *
- * STATUS: OPTIONAL
- */
- struct fc_seq *(*exch_seq_send)(struct fc_lport *, struct fc_frame *,
- void (*resp)(struct fc_seq *,
- struct fc_frame *,
- void *),
- void (*destructor)(struct fc_seq *,
- void *),
- void *, unsigned int timer_msec);
-
- /*
* Sets up the DDP context for a given exchange id on the given
* scatterlist if LLD supports DDP for large receive.
*
@@ -1117,6 +1086,13 @@ void fc_fill_hdr(struct fc_frame *, const struct fc_frame *,
*****************************/
int fc_exch_init(struct fc_lport *);
void fc_exch_update_stats(struct fc_lport *lport);
+struct fc_seq *fc_exch_seq_send(struct fc_lport *lport,
+ struct fc_frame *fp,
+ void (*resp)(struct fc_seq *,
+ struct fc_frame *fp,
+ void *arg),
+ void (*destructor)(struct fc_seq *, void *),
+ void *arg, u32 timer_msec);
void fc_seq_els_rsp_send(struct fc_frame *, enum fc_els_cmd,
struct fc_seq_els_data *);
struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *,
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 04/20] libfc: Replace ->exch_seq_send callback with function call
2016-10-18 8:01 ` [PATCH 04/20] libfc: Replace ->exch_seq_send callback " Hannes Reinecke
@ 2016-10-18 8:45 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:45 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:38AM +0200, Hannes Reinecke wrote:
> The ->exch_seq_send callback only ever had one implementation,
> so we can call the function directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 05/20] libfc: Replace ->rport_destroy callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (3 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 04/20] libfc: Replace ->exch_seq_send callback " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 8:47 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 06/20] libfc: Replace ->rport_lookup " Hannes Reinecke
` (16 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->rport_destroy callback only ever had one implementation,
so we can as well call it directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/fcoe/fcoe_ctlr.c | 12 ++++----
drivers/scsi/libfc/fc_disc.c | 6 ++--
drivers/scsi/libfc/fc_lport.c | 6 ++--
drivers/scsi/libfc/fc_rport.c | 68 +++++++++++++++++++------------------------
include/scsi/libfc.h | 7 +----
5 files changed, 43 insertions(+), 56 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index 6cedc51..4fc7677 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -2180,7 +2180,7 @@ static void fcoe_ctlr_disc_stop_locked(struct fc_lport *lport)
list_for_each_entry_rcu(rdata, &lport->disc.rports, peers) {
if (kref_get_unless_zero(&rdata->kref)) {
lport->tt.rport_logoff(rdata);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
}
rcu_read_unlock();
@@ -2566,7 +2566,7 @@ static int fcoe_ctlr_vn_lookup(struct fcoe_ctlr *fip, u32 port_id, u8 *mac)
frport = fcoe_ctlr_rport(rdata);
memcpy(mac, frport->enode_mac, ETH_ALEN);
ret = 0;
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
return ret;
}
@@ -2678,7 +2678,7 @@ static void fcoe_ctlr_vn_beacon(struct fcoe_ctlr *fip,
}
frport->time = jiffies;
}
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
return;
}
if (fip->state != FIP_ST_VNMP_UP)
@@ -2719,7 +2719,7 @@ static unsigned long fcoe_ctlr_vn_age(struct fcoe_ctlr *fip)
continue;
frport = fcoe_ctlr_rport(rdata);
if (!frport->time) {
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
continue;
}
deadline = frport->time +
@@ -2732,7 +2732,7 @@ static unsigned long fcoe_ctlr_vn_age(struct fcoe_ctlr *fip)
lport->tt.rport_logoff(rdata);
} else if (time_before(deadline, next_time))
next_time = deadline;
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
rcu_read_unlock();
return next_time;
@@ -3089,7 +3089,7 @@ static void fcoe_ctlr_vn_disc(struct fcoe_ctlr *fip)
frport = fcoe_ctlr_rport(rdata);
if (frport->time)
lport->tt.rport_login(rdata);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
rcu_read_unlock();
if (callback)
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 4e31152..e5ffeab 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -72,7 +72,7 @@ static void fc_disc_stop_rports(struct fc_disc *disc)
list_for_each_entry_rcu(rdata, &disc->rports, peers) {
if (kref_get_unless_zero(&rdata->kref)) {
lport->tt.rport_logoff(rdata);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
}
rcu_read_unlock();
@@ -303,7 +303,7 @@ static void fc_disc_done(struct fc_disc *disc, enum fc_disc_event event)
else
lport->tt.rport_logoff(rdata);
}
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
rcu_read_unlock();
mutex_unlock(&disc->disc_mutex);
@@ -649,7 +649,7 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
mutex_unlock(&disc->disc_mutex);
}
out:
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
/**
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 1a4f176..ad45808 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -247,7 +247,7 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
{
if (lport->ptp_rdata) {
lport->tt.rport_logoff(lport->ptp_rdata);
- kref_put(&lport->ptp_rdata->kref, lport->tt.rport_destroy);
+ kref_put(&lport->ptp_rdata->kref, fc_rport_destroy);
}
mutex_lock(&lport->disc.disc_mutex);
lport->ptp_rdata = lport->tt.rport_create(lport, remote_fid);
@@ -1017,7 +1017,7 @@ static void fc_lport_reset_locked(struct fc_lport *lport)
if (lport->ptp_rdata) {
lport->tt.rport_logoff(lport->ptp_rdata);
- kref_put(&lport->ptp_rdata->kref, lport->tt.rport_destroy);
+ kref_put(&lport->ptp_rdata->kref, fc_rport_destroy);
lport->ptp_rdata = NULL;
}
@@ -2129,7 +2129,7 @@ int fc_lport_bsg_request(struct fc_bsg_job *job)
if (!rdata)
break;
tov = rdata->e_d_tov;
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
rc = fc_lport_ct_request(job, lport, did, tov);
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index d275df0..47ab962 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -176,13 +176,14 @@ static struct fc_rport_priv *fc_rport_create(struct fc_lport *lport,
* fc_rport_destroy() - Free a remote port after last reference is released
* @kref: The remote port's kref
*/
-static void fc_rport_destroy(struct kref *kref)
+void fc_rport_destroy(struct kref *kref)
{
struct fc_rport_priv *rdata;
rdata = container_of(kref, struct fc_rport_priv, kref);
kfree_rcu(rdata, rcu);
}
+EXPORT_SYMBOL(fc_rport_destroy);
/**
* fc_rport_state() - Return a string identifying the remote port's state
@@ -294,7 +295,7 @@ static void fc_rport_work(struct work_struct *work)
if (!rport) {
FC_RPORT_DBG(rdata, "Failed to add the rport\n");
lport->tt.rport_logoff(rdata);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
return;
}
mutex_lock(&rdata->rp_mutex);
@@ -320,7 +321,7 @@ static void fc_rport_work(struct work_struct *work)
FC_RPORT_DBG(rdata, "lld callback ev %d\n", event);
rdata->lld_event_callback(lport, rdata, event);
}
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
break;
case RPORT_EV_FAILED:
@@ -347,7 +348,7 @@ static void fc_rport_work(struct work_struct *work)
rdata->lld_event_callback(lport, rdata, event);
}
if (cancel_delayed_work_sync(&rdata->retry_work))
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
/*
* Reset any outstanding exchanges before freeing rport.
@@ -369,7 +370,7 @@ static void fc_rport_work(struct work_struct *work)
if (port_id == FC_FID_DIR_SERV) {
rdata->event = RPORT_EV_NONE;
mutex_unlock(&rdata->rp_mutex);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
} else if ((rdata->flags & FC_RP_STARTED) &&
rdata->major_retries <
lport->max_rport_retry_count) {
@@ -384,7 +385,7 @@ static void fc_rport_work(struct work_struct *work)
list_del_rcu(&rdata->peers);
mutex_unlock(&lport->disc.disc_mutex);
mutex_unlock(&rdata->rp_mutex);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
} else {
/*
@@ -403,7 +404,7 @@ static void fc_rport_work(struct work_struct *work)
mutex_unlock(&rdata->rp_mutex);
break;
}
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
/**
@@ -470,8 +471,6 @@ static int fc_rport_login(struct fc_rport_priv *rdata)
static void fc_rport_enter_delete(struct fc_rport_priv *rdata,
enum fc_rport_event event)
{
- struct fc_lport *lport = rdata->local_port;
-
if (rdata->rp_state == RPORT_ST_DELETE)
return;
@@ -482,7 +481,7 @@ static void fc_rport_enter_delete(struct fc_rport_priv *rdata,
kref_get(&rdata->kref);
if (rdata->event == RPORT_EV_NONE &&
!queue_work(rport_event_queue, &rdata->event_work))
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
rdata->event = event;
}
@@ -541,8 +540,6 @@ static int fc_rport_logoff(struct fc_rport_priv *rdata)
*/
static void fc_rport_enter_ready(struct fc_rport_priv *rdata)
{
- struct fc_lport *lport = rdata->local_port;
-
fc_rport_state_enter(rdata, RPORT_ST_READY);
FC_RPORT_DBG(rdata, "Port is Ready\n");
@@ -550,7 +547,7 @@ static void fc_rport_enter_ready(struct fc_rport_priv *rdata)
kref_get(&rdata->kref);
if (rdata->event == RPORT_EV_NONE &&
!queue_work(rport_event_queue, &rdata->event_work))
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
rdata->event = RPORT_EV_READY;
}
@@ -569,7 +566,6 @@ static void fc_rport_timeout(struct work_struct *work)
{
struct fc_rport_priv *rdata =
container_of(work, struct fc_rport_priv, retry_work.work);
- struct fc_lport *lport = rdata->local_port;
mutex_lock(&rdata->rp_mutex);
FC_RPORT_DBG(rdata, "Port timeout, state %s\n", fc_rport_state(rdata));
@@ -598,7 +594,7 @@ static void fc_rport_timeout(struct work_struct *work)
}
mutex_unlock(&rdata->rp_mutex);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
/**
@@ -661,7 +657,6 @@ static void fc_rport_error(struct fc_rport_priv *rdata, int err)
static void fc_rport_error_retry(struct fc_rport_priv *rdata, int err)
{
unsigned long delay = msecs_to_jiffies(rdata->e_d_tov);
- struct fc_lport *lport = rdata->local_port;
/* make sure this isn't an FC_EX_CLOSED error, never retry those */
if (err == -FC_EX_CLOSED)
@@ -676,7 +671,7 @@ static void fc_rport_error_retry(struct fc_rport_priv *rdata, int err)
delay = 0;
kref_get(&rdata->kref);
if (!schedule_delayed_work(&rdata->retry_work, delay))
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
return;
}
@@ -802,7 +797,7 @@ static void fc_rport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
err:
mutex_unlock(&rdata->rp_mutex);
put:
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
return;
bad:
FC_RPORT_DBG(rdata, "Bad FLOGI response\n");
@@ -841,7 +836,7 @@ static void fc_rport_enter_flogi(struct fc_rport_priv *rdata)
fc_rport_flogi_resp, rdata,
2 * lport->r_a_tov)) {
fc_rport_error_retry(rdata, -FC_EX_XMIT_ERR);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
}
@@ -960,12 +955,12 @@ static void fc_rport_recv_flogi_req(struct fc_lport *lport,
}
out:
mutex_unlock(&rdata->rp_mutex);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
fc_frame_free(rx_fp);
return;
reject_put:
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
reject:
fc_seq_els_rsp_send(rx_fp, ELS_LS_RJT, &rjt_data);
fc_frame_free(rx_fp);
@@ -1042,7 +1037,7 @@ static void fc_rport_plogi_resp(struct fc_seq *sp, struct fc_frame *fp,
err:
mutex_unlock(&rdata->rp_mutex);
put:
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
static bool
@@ -1098,7 +1093,7 @@ static void fc_rport_enter_plogi(struct fc_rport_priv *rdata)
fc_rport_plogi_resp, rdata,
2 * lport->r_a_tov)) {
fc_rport_error_retry(rdata, -FC_EX_XMIT_ERR);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
}
@@ -1218,7 +1213,7 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
err:
mutex_unlock(&rdata->rp_mutex);
put:
- kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
/**
@@ -1285,7 +1280,7 @@ static void fc_rport_enter_prli(struct fc_rport_priv *rdata)
if (!fc_exch_seq_send(lport, fp, fc_rport_prli_resp,
NULL, rdata, 2 * lport->r_a_tov)) {
fc_rport_error_retry(rdata, -FC_EX_XMIT_ERR);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
}
@@ -1358,7 +1353,7 @@ static void fc_rport_rtv_resp(struct fc_seq *sp, struct fc_frame *fp,
err:
mutex_unlock(&rdata->rp_mutex);
put:
- kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
/**
@@ -1391,7 +1386,7 @@ static void fc_rport_enter_rtv(struct fc_rport_priv *rdata)
fc_rport_rtv_resp, rdata,
2 * lport->r_a_tov)) {
fc_rport_error_retry(rdata, -FC_EX_XMIT_ERR);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
}
@@ -1446,7 +1441,7 @@ static void fc_rport_logo_resp(struct fc_seq *sp, struct fc_frame *fp,
"Received a LOGO %s\n", fc_els_resp_type(fp));
if (!IS_ERR(fp))
fc_frame_free(fp);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
/**
@@ -1472,7 +1467,7 @@ static void fc_rport_enter_logo(struct fc_rport_priv *rdata)
kref_get(&rdata->kref);
if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_LOGO,
fc_rport_logo_resp, rdata, 0))
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
/**
@@ -1534,7 +1529,7 @@ static void fc_rport_adisc_resp(struct fc_seq *sp, struct fc_frame *fp,
err:
mutex_unlock(&rdata->rp_mutex);
put:
- kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
/**
@@ -1566,7 +1561,7 @@ static void fc_rport_enter_adisc(struct fc_rport_priv *rdata)
fc_rport_adisc_resp, rdata,
2 * lport->r_a_tov)) {
fc_rport_error_retry(rdata, -FC_EX_XMIT_ERR);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
}
}
@@ -1711,7 +1706,7 @@ static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp)
"while in state %s\n",
fc_rport_state(rdata));
mutex_unlock(&rdata->rp_mutex);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
goto busy;
}
default:
@@ -1719,7 +1714,7 @@ static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp)
"Reject ELS 0x%02x while in state %s\n",
fc_frame_payload_op(fp), fc_rport_state(rdata));
mutex_unlock(&rdata->rp_mutex);
- kref_put(&rdata->kref, lport->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
goto reject;
}
@@ -1753,7 +1748,7 @@ static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp)
}
mutex_unlock(&rdata->rp_mutex);
- kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
return;
reject:
@@ -2158,7 +2153,7 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp)
fc_rport_enter_delete(rdata, RPORT_EV_STOP);
mutex_unlock(&rdata->rp_mutex);
- kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy);
+ kref_put(&rdata->kref, fc_rport_destroy);
} else
FC_RPORT_ID_DBG(lport, sid,
"Received LOGO from non-logged-in port\n");
@@ -2197,9 +2192,6 @@ int fc_rport_init(struct fc_lport *lport)
if (!lport->tt.rport_flush_queue)
lport->tt.rport_flush_queue = fc_rport_flush_queue;
- if (!lport->tt.rport_destroy)
- lport->tt.rport_destroy = fc_rport_destroy;
-
return 0;
}
EXPORT_SYMBOL(fc_rport_init);
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 5e8a208..cec450f 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -652,12 +652,6 @@ struct libfc_function_template {
struct fc_rport_priv *(*rport_lookup)(const struct fc_lport *, u32);
/*
- * Destroy an rport after final kref_put().
- * The argument is a pointer to the kref inside the fc_rport_priv.
- */
- void (*rport_destroy)(struct kref *);
-
- /*
* Callback routine after the remote port is logged in
*
* STATUS: OPTIONAL
@@ -1035,6 +1029,7 @@ static inline bool fc_fcp_is_read(const struct fc_fcp_pkt *fsp)
*****************************/
int fc_rport_init(struct fc_lport *);
void fc_rport_terminate_io(struct fc_rport *);
+void fc_rport_destroy(struct kref *kref);
/*
* DISCOVERY LAYER
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 05/20] libfc: Replace ->rport_destroy callback with function call
2016-10-18 8:01 ` [PATCH 05/20] libfc: Replace ->rport_destroy " Hannes Reinecke
@ 2016-10-18 8:47 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:47 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:39AM +0200, Hannes Reinecke wrote:
> The ->rport_destroy callback only ever had one implementation,
> so we can as well call it directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 06/20] libfc: Replace ->rport_lookup callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (4 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 05/20] libfc: Replace ->rport_destroy " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 8:48 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 07/20] scsi_transport_fc: rename 'fc_rport_create' to 'fc_remote_port_create' Hannes Reinecke
` (15 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->rport_lookup callback only ever had a single implementation,
so we can as well call it directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/fcoe/fcoe_ctlr.c | 4 ++--
drivers/scsi/libfc/fc_lport.c | 2 +-
drivers/scsi/libfc/fc_rport.c | 16 +++++++---------
include/scsi/libfc.h | 9 ++-------
4 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index 4fc7677..bae4e5a 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -2561,7 +2561,7 @@ static int fcoe_ctlr_vn_lookup(struct fcoe_ctlr *fip, u32 port_id, u8 *mac)
struct fcoe_rport *frport;
int ret = -1;
- rdata = lport->tt.rport_lookup(lport, port_id);
+ rdata = fc_rport_lookup(lport, port_id);
if (rdata) {
frport = fcoe_ctlr_rport(rdata);
memcpy(mac, frport->enode_mac, ETH_ALEN);
@@ -2663,7 +2663,7 @@ static void fcoe_ctlr_vn_beacon(struct fcoe_ctlr *fip,
fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REQ, fcoe_all_vn2vn, 0);
return;
}
- rdata = lport->tt.rport_lookup(lport, new->ids.port_id);
+ rdata = fc_rport_lookup(lport, new->ids.port_id);
if (rdata) {
if (rdata->ids.node_name == new->ids.node_name &&
rdata->ids.port_name == new->ids.port_name) {
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index ad45808..2da6c7c 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -2125,7 +2125,7 @@ int fc_lport_bsg_request(struct fc_bsg_job *job)
break;
tov = rdata->e_d_tov;
} else {
- rdata = lport->tt.rport_lookup(lport, did);
+ rdata = fc_rport_lookup(lport, did);
if (!rdata)
break;
tov = rdata->e_d_tov;
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 47ab962..5f674fc 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -111,8 +111,8 @@
* The reference count of the fc_rport_priv structure is
* increased by one.
*/
-static struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
- u32 port_id)
+struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
+ u32 port_id)
{
struct fc_rport_priv *rdata = NULL, *tmp_rdata;
@@ -126,6 +126,7 @@ static struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
rcu_read_unlock();
return rdata;
}
+EXPORT_SYMBOL(fc_rport_lookup);
/**
* fc_rport_create() - Create a new remote port
@@ -141,7 +142,7 @@ static struct fc_rport_priv *fc_rport_create(struct fc_lport *lport,
{
struct fc_rport_priv *rdata;
- rdata = lport->tt.rport_lookup(lport, port_id);
+ rdata = fc_rport_lookup(lport, port_id);
if (rdata)
return rdata;
@@ -875,7 +876,7 @@ static void fc_rport_recv_flogi_req(struct fc_lport *lport,
goto reject;
}
- rdata = lport->tt.rport_lookup(lport, sid);
+ rdata = fc_rport_lookup(lport, sid);
if (!rdata) {
rjt_data.reason = ELS_RJT_FIP;
rjt_data.explan = ELS_EXPL_NOT_NEIGHBOR;
@@ -1684,7 +1685,7 @@ static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp)
struct fc_rport_priv *rdata;
struct fc_seq_els_data els_data;
- rdata = lport->tt.rport_lookup(lport, fc_frame_sid(fp));
+ rdata = fc_rport_lookup(lport, fc_frame_sid(fp));
if (!rdata) {
FC_RPORT_ID_DBG(lport, fc_frame_sid(fp),
"Received ELS 0x%02x from non-logged-in port\n",
@@ -2145,7 +2146,7 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp)
sid = fc_frame_sid(fp);
- rdata = lport->tt.rport_lookup(lport, sid);
+ rdata = fc_rport_lookup(lport, sid);
if (rdata) {
mutex_lock(&rdata->rp_mutex);
FC_RPORT_DBG(rdata, "Received LOGO request while in state %s\n",
@@ -2174,9 +2175,6 @@ static void fc_rport_flush_queue(void)
*/
int fc_rport_init(struct fc_lport *lport)
{
- if (!lport->tt.rport_lookup)
- lport->tt.rport_lookup = fc_rport_lookup;
-
if (!lport->tt.rport_create)
lport->tt.rport_create = fc_rport_create;
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index cec450f..683201f 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -645,13 +645,6 @@ struct libfc_function_template {
void (*rport_recv_req)(struct fc_lport *, struct fc_frame *);
/*
- * lookup an rport by it's port ID.
- *
- * STATUS: OPTIONAL
- */
- struct fc_rport_priv *(*rport_lookup)(const struct fc_lport *, u32);
-
- /*
* Callback routine after the remote port is logged in
*
* STATUS: OPTIONAL
@@ -1029,6 +1022,8 @@ static inline bool fc_fcp_is_read(const struct fc_fcp_pkt *fsp)
*****************************/
int fc_rport_init(struct fc_lport *);
void fc_rport_terminate_io(struct fc_rport *);
+struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
+ u32 port_id);
void fc_rport_destroy(struct kref *kref);
/*
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 06/20] libfc: Replace ->rport_lookup callback with function call
2016-10-18 8:01 ` [PATCH 06/20] libfc: Replace ->rport_lookup " Hannes Reinecke
@ 2016-10-18 8:48 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:48 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:40AM +0200, Hannes Reinecke wrote:
> The ->rport_lookup callback only ever had a single implementation,
> so we can as well call it directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 07/20] scsi_transport_fc: rename 'fc_rport_create' to 'fc_remote_port_create'
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (5 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 06/20] libfc: Replace ->rport_lookup " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 11:17 ` Johannes Thumshirn
2016-10-18 16:00 ` James Smart
2016-10-18 8:01 ` [PATCH 08/20] libfc: Replace ->rport_create callback with function call Hannes Reinecke
` (14 subsequent siblings)
21 siblings, 2 replies; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
Required for the next patch.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/scsi_transport_fc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 0f3a386..4534085 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -2592,7 +2592,7 @@ static void fc_terminate_rport_io(struct fc_rport *rport)
/**
- * fc_rport_create - allocates and creates a remote FC port.
+ * fc_remote_port_create - allocates and creates a remote FC port.
* @shost: scsi host the remote port is connected to.
* @channel: Channel on shost port connected to.
* @ids: The world wide names, fc address, and FC4 port
@@ -2605,8 +2605,8 @@ static void fc_terminate_rport_io(struct fc_rport *rport)
* This routine assumes no locks are held on entry.
*/
static struct fc_rport *
-fc_rport_create(struct Scsi_Host *shost, int channel,
- struct fc_rport_identifiers *ids)
+fc_remote_port_create(struct Scsi_Host *shost, int channel,
+ struct fc_rport_identifiers *ids)
{
struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
struct fc_internal *fci = to_fc_internal(shost->transportt);
@@ -2914,7 +2914,7 @@ struct fc_rport *
spin_unlock_irqrestore(shost->host_lock, flags);
/* No consistent binding found - create new remote port entry */
- rport = fc_rport_create(shost, channel, ids);
+ rport = fc_remote_port_create(shost, channel, ids);
return rport;
}
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 07/20] scsi_transport_fc: rename 'fc_rport_create' to 'fc_remote_port_create'
2016-10-18 8:01 ` [PATCH 07/20] scsi_transport_fc: rename 'fc_rport_create' to 'fc_remote_port_create' Hannes Reinecke
@ 2016-10-18 11:17 ` Johannes Thumshirn
2016-10-18 16:00 ` James Smart
1 sibling, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 11:17 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:41AM +0200, Hannes Reinecke wrote:
> Required for the next patch.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Given the comment on the next patch,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH 07/20] scsi_transport_fc: rename 'fc_rport_create' to 'fc_remote_port_create'
2016-10-18 8:01 ` [PATCH 07/20] scsi_transport_fc: rename 'fc_rport_create' to 'fc_remote_port_create' Hannes Reinecke
2016-10-18 11:17 ` Johannes Thumshirn
@ 2016-10-18 16:00 ` James Smart
[not found] ` <CAGH8bx6+ZPAQRM1hWbEnzWj8qRJAcF7g3ne6oTbeWvbkXNtnvA@mail.gmail.com>
1 sibling, 1 reply; 50+ messages in thread
From: James Smart @ 2016-10-18 16:00 UTC (permalink / raw)
To: Hannes Reinecke, Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke
On 10/18/2016 1:01 AM, Hannes Reinecke wrote:
> Required for the next patch.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
> drivers/scsi/scsi_transport_fc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
> index 0f3a386..4534085 100644
> --- a/drivers/scsi/scsi_transport_fc.c
> +++ b/drivers/scsi/scsi_transport_fc.c
> @@ -2592,7 +2592,7 @@ static void fc_terminate_rport_io(struct fc_rport *rport)
>
>
> /**
> - * fc_rport_create - allocates and creates a remote FC port.
> + * fc_remote_port_create - allocates and creates a remote FC port.
> * @shost: scsi host the remote port is connected to.
> * @channel: Channel on shost port connected to.
> * @ids: The world wide names, fc address, and FC4 port
> @@ -2605,8 +2605,8 @@ static void fc_terminate_rport_io(struct fc_rport *rport)
> * This routine assumes no locks are held on entry.
> */
> static struct fc_rport *
> -fc_rport_create(struct Scsi_Host *shost, int channel,
> - struct fc_rport_identifiers *ids)
> +fc_remote_port_create(struct Scsi_Host *shost, int channel,
> + struct fc_rport_identifiers *ids)
> {
> struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
> struct fc_internal *fci = to_fc_internal(shost->transportt);
> @@ -2914,7 +2914,7 @@ struct fc_rport *
> spin_unlock_irqrestore(shost->host_lock, flags);
>
> /* No consistent binding found - create new remote port entry */
> - rport = fc_rport_create(shost, channel, ids);
> + rport = fc_remote_port_create(shost, channel, ids);
>
> return rport;
> }
Hannes,
Why are you making an interface change that will now affect drivers that
are not users of libfc ? Can't this be localized within libfc ?
-- james
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 08/20] libfc: Replace ->rport_create callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (6 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 07/20] scsi_transport_fc: rename 'fc_rport_create' to 'fc_remote_port_create' Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 8:54 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 09/20] libfc: Replace ->rport_login " Hannes Reinecke
` (13 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->rport_create callback only ever had a single implementation,
so we can as well call it directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/fcoe/fcoe_ctlr.c | 2 +-
drivers/scsi/libfc/fc_disc.c | 7 +++----
drivers/scsi/libfc/fc_lport.c | 6 +++---
drivers/scsi/libfc/fc_rport.c | 9 +++------
include/scsi/libfc.h | 8 +-------
5 files changed, 11 insertions(+), 21 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index bae4e5a..38e6779 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -2515,7 +2515,7 @@ static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fc_rport_priv *new)
return;
mutex_lock(&lport->disc.disc_mutex);
- rdata = lport->tt.rport_create(lport, port_id);
+ rdata = fc_rport_create(lport, port_id);
if (!rdata) {
mutex_unlock(&lport->disc.disc_mutex);
return;
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index e5ffeab..305dd85 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -454,7 +454,7 @@ static int fc_disc_gpn_ft_parse(struct fc_disc *disc, void *buf, size_t len)
if (ids.port_id != lport->port_id &&
ids.port_name != lport->wwpn) {
- rdata = lport->tt.rport_create(lport, ids.port_id);
+ rdata = fc_rport_create(lport, ids.port_id);
if (rdata) {
rdata->ids.port_name = ids.port_name;
rdata->disc_id = disc->disc_id;
@@ -624,8 +624,7 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
mutex_unlock(&rdata->rp_mutex);
lport->tt.rport_logoff(rdata);
mutex_lock(&lport->disc.disc_mutex);
- new_rdata = lport->tt.rport_create(lport,
- rdata->ids.port_id);
+ new_rdata = fc_rport_create(lport, rdata->ids.port_id);
mutex_unlock(&lport->disc.disc_mutex);
if (new_rdata) {
new_rdata->disc_id = disc->disc_id;
@@ -690,7 +689,7 @@ static int fc_disc_single(struct fc_lport *lport, struct fc_disc_port *dp)
{
struct fc_rport_priv *rdata;
- rdata = lport->tt.rport_create(lport, dp->port_id);
+ rdata = fc_rport_create(lport, dp->port_id);
if (!rdata)
return -ENOMEM;
rdata->disc_id = 0;
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 2da6c7c..a16936a 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -250,7 +250,7 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
kref_put(&lport->ptp_rdata->kref, fc_rport_destroy);
}
mutex_lock(&lport->disc.disc_mutex);
- lport->ptp_rdata = lport->tt.rport_create(lport, remote_fid);
+ lport->ptp_rdata = fc_rport_create(lport, remote_fid);
kref_get(&lport->ptp_rdata->kref);
lport->ptp_rdata->ids.port_name = remote_wwpn;
lport->ptp_rdata->ids.node_name = remote_wwnn;
@@ -1431,7 +1431,7 @@ static void fc_lport_enter_dns(struct fc_lport *lport)
fc_lport_state_enter(lport, LPORT_ST_DNS);
mutex_lock(&lport->disc.disc_mutex);
- rdata = lport->tt.rport_create(lport, FC_FID_DIR_SERV);
+ rdata = fc_rport_create(lport, FC_FID_DIR_SERV);
mutex_unlock(&lport->disc.disc_mutex);
if (!rdata)
goto err;
@@ -1548,7 +1548,7 @@ static void fc_lport_enter_fdmi(struct fc_lport *lport)
fc_lport_state_enter(lport, LPORT_ST_FDMI);
mutex_lock(&lport->disc.disc_mutex);
- rdata = lport->tt.rport_create(lport, FC_FID_MGMT_SERV);
+ rdata = fc_rport_create(lport, FC_FID_MGMT_SERV);
mutex_unlock(&lport->disc.disc_mutex);
if (!rdata)
goto err;
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 5f674fc..b05fa99 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -137,8 +137,7 @@ struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
*
* Locking note: must be called with the disc_mutex held.
*/
-static struct fc_rport_priv *fc_rport_create(struct fc_lport *lport,
- u32 port_id)
+struct fc_rport_priv *fc_rport_create(struct fc_lport *lport, u32 port_id)
{
struct fc_rport_priv *rdata;
@@ -172,6 +171,7 @@ static struct fc_rport_priv *fc_rport_create(struct fc_lport *lport,
}
return rdata;
}
+EXPORT_SYMBOL(fc_rport_create);
/**
* fc_rport_destroy() - Free a remote port after last reference is released
@@ -1847,7 +1847,7 @@ static void fc_rport_recv_plogi_req(struct fc_lport *lport,
disc = &lport->disc;
mutex_lock(&disc->disc_mutex);
- rdata = lport->tt.rport_create(lport, sid);
+ rdata = fc_rport_create(lport, sid);
if (!rdata) {
mutex_unlock(&disc->disc_mutex);
rjt_data.reason = ELS_RJT_UNAB;
@@ -2175,9 +2175,6 @@ static void fc_rport_flush_queue(void)
*/
int fc_rport_init(struct fc_lport *lport)
{
- if (!lport->tt.rport_create)
- lport->tt.rport_create = fc_rport_create;
-
if (!lport->tt.rport_login)
lport->tt.rport_login = fc_rport_login;
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 683201f..47b69d2 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -610,13 +610,6 @@ struct libfc_function_template {
struct fc_frame *);
/*
- * Create a remote port with a given port ID
- *
- * STATUS: OPTIONAL
- */
- struct fc_rport_priv *(*rport_create)(struct fc_lport *, u32);
-
- /*
* Initiates the RP state machine. It is called from the LP module.
* This function will issue the following commands to the N_Port
* identified by the FC ID provided.
@@ -1024,6 +1017,7 @@ static inline bool fc_fcp_is_read(const struct fc_fcp_pkt *fsp)
void fc_rport_terminate_io(struct fc_rport *);
struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
u32 port_id);
+struct fc_rport_priv *fc_rport_create(struct fc_lport *, u32);
void fc_rport_destroy(struct kref *kref);
/*
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 08/20] libfc: Replace ->rport_create callback with function call
2016-10-18 8:01 ` [PATCH 08/20] libfc: Replace ->rport_create callback with function call Hannes Reinecke
@ 2016-10-18 8:54 ` Johannes Thumshirn
2016-10-18 10:23 ` Hannes Reinecke
0 siblings, 1 reply; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:54 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:42AM +0200, Hannes Reinecke wrote:
> The ->rport_create callback only ever had a single implementation,
> so we can as well call it directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Any reason we can't rename fc_rport_create() with fc_remote_port_create()
so the scsi_transport_fc.c patch isn't needed?
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH 08/20] libfc: Replace ->rport_create callback with function call
2016-10-18 8:54 ` Johannes Thumshirn
@ 2016-10-18 10:23 ` Hannes Reinecke
2016-10-18 10:26 ` Johannes Thumshirn
0 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 10:23 UTC (permalink / raw)
To: Johannes Thumshirn
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On 10/18/2016 10:54 AM, Johannes Thumshirn wrote:
> On Tue, Oct 18, 2016 at 10:01:42AM +0200, Hannes Reinecke wrote:
>> The ->rport_create callback only ever had a single implementation,
>> so we can as well call it directly and drop the callback.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.com>
>> ---
>
> Any reason we can't rename fc_rport_create() with fc_remote_port_create()
> so the scsi_transport_fc.c patch isn't needed?
>
Yes: consistency.
Every function in libfc/fc_rport.c is named 'fc_rport_XXX'. So we should
stick to that naming scheme here, too.
scsi_transport_fc.c does not have such a strict naming scheme, so it's
easier to rename that.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH 08/20] libfc: Replace ->rport_create callback with function call
2016-10-18 10:23 ` Hannes Reinecke
@ 2016-10-18 10:26 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 10:26 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 12:23:22PM +0200, Hannes Reinecke wrote:
> On 10/18/2016 10:54 AM, Johannes Thumshirn wrote:
> > On Tue, Oct 18, 2016 at 10:01:42AM +0200, Hannes Reinecke wrote:
> >> The ->rport_create callback only ever had a single implementation,
> >> so we can as well call it directly and drop the callback.
> >>
> >> Signed-off-by: Hannes Reinecke <hare@suse.com>
> >> ---
> >
> > Any reason we can't rename fc_rport_create() with fc_remote_port_create()
> > so the scsi_transport_fc.c patch isn't needed?
> >
> Yes: consistency.
>
> Every function in libfc/fc_rport.c is named 'fc_rport_XXX'. So we should
> stick to that naming scheme here, too.
> scsi_transport_fc.c does not have such a strict naming scheme, so it's
> easier to rename that.
>
OK,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 09/20] libfc: Replace ->rport_login callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (7 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 08/20] libfc: Replace ->rport_create callback with function call Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 8:55 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 10/20] libfc: Replace ->rport_logoff " Hannes Reinecke
` (12 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->rport_login callback only ever had one implementation,
so we can as well call it directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/fcoe/fcoe_ctlr.c | 4 ++--
drivers/scsi/libfc/fc_disc.c | 6 +++---
drivers/scsi/libfc/fc_lport.c | 6 +++---
drivers/scsi/libfc/fc_rport.c | 14 ++++++++++----
include/scsi/libfc.h | 14 +-------------
5 files changed, 19 insertions(+), 25 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index 38e6779..ff0eca3 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -2674,7 +2674,7 @@ static void fcoe_ctlr_vn_beacon(struct fcoe_ctlr *fip,
LIBFCOE_FIP_DBG(fip, "beacon expired "
"for rport %x\n",
rdata->ids.port_id);
- lport->tt.rport_login(rdata);
+ fc_rport_login(rdata);
}
frport->time = jiffies;
}
@@ -3088,7 +3088,7 @@ static void fcoe_ctlr_vn_disc(struct fcoe_ctlr *fip)
continue;
frport = fcoe_ctlr_rport(rdata);
if (frport->time)
- lport->tt.rport_login(rdata);
+ fc_rport_login(rdata);
kref_put(&rdata->kref, fc_rport_destroy);
}
rcu_read_unlock();
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 305dd85..8d0aa19 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -299,7 +299,7 @@ static void fc_disc_done(struct fc_disc *disc, enum fc_disc_event event)
continue;
if (rdata->disc_id) {
if (rdata->disc_id == disc->disc_id)
- lport->tt.rport_login(rdata);
+ fc_rport_login(rdata);
else
lport->tt.rport_logoff(rdata);
}
@@ -628,13 +628,13 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
mutex_unlock(&lport->disc.disc_mutex);
if (new_rdata) {
new_rdata->disc_id = disc->disc_id;
- lport->tt.rport_login(new_rdata);
+ fc_rport_login(new_rdata);
}
goto out;
}
rdata->disc_id = disc->disc_id;
mutex_unlock(&rdata->rp_mutex);
- lport->tt.rport_login(rdata);
+ fc_rport_login(rdata);
} else if (ntohs(cp->ct_cmd) == FC_FS_RJT) {
FC_DISC_DBG(disc, "GPN_ID rejected reason %x exp %x\n",
cp->ct_reason, cp->ct_explan);
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index a16936a..e20c151 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -256,7 +256,7 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
lport->ptp_rdata->ids.node_name = remote_wwnn;
mutex_unlock(&lport->disc.disc_mutex);
- lport->tt.rport_login(lport->ptp_rdata);
+ fc_rport_login(lport->ptp_rdata);
fc_lport_enter_ready(lport);
}
@@ -1437,7 +1437,7 @@ static void fc_lport_enter_dns(struct fc_lport *lport)
goto err;
rdata->ops = &fc_lport_rport_ops;
- lport->tt.rport_login(rdata);
+ fc_rport_login(rdata);
return;
err:
@@ -1554,7 +1554,7 @@ static void fc_lport_enter_fdmi(struct fc_lport *lport)
goto err;
rdata->ops = &fc_lport_rport_ops;
- lport->tt.rport_login(rdata);
+ fc_rport_login(rdata);
return;
err:
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index b05fa99..c045bc4 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -412,6 +412,14 @@ static void fc_rport_work(struct work_struct *work)
* fc_rport_login() - Start the remote port login state machine
* @rdata: The remote port to be logged in to
*
+ * Initiates the RP state machine. It is called from the LP module.
+ * This function will issue the following commands to the N_Port
+ * identified by the FC ID provided.
+ *
+ * - PLOGI
+ * - PRLI
+ * - RTV
+ *
* Locking Note: Called without the rport lock held. This
* function will hold the rport lock, call an _enter_*
* function and then unlock the rport.
@@ -420,7 +428,7 @@ static void fc_rport_work(struct work_struct *work)
* If it appears we are already logged in, ADISC is used to verify
* the setup.
*/
-static int fc_rport_login(struct fc_rport_priv *rdata)
+int fc_rport_login(struct fc_rport_priv *rdata)
{
mutex_lock(&rdata->rp_mutex);
@@ -452,6 +460,7 @@ static int fc_rport_login(struct fc_rport_priv *rdata)
return 0;
}
+EXPORT_SYMBOL(fc_rport_login);
/**
* fc_rport_enter_delete() - Schedule a remote port to be deleted
@@ -2175,9 +2184,6 @@ static void fc_rport_flush_queue(void)
*/
int fc_rport_init(struct fc_lport *lport)
{
- if (!lport->tt.rport_login)
- lport->tt.rport_login = fc_rport_login;
-
if (!lport->tt.rport_logoff)
lport->tt.rport_logoff = fc_rport_logoff;
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 47b69d2..6404577 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -610,19 +610,6 @@ struct libfc_function_template {
struct fc_frame *);
/*
- * Initiates the RP state machine. It is called from the LP module.
- * This function will issue the following commands to the N_Port
- * identified by the FC ID provided.
- *
- * - PLOGI
- * - PRLI
- * - RTV
- *
- * STATUS: OPTIONAL
- */
- int (*rport_login)(struct fc_rport_priv *);
-
- /*
* Logoff, and remove the rport from the transport if
* it had been added. This will send a LOGO to the target.
*
@@ -1019,6 +1006,7 @@ struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
u32 port_id);
struct fc_rport_priv *fc_rport_create(struct fc_lport *, u32);
void fc_rport_destroy(struct kref *kref);
+int fc_rport_login(struct fc_rport_priv *rdata);
/*
* DISCOVERY LAYER
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 09/20] libfc: Replace ->rport_login callback with function call
2016-10-18 8:01 ` [PATCH 09/20] libfc: Replace ->rport_login " Hannes Reinecke
@ 2016-10-18 8:55 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:55 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:43AM +0200, Hannes Reinecke wrote:
> The ->rport_login callback only ever had one implementation,
> so we can as well call it directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 10/20] libfc: Replace ->rport_logoff callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (8 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 09/20] libfc: Replace ->rport_login " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 8:58 ` Johannes Thumshirn
2016-10-19 12:54 ` Chad Dupuis
2016-10-18 8:01 ` [PATCH 11/20] libfc: Replace ->rport_recv_req " Hannes Reinecke
` (11 subsequent siblings)
21 siblings, 2 replies; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->rport_logoff callback only ever had one implementation,
so we can as well call it directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/bnx2fc/bnx2fc_tgt.c | 3 +--
drivers/scsi/fcoe/fcoe_ctlr.c | 8 ++++----
drivers/scsi/libfc/fc_disc.c | 8 ++++----
drivers/scsi/libfc/fc_lport.c | 10 +++++-----
drivers/scsi/libfc/fc_rport.c | 8 +++-----
include/scsi/libfc.h | 9 +--------
6 files changed, 18 insertions(+), 28 deletions(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_tgt.c b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
index 08ec318..739bfb6 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_tgt.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_tgt.c
@@ -80,7 +80,6 @@ static void bnx2fc_offload_session(struct fcoe_port *port,
struct bnx2fc_rport *tgt,
struct fc_rport_priv *rdata)
{
- struct fc_lport *lport = rdata->local_port;
struct fc_rport *rport = rdata->rport;
struct bnx2fc_interface *interface = port->priv;
struct bnx2fc_hba *hba = interface->hba;
@@ -160,7 +159,7 @@ static void bnx2fc_offload_session(struct fcoe_port *port,
tgt_init_err:
if (tgt->fcoe_conn_id != -1)
bnx2fc_free_conn_id(hba, tgt->fcoe_conn_id);
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
}
void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt)
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index ff0eca3..12aecf3 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -2153,7 +2153,7 @@ static void fcoe_ctlr_vn_rport_callback(struct fc_lport *lport,
LIBFCOE_FIP_DBG(fip,
"rport FLOGI limited port_id %6.6x\n",
rdata->ids.port_id);
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
}
break;
default:
@@ -2179,7 +2179,7 @@ static void fcoe_ctlr_disc_stop_locked(struct fc_lport *lport)
rcu_read_lock();
list_for_each_entry_rcu(rdata, &lport->disc.rports, peers) {
if (kref_get_unless_zero(&rdata->kref)) {
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
kref_put(&rdata->kref, fc_rport_destroy);
}
}
@@ -2531,7 +2531,7 @@ static void fcoe_ctlr_vn_add(struct fcoe_ctlr *fip, struct fc_rport_priv *new)
(ids->node_name != -1 && ids->node_name != new->ids.node_name)) {
mutex_unlock(&rdata->rp_mutex);
LIBFCOE_FIP_DBG(fip, "vn_add rport logoff %6.6x\n", port_id);
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
mutex_lock(&rdata->rp_mutex);
}
ids->port_name = new->ids.port_name;
@@ -2729,7 +2729,7 @@ static unsigned long fcoe_ctlr_vn_age(struct fcoe_ctlr *fip)
LIBFCOE_FIP_DBG(fip,
"port %16.16llx fc_id %6.6x beacon expired\n",
rdata->ids.port_name, rdata->ids.port_id);
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
} else if (time_before(deadline, next_time))
next_time = deadline;
kref_put(&rdata->kref, fc_rport_destroy);
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 8d0aa19..7efa5a6 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -71,7 +71,7 @@ static void fc_disc_stop_rports(struct fc_disc *disc)
rcu_read_lock();
list_for_each_entry_rcu(rdata, &disc->rports, peers) {
if (kref_get_unless_zero(&rdata->kref)) {
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
kref_put(&rdata->kref, fc_rport_destroy);
}
}
@@ -301,7 +301,7 @@ static void fc_disc_done(struct fc_disc *disc, enum fc_disc_event event)
if (rdata->disc_id == disc->disc_id)
fc_rport_login(rdata);
else
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
}
kref_put(&rdata->kref, fc_rport_destroy);
}
@@ -622,7 +622,7 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
"Port-id %6.6x wwpn %16.16llx\n",
rdata->ids.port_id, port_name);
mutex_unlock(&rdata->rp_mutex);
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
mutex_lock(&lport->disc.disc_mutex);
new_rdata = fc_rport_create(lport, rdata->ids.port_id);
mutex_unlock(&lport->disc.disc_mutex);
@@ -638,7 +638,7 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
} else if (ntohs(cp->ct_cmd) == FC_FS_RJT) {
FC_DISC_DBG(disc, "GPN_ID rejected reason %x exp %x\n",
cp->ct_reason, cp->ct_explan);
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
} else {
FC_DISC_DBG(disc, "GPN_ID unexpected response code %x\n",
ntohs(cp->ct_cmd));
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index e20c151..a391cb1 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -200,7 +200,7 @@ static void fc_lport_rport_callback(struct fc_lport *lport,
"in the DNS or FDMI state, it's in the "
"%d state", rdata->ids.port_id,
lport->state);
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
}
break;
case RPORT_EV_LOGO:
@@ -246,7 +246,7 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
u64 remote_wwnn)
{
if (lport->ptp_rdata) {
- lport->tt.rport_logoff(lport->ptp_rdata);
+ fc_rport_logoff(lport->ptp_rdata);
kref_put(&lport->ptp_rdata->kref, fc_rport_destroy);
}
mutex_lock(&lport->disc.disc_mutex);
@@ -623,7 +623,7 @@ int fc_fabric_logoff(struct fc_lport *lport)
lport->tt.disc_stop_final(lport);
mutex_lock(&lport->lp_mutex);
if (lport->dns_rdata)
- lport->tt.rport_logoff(lport->dns_rdata);
+ fc_rport_logoff(lport->dns_rdata);
mutex_unlock(&lport->lp_mutex);
lport->tt.rport_flush_queue();
mutex_lock(&lport->lp_mutex);
@@ -1011,12 +1011,12 @@ int fc_lport_reset(struct fc_lport *lport)
static void fc_lport_reset_locked(struct fc_lport *lport)
{
if (lport->dns_rdata) {
- lport->tt.rport_logoff(lport->dns_rdata);
+ fc_rport_logoff(lport->dns_rdata);
lport->dns_rdata = NULL;
}
if (lport->ptp_rdata) {
- lport->tt.rport_logoff(lport->ptp_rdata);
+ fc_rport_logoff(lport->ptp_rdata);
kref_put(&lport->ptp_rdata->kref, fc_rport_destroy);
lport->ptp_rdata = NULL;
}
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index c045bc4..22c8c92 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -295,7 +295,7 @@ static void fc_rport_work(struct work_struct *work)
}
if (!rport) {
FC_RPORT_DBG(rdata, "Failed to add the rport\n");
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
kref_put(&rdata->kref, fc_rport_destroy);
return;
}
@@ -504,7 +504,7 @@ static void fc_rport_enter_delete(struct fc_rport_priv *rdata,
* function will hold the rport lock, call an _enter_*
* function and then unlock the rport.
*/
-static int fc_rport_logoff(struct fc_rport_priv *rdata)
+int fc_rport_logoff(struct fc_rport_priv *rdata)
{
struct fc_lport *lport = rdata->local_port;
u32 port_id = rdata->ids.port_id;
@@ -538,6 +538,7 @@ static int fc_rport_logoff(struct fc_rport_priv *rdata)
mutex_unlock(&rdata->rp_mutex);
return 0;
}
+EXPORT_SYMBOL(fc_rport_logoff);
/**
* fc_rport_enter_ready() - Transition to the RPORT_ST_READY state
@@ -2184,9 +2185,6 @@ static void fc_rport_flush_queue(void)
*/
int fc_rport_init(struct fc_lport *lport)
{
- if (!lport->tt.rport_logoff)
- lport->tt.rport_logoff = fc_rport_logoff;
-
if (!lport->tt.rport_recv_req)
lport->tt.rport_recv_req = fc_rport_recv_req;
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 6404577..b75a182 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -610,14 +610,6 @@ struct libfc_function_template {
struct fc_frame *);
/*
- * Logoff, and remove the rport from the transport if
- * it had been added. This will send a LOGO to the target.
- *
- * STATUS: OPTIONAL
- */
- int (*rport_logoff)(struct fc_rport_priv *);
-
- /*
* Receive a request from a remote port.
*
* STATUS: OPTIONAL
@@ -1007,6 +999,7 @@ struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
struct fc_rport_priv *fc_rport_create(struct fc_lport *, u32);
void fc_rport_destroy(struct kref *kref);
int fc_rport_login(struct fc_rport_priv *rdata);
+int fc_rport_logoff(struct fc_rport_priv *rdata);
/*
* DISCOVERY LAYER
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 10/20] libfc: Replace ->rport_logoff callback with function call
2016-10-18 8:01 ` [PATCH 10/20] libfc: Replace ->rport_logoff " Hannes Reinecke
@ 2016-10-18 8:58 ` Johannes Thumshirn
2016-10-19 12:54 ` Chad Dupuis
1 sibling, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:58 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:44AM +0200, Hannes Reinecke wrote:
> The ->rport_logoff callback only ever had one implementation,
> so we can as well call it directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH 10/20] libfc: Replace ->rport_logoff callback with function call
2016-10-18 8:01 ` [PATCH 10/20] libfc: Replace ->rport_logoff " Hannes Reinecke
2016-10-18 8:58 ` Johannes Thumshirn
@ 2016-10-19 12:54 ` Chad Dupuis
1 sibling, 0 replies; 50+ messages in thread
From: Chad Dupuis @ 2016-10-19 12:54 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, 18 Oct 2016, 8:01am -0000, Hannes Reinecke wrote:
> The ->rport_logoff callback only ever had one implementation,
> so we can as well call it directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
> drivers/scsi/bnx2fc/bnx2fc_tgt.c | 3 +--
> drivers/scsi/fcoe/fcoe_ctlr.c | 8 ++++----
> drivers/scsi/libfc/fc_disc.c | 8 ++++----
> drivers/scsi/libfc/fc_lport.c | 10 +++++-----
> drivers/scsi/libfc/fc_rport.c | 8 +++-----
> include/scsi/libfc.h | 9 +--------
> 6 files changed, 18 insertions(+), 28 deletions(-)
>
Straightforward conversion.
Reviewed-by: Chad Dupuis <chad.dupuis@cavium.com>
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 11/20] libfc: Replace ->rport_recv_req callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (9 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 10/20] libfc: Replace ->rport_logoff " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 8:58 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 12/20] libfc: Replace ->rport_flush_queue " Hannes Reinecke
` (10 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->rport_recv_req callback only ever had one implementation,
so we can as well call it directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/libfc/fc_lport.c | 2 +-
drivers/scsi/libfc/fc_rport.c | 6 ++----
include/scsi/libfc.h | 8 +-------
3 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index a391cb1..937a442 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -902,7 +902,7 @@ static void fc_lport_recv_els_req(struct fc_lport *lport,
/*
* Check opcode.
*/
- recv = lport->tt.rport_recv_req;
+ recv = fc_rport_recv_req;
switch (fc_frame_payload_op(fp)) {
case ELS_FLOGI:
if (!lport->point_to_multipoint)
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 22c8c92..feae7ab 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -1786,7 +1786,7 @@ static void fc_rport_recv_els_req(struct fc_lport *lport, struct fc_frame *fp)
*
* Reference counting: does not modify kref
*/
-static void fc_rport_recv_req(struct fc_lport *lport, struct fc_frame *fp)
+void fc_rport_recv_req(struct fc_lport *lport, struct fc_frame *fp)
{
struct fc_seq_els_data els_data;
@@ -1823,6 +1823,7 @@ static void fc_rport_recv_req(struct fc_lport *lport, struct fc_frame *fp)
break;
}
}
+EXPORT_SYMBOL(fc_rport_recv_req);
/**
* fc_rport_recv_plogi_req() - Handler for Port Login (PLOGI) requests
@@ -2185,9 +2186,6 @@ static void fc_rport_flush_queue(void)
*/
int fc_rport_init(struct fc_lport *lport)
{
- if (!lport->tt.rport_recv_req)
- lport->tt.rport_recv_req = fc_rport_recv_req;
-
if (!lport->tt.rport_flush_queue)
lport->tt.rport_flush_queue = fc_rport_flush_queue;
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index b75a182..1e1dbc9 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -610,13 +610,6 @@ struct libfc_function_template {
struct fc_frame *);
/*
- * Receive a request from a remote port.
- *
- * STATUS: OPTIONAL
- */
- void (*rport_recv_req)(struct fc_lport *, struct fc_frame *);
-
- /*
* Callback routine after the remote port is logged in
*
* STATUS: OPTIONAL
@@ -1000,6 +993,7 @@ struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
void fc_rport_destroy(struct kref *kref);
int fc_rport_login(struct fc_rport_priv *rdata);
int fc_rport_logoff(struct fc_rport_priv *rdata);
+void fc_rport_recv_req(struct fc_lport *lport, struct fc_frame *fp);
/*
* DISCOVERY LAYER
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 11/20] libfc: Replace ->rport_recv_req callback with function call
2016-10-18 8:01 ` [PATCH 11/20] libfc: Replace ->rport_recv_req " Hannes Reinecke
@ 2016-10-18 8:58 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:58 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:45AM +0200, Hannes Reinecke wrote:
> The ->rport_recv_req callback only ever had one implementation,
> so we can as well call it directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 12/20] libfc: Replace ->rport_flush_queue callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (10 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 11/20] libfc: Replace ->rport_recv_req " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 8:59 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 13/20] libfc: Remove fc_rport_init() Hannes Reinecke
` (9 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->rport_flush_queue callback only ever had a single
implementation, so we can as well call it directly and
drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/fcoe/fcoe_ctlr.c | 2 +-
drivers/scsi/libfc/fc_disc.c | 2 +-
drivers/scsi/libfc/fc_lport.c | 2 +-
drivers/scsi/libfc/fc_rport.c | 6 ++----
include/scsi/libfc.h | 8 +-------
5 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index 12aecf3..12efc1d 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -2215,7 +2215,7 @@ static void fcoe_ctlr_disc_stop(struct fc_lport *lport)
static void fcoe_ctlr_disc_stop_final(struct fc_lport *lport)
{
fcoe_ctlr_disc_stop(lport);
- lport->tt.rport_flush_queue();
+ fc_rport_flush_queue();
synchronize_rcu();
}
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 7efa5a6..6103231 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -719,7 +719,7 @@ static void fc_disc_stop(struct fc_lport *lport)
static void fc_disc_stop_final(struct fc_lport *lport)
{
fc_disc_stop(lport);
- lport->tt.rport_flush_queue();
+ fc_rport_flush_queue();
}
/**
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 937a442..7315675 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -625,7 +625,7 @@ int fc_fabric_logoff(struct fc_lport *lport)
if (lport->dns_rdata)
fc_rport_logoff(lport->dns_rdata);
mutex_unlock(&lport->lp_mutex);
- lport->tt.rport_flush_queue();
+ fc_rport_flush_queue();
mutex_lock(&lport->lp_mutex);
fc_lport_enter_logo(lport);
mutex_unlock(&lport->lp_mutex);
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index feae7ab..6e50226 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -2175,10 +2175,11 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp)
/**
* fc_rport_flush_queue() - Flush the rport_event_queue
*/
-static void fc_rport_flush_queue(void)
+void fc_rport_flush_queue(void)
{
flush_workqueue(rport_event_queue);
}
+EXPORT_SYMBOL(fc_rport_flush_queue);
/**
* fc_rport_init() - Initialize the remote port layer for a local port
@@ -2186,9 +2187,6 @@ static void fc_rport_flush_queue(void)
*/
int fc_rport_init(struct fc_lport *lport)
{
- if (!lport->tt.rport_flush_queue)
- lport->tt.rport_flush_queue = fc_rport_flush_queue;
-
return 0;
}
EXPORT_SYMBOL(fc_rport_init);
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 1e1dbc9..57630c5 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -583,13 +583,6 @@ struct libfc_function_template {
void (*exch_mgr_reset)(struct fc_lport *, u32 s_id, u32 d_id);
/*
- * Flush the rport work queue. Generally used before shutdown.
- *
- * STATUS: OPTIONAL
- */
- void (*rport_flush_queue)(void);
-
- /*
* Set the local port FC_ID.
*
* This may be provided by the LLD to allow it to be
@@ -994,6 +987,7 @@ struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
int fc_rport_login(struct fc_rport_priv *rdata);
int fc_rport_logoff(struct fc_rport_priv *rdata);
void fc_rport_recv_req(struct fc_lport *lport, struct fc_frame *fp);
+void fc_rport_flush_queue(void);
/*
* DISCOVERY LAYER
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 12/20] libfc: Replace ->rport_flush_queue callback with function call
2016-10-18 8:01 ` [PATCH 12/20] libfc: Replace ->rport_flush_queue " Hannes Reinecke
@ 2016-10-18 8:59 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:59 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:46AM +0200, Hannes Reinecke wrote:
> The ->rport_flush_queue callback only ever had a single
> implementation, so we can as well call it directly and
> drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 13/20] libfc: Remove fc_rport_init()
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (11 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 12/20] libfc: Replace ->rport_flush_queue " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 8:59 ` Johannes Thumshirn
2016-10-19 12:55 ` Chad Dupuis
2016-10-18 8:01 ` [PATCH 14/20] libfc: Replace ->seq_send callback with function call Hannes Reinecke
` (8 subsequent siblings)
21 siblings, 2 replies; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
Function is empty now and can be removed.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 1 -
drivers/scsi/fcoe/fcoe_ctlr.c | 1 -
drivers/scsi/libfc/fc_rport.c | 10 ----------
include/scsi/libfc.h | 1 -
4 files changed, 13 deletions(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index f9ddb61..0990130 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -970,7 +970,6 @@ static int bnx2fc_libfc_config(struct fc_lport *lport)
sizeof(struct libfc_function_template));
fc_elsct_init(lport);
fc_exch_init(lport);
- fc_rport_init(lport);
fc_disc_init(lport);
fc_disc_config(lport, lport);
return 0;
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index 12efc1d..cea57e2 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -3235,7 +3235,6 @@ int fcoe_libfc_config(struct fc_lport *lport, struct fcoe_ctlr *fip,
fc_exch_init(lport);
fc_elsct_init(lport);
fc_lport_init(lport);
- fc_rport_init(lport);
fc_disc_init(lport);
fcoe_ctlr_mode_set(lport, fip, fip->mode);
return 0;
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index 6e50226..110a707 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -2182,16 +2182,6 @@ void fc_rport_flush_queue(void)
EXPORT_SYMBOL(fc_rport_flush_queue);
/**
- * fc_rport_init() - Initialize the remote port layer for a local port
- * @lport: The local port to initialize the remote port layer for
- */
-int fc_rport_init(struct fc_lport *lport)
-{
- return 0;
-}
-EXPORT_SYMBOL(fc_rport_init);
-
-/**
* fc_rport_fcp_prli() - Handle incoming PRLI for the FCP initiator.
* @rdata: remote port private
* @spp_len: service parameter page length
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 57630c5..a776901 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -978,7 +978,6 @@ static inline bool fc_fcp_is_read(const struct fc_fcp_pkt *fsp)
/*
* REMOTE PORT LAYER
*****************************/
-int fc_rport_init(struct fc_lport *);
void fc_rport_terminate_io(struct fc_rport *);
struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
u32 port_id);
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 13/20] libfc: Remove fc_rport_init()
2016-10-18 8:01 ` [PATCH 13/20] libfc: Remove fc_rport_init() Hannes Reinecke
@ 2016-10-18 8:59 ` Johannes Thumshirn
2016-10-19 12:55 ` Chad Dupuis
1 sibling, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 8:59 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:47AM +0200, Hannes Reinecke wrote:
> Function is empty now and can be removed.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH 13/20] libfc: Remove fc_rport_init()
2016-10-18 8:01 ` [PATCH 13/20] libfc: Remove fc_rport_init() Hannes Reinecke
2016-10-18 8:59 ` Johannes Thumshirn
@ 2016-10-19 12:55 ` Chad Dupuis
1 sibling, 0 replies; 50+ messages in thread
From: Chad Dupuis @ 2016-10-19 12:55 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, 18 Oct 2016, 8:01am -0000, Hannes Reinecke wrote:
> Function is empty now and can be removed.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
> drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 1 -
> drivers/scsi/fcoe/fcoe_ctlr.c | 1 -
> drivers/scsi/libfc/fc_rport.c | 10 ----------
> include/scsi/libfc.h | 1 -
> 4 files changed, 13 deletions(-)
>
> diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
> index f9ddb61..0990130 100644
> --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
> +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
> @@ -970,7 +970,6 @@ static int bnx2fc_libfc_config(struct fc_lport *lport)
> sizeof(struct libfc_function_template));
> fc_elsct_init(lport);
> fc_exch_init(lport);
> - fc_rport_init(lport);
> fc_disc_init(lport);
> fc_disc_config(lport, lport);
> return 0;
> diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
> index 12efc1d..cea57e2 100644
> --- a/drivers/scsi/fcoe/fcoe_ctlr.c
> +++ b/drivers/scsi/fcoe/fcoe_ctlr.c
> @@ -3235,7 +3235,6 @@ int fcoe_libfc_config(struct fc_lport *lport, struct fcoe_ctlr *fip,
> fc_exch_init(lport);
> fc_elsct_init(lport);
> fc_lport_init(lport);
> - fc_rport_init(lport);
> fc_disc_init(lport);
> fcoe_ctlr_mode_set(lport, fip, fip->mode);
> return 0;
> diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
> index 6e50226..110a707 100644
> --- a/drivers/scsi/libfc/fc_rport.c
> +++ b/drivers/scsi/libfc/fc_rport.c
> @@ -2182,16 +2182,6 @@ void fc_rport_flush_queue(void)
> EXPORT_SYMBOL(fc_rport_flush_queue);
>
> /**
> - * fc_rport_init() - Initialize the remote port layer for a local port
> - * @lport: The local port to initialize the remote port layer for
> - */
> -int fc_rport_init(struct fc_lport *lport)
> -{
> - return 0;
> -}
> -EXPORT_SYMBOL(fc_rport_init);
> -
> -/**
> * fc_rport_fcp_prli() - Handle incoming PRLI for the FCP initiator.
> * @rdata: remote port private
> * @spp_len: service parameter page length
> diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
> index 57630c5..a776901 100644
> --- a/include/scsi/libfc.h
> +++ b/include/scsi/libfc.h
> @@ -978,7 +978,6 @@ static inline bool fc_fcp_is_read(const struct fc_fcp_pkt *fsp)
> /*
> * REMOTE PORT LAYER
> *****************************/
> -int fc_rport_init(struct fc_lport *);
> void fc_rport_terminate_io(struct fc_rport *);
> struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
> u32 port_id);
>
Reviewed-by: Chad Dupuis <chad.dupuis@cavium.com>
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 14/20] libfc: Replace ->seq_send callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (12 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 13/20] libfc: Remove fc_rport_init() Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 9:01 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 15/20] libfc: Replace ->seq_exch_abort " Hannes Reinecke
` (7 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->seq_send callback only ever had one implementation,
so we can as well call it directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/libfc/fc_exch.c | 7 ++-----
drivers/scsi/libfc/fc_fcp.c | 4 ++--
drivers/target/tcm_fc/tfc_cmd.c | 6 +++---
drivers/target/tcm_fc/tfc_io.c | 2 +-
include/scsi/libfc.h | 8 +-------
5 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index f5c3c1d..ee34cc6 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -533,8 +533,7 @@ static int fc_seq_send_locked(struct fc_lport *lport, struct fc_seq *sp,
* Note: The frame will be freed either by a direct call to fc_frame_free(fp)
* or indirectly by calling libfc_function_template.frame_send().
*/
-static int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp,
- struct fc_frame *fp)
+int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp, struct fc_frame *fp)
{
struct fc_exch *ep;
int error;
@@ -544,6 +543,7 @@ static int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp,
spin_unlock_bh(&ep->ex_lock);
return error;
}
+EXPORT_SYMBOL(fc_seq_send);
/**
* fc_seq_alloc() - Allocate a sequence for a given exchange
@@ -2648,9 +2648,6 @@ int fc_exch_init(struct fc_lport *lport)
if (!lport->tt.seq_set_resp)
lport->tt.seq_set_resp = fc_seq_set_resp;
- if (!lport->tt.seq_send)
- lport->tt.seq_send = fc_seq_send;
-
if (!lport->tt.exch_done)
lport->tt.exch_done = fc_exch_done;
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 5cf1d2e..daad70f 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -731,7 +731,7 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq,
/*
* send fragment using for a sequence.
*/
- error = lport->tt.seq_send(lport, seq, fp);
+ error = fc_seq_send(lport, seq, fp);
if (error) {
WARN_ON(1); /* send error should be rare */
return error;
@@ -1033,7 +1033,7 @@ static void fc_fcp_complete_locked(struct fc_fcp_pkt *fsp)
fc_fill_fc_hdr(conf_frame, FC_RCTL_DD_SOL_CTL,
ep->did, ep->sid,
FC_TYPE_FCP, f_ctl, 0);
- lport->tt.seq_send(lport, csp, conf_frame);
+ fc_seq_send(lport, csp, conf_frame);
}
}
lport->tt.exch_done(seq);
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index 216e18c..7dc0eb7 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -165,7 +165,7 @@ int ft_queue_status(struct se_cmd *se_cmd)
fc_fill_fc_hdr(fp, FC_RCTL_DD_CMD_STATUS, ep->did, ep->sid, FC_TYPE_FCP,
FC_FC_EX_CTX | FC_FC_LAST_SEQ | FC_FC_END_SEQ, 0);
- rc = lport->tt.seq_send(lport, cmd->seq, fp);
+ rc = fc_seq_send(lport, cmd->seq, fp);
if (rc) {
pr_info_ratelimited("%s: Failed to send response frame %p, "
"xid <0x%x>\n", __func__, fp, ep->xid);
@@ -242,7 +242,7 @@ int ft_write_pending(struct se_cmd *se_cmd)
cmd->was_ddp_setup = 1;
}
}
- lport->tt.seq_send(lport, cmd->seq, fp);
+ fc_seq_send(lport, cmd->seq, fp);
return 0;
}
@@ -323,7 +323,7 @@ static void ft_send_resp_status(struct fc_lport *lport,
fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_DD_CMD_STATUS, 0);
sp = fr_seq(fp);
if (sp) {
- lport->tt.seq_send(lport, sp, fp);
+ fc_seq_send(lport, sp, fp);
lport->tt.exch_done(sp);
} else {
lport->tt.frame_send(lport, fp);
diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c
index 6f7c65a..b10ebfd 100644
--- a/drivers/target/tcm_fc/tfc_io.c
+++ b/drivers/target/tcm_fc/tfc_io.c
@@ -174,7 +174,7 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
f_ctl |= FC_FC_END_SEQ;
fc_fill_fc_hdr(fp, FC_RCTL_DD_SOL_DATA, ep->did, ep->sid,
FC_TYPE_FCP, f_ctl, fh_off);
- error = lport->tt.seq_send(lport, seq, fp);
+ error = fc_seq_send(lport, seq, fp);
if (error) {
pr_info_ratelimited("%s: Failed to send frame %p, "
"xid <0x%x>, remaining %zu, "
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index a776901..7514cc9 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -513,13 +513,6 @@ struct libfc_function_template {
* STATUS: OPTIONAL
*/
void (*get_lesb)(struct fc_lport *, struct fc_els_lesb *lesb);
- /*
- * Send a frame using an existing sequence and exchange.
- *
- * STATUS: OPTIONAL
- */
- int (*seq_send)(struct fc_lport *, struct fc_seq *,
- struct fc_frame *);
/*
* Abort an exchange and sequence. Generally called because of a
@@ -1058,6 +1051,7 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *, enum fc_class class,
void fc_exch_mgr_free(struct fc_lport *);
void fc_exch_recv(struct fc_lport *, struct fc_frame *);
void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id);
+int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp, struct fc_frame *fp);
/*
* Functions for fc_functions_template
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 14/20] libfc: Replace ->seq_send callback with function call
2016-10-18 8:01 ` [PATCH 14/20] libfc: Replace ->seq_send callback with function call Hannes Reinecke
@ 2016-10-18 9:01 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 9:01 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:48AM +0200, Hannes Reinecke wrote:
> The ->seq_send callback only ever had one implementation,
> so we can as well call it directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 15/20] libfc: Replace ->seq_exch_abort callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (13 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 14/20] libfc: Replace ->seq_send callback with function call Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 9:02 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 16/20] libfc: Replace ->exch_done " Hannes Reinecke
` (6 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->seq_exch_abort callback only ever had one implementation,
so we can as well call it directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/libfc/fc_exch.c | 13 ++++++++-----
drivers/scsi/libfc/fc_fcp.c | 4 ++--
include/scsi/libfc.h | 14 +-------------
3 files changed, 11 insertions(+), 20 deletions(-)
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index ee34cc6..fffb9a3 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -629,6 +629,13 @@ static void fc_seq_set_resp(struct fc_seq *sp,
* @ep: The exchange to be aborted
* @timer_msec: The period of time to wait before aborting
*
+ * Abort an exchange and sequence. Generally called because of a
+ * exchange timeout or an abort from the upper layer.
+ *
+ * A timer_msec can be specified for abort timeout, if non-zero
+ * timer_msec value is specified then exchange resp handler
+ * will be called with timeout error if no response to abort.
+ *
* Locking notes: Called with exch lock held
*
* Return value: 0 on success else error code
@@ -692,8 +699,7 @@ static int fc_exch_abort_locked(struct fc_exch *ep,
*
* Return value: 0 on success else error code
*/
-static int fc_seq_exch_abort(const struct fc_seq *req_sp,
- unsigned int timer_msec)
+int fc_seq_exch_abort(const struct fc_seq *req_sp, unsigned int timer_msec)
{
struct fc_exch *ep;
int error;
@@ -2654,9 +2660,6 @@ int fc_exch_init(struct fc_lport *lport)
if (!lport->tt.exch_mgr_reset)
lport->tt.exch_mgr_reset = fc_exch_mgr_reset;
- if (!lport->tt.seq_exch_abort)
- lport->tt.seq_exch_abort = fc_seq_exch_abort;
-
if (!lport->tt.seq_assign)
lport->tt.seq_assign = fc_seq_assign;
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index daad70f..2bb3f9f 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -287,9 +287,9 @@ static int fc_fcp_send_abort(struct fc_fcp_pkt *fsp)
put_cpu();
fsp->state |= FC_SRB_ABORT_PENDING;
- rc = fsp->lp->tt.seq_exch_abort(fsp->seq_ptr, 0);
+ rc = fc_seq_exch_abort(fsp->seq_ptr, 0);
/*
- * ->seq_exch_abort() might return -ENXIO if
+ * fc_seq_exch_abort() might return -ENXIO if
* the sequence is already completed
*/
if (rc == -ENXIO) {
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 7514cc9..50d1af1 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -515,19 +515,6 @@ struct libfc_function_template {
void (*get_lesb)(struct fc_lport *, struct fc_els_lesb *lesb);
/*
- * Abort an exchange and sequence. Generally called because of a
- * exchange timeout or an abort from the upper layer.
- *
- * A timer_msec can be specified for abort timeout, if non-zero
- * timer_msec value is specified then exchange resp handler
- * will be called with timeout error if no response to abort.
- *
- * STATUS: OPTIONAL
- */
- int (*seq_exch_abort)(const struct fc_seq *,
- unsigned int timer_msec);
-
- /*
* Indicate that an exchange/sequence tuple is complete and the memory
* allocated for the related objects may be freed.
*
@@ -1052,6 +1039,7 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *, enum fc_class class,
void fc_exch_recv(struct fc_lport *, struct fc_frame *);
void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id);
int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp, struct fc_frame *fp);
+int fc_seq_exch_abort(const struct fc_seq *, unsigned int timer_msec);
/*
* Functions for fc_functions_template
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 15/20] libfc: Replace ->seq_exch_abort callback with function call
2016-10-18 8:01 ` [PATCH 15/20] libfc: Replace ->seq_exch_abort " Hannes Reinecke
@ 2016-10-18 9:02 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 9:02 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:49AM +0200, Hannes Reinecke wrote:
> The ->seq_exch_abort callback only ever had one implementation,
> so we can as well call it directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 16/20] libfc: Replace ->exch_done callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (14 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 15/20] libfc: Replace ->seq_exch_abort " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 9:03 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 17/20] libfc: Replace ->seq_start_next " Hannes Reinecke
` (5 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->exch_done callback only ever had one implementation,
so we can as well call it directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/libfc/fc_exch.c | 6 ++----
drivers/scsi/libfc/fc_fcp.c | 20 +++++++++-----------
drivers/scsi/libfc/fc_lport.c | 2 +-
drivers/target/tcm_fc/tfc_cmd.c | 4 ++--
include/scsi/libfc.h | 9 +--------
5 files changed, 15 insertions(+), 26 deletions(-)
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index fffb9a3..b98ad3f 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -969,7 +969,7 @@ static struct fc_exch *fc_exch_find(struct fc_exch_mgr *mp, u16 xid)
*
* Note: May sleep if invoked from outside a response handler.
*/
-static void fc_exch_done(struct fc_seq *sp)
+void fc_exch_done(struct fc_seq *sp)
{
struct fc_exch *ep = fc_seq_exch(sp);
int rc;
@@ -982,6 +982,7 @@ static void fc_exch_done(struct fc_seq *sp)
if (!rc)
fc_exch_delete(ep);
}
+EXPORT_SYMBOL(fc_exch_done);
/**
* fc_exch_resp() - Allocate a new exchange for a response frame
@@ -2654,9 +2655,6 @@ int fc_exch_init(struct fc_lport *lport)
if (!lport->tt.seq_set_resp)
lport->tt.seq_set_resp = fc_seq_set_resp;
- if (!lport->tt.exch_done)
- lport->tt.exch_done = fc_exch_done;
-
if (!lport->tt.exch_mgr_reset)
lport->tt.exch_mgr_reset = fc_exch_mgr_reset;
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 2bb3f9f..4fadd62 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -311,7 +311,7 @@ static int fc_fcp_send_abort(struct fc_fcp_pkt *fsp)
static void fc_fcp_retry_cmd(struct fc_fcp_pkt *fsp, int status_code)
{
if (fsp->seq_ptr) {
- fsp->lp->tt.exch_done(fsp->seq_ptr);
+ fc_exch_done(fsp->seq_ptr);
fsp->seq_ptr = NULL;
}
@@ -1036,7 +1036,7 @@ static void fc_fcp_complete_locked(struct fc_fcp_pkt *fsp)
fc_seq_send(lport, csp, conf_frame);
}
}
- lport->tt.exch_done(seq);
+ fc_exch_done(seq);
}
/*
* Some resets driven by SCSI are not I/Os and do not have
@@ -1054,10 +1054,8 @@ static void fc_fcp_complete_locked(struct fc_fcp_pkt *fsp)
*/
static void fc_fcp_cleanup_cmd(struct fc_fcp_pkt *fsp, int error)
{
- struct fc_lport *lport = fsp->lp;
-
if (fsp->seq_ptr) {
- lport->tt.exch_done(fsp->seq_ptr);
+ fc_exch_done(fsp->seq_ptr);
fsp->seq_ptr = NULL;
}
fsp->status_code = error;
@@ -1349,7 +1347,7 @@ static int fc_lun_reset(struct fc_lport *lport, struct fc_fcp_pkt *fsp,
spin_lock_bh(&fsp->scsi_pkt_lock);
if (fsp->seq_ptr) {
- lport->tt.exch_done(fsp->seq_ptr);
+ fc_exch_done(fsp->seq_ptr);
fsp->seq_ptr = NULL;
}
fsp->wait_for_comp = 0;
@@ -1403,7 +1401,7 @@ static void fc_tm_done(struct fc_seq *seq, struct fc_frame *fp, void *arg)
if (fh->fh_type != FC_TYPE_BLS)
fc_fcp_resp(fsp, fp);
fsp->seq_ptr = NULL;
- fsp->lp->tt.exch_done(seq);
+ fc_exch_done(seq);
out_unlock:
fc_fcp_unlock_pkt(fsp);
out:
@@ -1793,9 +1791,9 @@ static void fc_fcp_srr_resp(struct fc_seq *seq, struct fc_frame *fp, void *arg)
fh = fc_frame_header_get(fp);
/*
- * BUG? fc_fcp_srr_error calls exch_done which would release
+ * BUG? fc_fcp_srr_error calls fc_exch_done which would release
* the ep. But if fc_fcp_srr_error had got -FC_EX_TIMEOUT,
- * then fc_exch_timeout would be sending an abort. The exch_done
+ * then fc_exch_timeout would be sending an abort. The fc_exch_done
* call by fc_fcp_srr_error would prevent fc_exch.c from seeing
* an abort response though.
*/
@@ -1816,7 +1814,7 @@ static void fc_fcp_srr_resp(struct fc_seq *seq, struct fc_frame *fp, void *arg)
}
fc_fcp_unlock_pkt(fsp);
out:
- fsp->lp->tt.exch_done(seq);
+ fc_exch_done(seq);
fc_frame_free(fp);
}
@@ -1846,7 +1844,7 @@ static void fc_fcp_srr_error(struct fc_fcp_pkt *fsp, struct fc_frame *fp)
}
fc_fcp_unlock_pkt(fsp);
out:
- fsp->lp->tt.exch_done(fsp->recov_seq);
+ fc_exch_done(fsp->recov_seq);
}
/**
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index 7315675..2d3133f 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -980,7 +980,7 @@ void fc_lport_recv(struct fc_lport *lport, struct fc_frame *fp)
FC_LPORT_DBG(lport, "dropping unexpected frame type %x\n", fh->fh_type);
fc_frame_free(fp);
if (sp)
- lport->tt.exch_done(sp);
+ fc_exch_done(sp);
}
EXPORT_SYMBOL(fc_lport_recv);
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index 7dc0eb7..07d392b 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -177,7 +177,7 @@ int ft_queue_status(struct se_cmd *se_cmd)
se_cmd->scsi_status = SAM_STAT_TASK_SET_FULL;
return -ENOMEM;
}
- lport->tt.exch_done(cmd->seq);
+ fc_exch_done(cmd->seq);
/*
* Drop the extra ACK_KREF reference taken by target_submit_cmd()
* ahead of ft_check_stop_free() -> transport_generic_free_cmd()
@@ -324,7 +324,7 @@ static void ft_send_resp_status(struct fc_lport *lport,
sp = fr_seq(fp);
if (sp) {
fc_seq_send(lport, sp, fp);
- lport->tt.exch_done(sp);
+ fc_exch_done(sp);
} else {
lport->tt.frame_send(lport, fp);
}
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 50d1af1..19f38eb 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -515,14 +515,6 @@ struct libfc_function_template {
void (*get_lesb)(struct fc_lport *, struct fc_els_lesb *lesb);
/*
- * Indicate that an exchange/sequence tuple is complete and the memory
- * allocated for the related objects may be freed.
- *
- * STATUS: OPTIONAL
- */
- void (*exch_done)(struct fc_seq *);
-
- /*
* Start a new sequence on the same exchange/sequence tuple.
*
* STATUS: OPTIONAL
@@ -1040,6 +1032,7 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *, enum fc_class class,
void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id);
int fc_seq_send(struct fc_lport *lport, struct fc_seq *sp, struct fc_frame *fp);
int fc_seq_exch_abort(const struct fc_seq *, unsigned int timer_msec);
+void fc_exch_done(struct fc_seq *sp);
/*
* Functions for fc_functions_template
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 16/20] libfc: Replace ->exch_done callback with function call
2016-10-18 8:01 ` [PATCH 16/20] libfc: Replace ->exch_done " Hannes Reinecke
@ 2016-10-18 9:03 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 9:03 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:50AM +0200, Hannes Reinecke wrote:
> The ->exch_done callback only ever had one implementation,
> so we can as well call it directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 17/20] libfc: Replace ->seq_start_next callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (15 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 16/20] libfc: Replace ->exch_done " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 9:04 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 18/20] libfc: Replace ->seq_set_resp callback with direct " Hannes Reinecke
` (4 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->seq_start_next callback only ever had one implementation,
so call the function directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/libfc/fc_exch.c | 6 ++----
drivers/scsi/libfc/fc_fcp.c | 4 ++--
drivers/scsi/libfc/fc_libfc.c | 2 +-
drivers/target/tcm_fc/tfc_cmd.c | 4 ++--
drivers/target/tcm_fc/tfc_io.c | 2 +-
include/scsi/libfc.h | 8 +-------
6 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index b98ad3f..8a99f84 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -585,7 +585,7 @@ static struct fc_seq *fc_seq_start_next_locked(struct fc_seq *sp)
* for a given sequence/exchange pair
* @sp: The sequence/exchange to get a new exchange for
*/
-static struct fc_seq *fc_seq_start_next(struct fc_seq *sp)
+struct fc_seq *fc_seq_start_next(struct fc_seq *sp)
{
struct fc_exch *ep = fc_seq_exch(sp);
@@ -595,6 +595,7 @@ static struct fc_seq *fc_seq_start_next(struct fc_seq *sp)
return sp;
}
+EXPORT_SYMBOL(fc_seq_start_next);
/*
* Set the response handler for the exchange associated with a sequence.
@@ -2649,9 +2650,6 @@ void fc_exch_recv(struct fc_lport *lport, struct fc_frame *fp)
*/
int fc_exch_init(struct fc_lport *lport)
{
- if (!lport->tt.seq_start_next)
- lport->tt.seq_start_next = fc_seq_start_next;
-
if (!lport->tt.seq_set_resp)
lport->tt.seq_set_resp = fc_seq_set_resp;
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 4fadd62..0e67621 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -653,7 +653,7 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq,
remaining = seq_blen;
fh_parm_offset = frame_offset = offset;
tlen = 0;
- seq = lport->tt.seq_start_next(seq);
+ seq = fc_seq_start_next(seq);
f_ctl = FC_FC_REL_OFF;
WARN_ON(!seq);
@@ -1024,7 +1024,7 @@ static void fc_fcp_complete_locked(struct fc_fcp_pkt *fsp)
struct fc_frame *conf_frame;
struct fc_seq *csp;
- csp = lport->tt.seq_start_next(seq);
+ csp = fc_seq_start_next(seq);
conf_frame = fc_fcp_frame_alloc(fsp->lp, 0);
if (conf_frame) {
f_ctl = FC_FC_SEQ_INIT;
diff --git a/drivers/scsi/libfc/fc_libfc.c b/drivers/scsi/libfc/fc_libfc.c
index c11a638..d623d08 100644
--- a/drivers/scsi/libfc/fc_libfc.c
+++ b/drivers/scsi/libfc/fc_libfc.c
@@ -226,7 +226,7 @@ void fc_fill_reply_hdr(struct fc_frame *fp, const struct fc_frame *in_fp,
sp = fr_seq(in_fp);
if (sp)
- fr_seq(fp) = fr_dev(in_fp)->tt.seq_start_next(sp);
+ fr_seq(fp) = fc_seq_start_next(sp);
fc_fill_hdr(fp, in_fp, r_ctl, FC_FCTL_RESP, 0, parm_offset);
}
EXPORT_SYMBOL(fc_fill_reply_hdr);
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index 07d392b..bf6ab3f 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -161,7 +161,7 @@ int ft_queue_status(struct se_cmd *se_cmd)
/*
* Send response.
*/
- cmd->seq = lport->tt.seq_start_next(cmd->seq);
+ cmd->seq = fc_seq_start_next(cmd->seq);
fc_fill_fc_hdr(fp, FC_RCTL_DD_CMD_STATUS, ep->did, ep->sid, FC_TYPE_FCP,
FC_FC_EX_CTX | FC_FC_LAST_SEQ | FC_FC_END_SEQ, 0);
@@ -221,7 +221,7 @@ int ft_write_pending(struct se_cmd *se_cmd)
memset(txrdy, 0, sizeof(*txrdy));
txrdy->ft_burst_len = htonl(se_cmd->data_length);
- cmd->seq = lport->tt.seq_start_next(cmd->seq);
+ cmd->seq = fc_seq_start_next(cmd->seq);
fc_fill_fc_hdr(fp, FC_RCTL_DD_DATA_DESC, ep->did, ep->sid, FC_TYPE_FCP,
FC_FC_EX_CTX | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0);
diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c
index b10ebfd..1eb1f58 100644
--- a/drivers/target/tcm_fc/tfc_io.c
+++ b/drivers/target/tcm_fc/tfc_io.c
@@ -82,7 +82,7 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
ep = fc_seq_exch(cmd->seq);
lport = ep->lp;
- cmd->seq = lport->tt.seq_start_next(cmd->seq);
+ cmd->seq = fc_seq_start_next(cmd->seq);
remaining = se_cmd->data_length;
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 19f38eb..39143ca 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -515,13 +515,6 @@ struct libfc_function_template {
void (*get_lesb)(struct fc_lport *, struct fc_els_lesb *lesb);
/*
- * Start a new sequence on the same exchange/sequence tuple.
- *
- * STATUS: OPTIONAL
- */
- struct fc_seq *(*seq_start_next)(struct fc_seq *);
-
- /*
* Set a response handler for the exchange of the sequence.
*
* STATUS: OPTIONAL
@@ -1019,6 +1012,7 @@ struct fc_seq *fc_exch_seq_send(struct fc_lport *lport,
void *arg, u32 timer_msec);
void fc_seq_els_rsp_send(struct fc_frame *, enum fc_els_cmd,
struct fc_seq_els_data *);
+struct fc_seq *fc_seq_start_next(struct fc_seq *sp);
struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *,
struct fc_exch_mgr *,
bool (*match)(struct fc_frame *));
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 17/20] libfc: Replace ->seq_start_next callback with function call
2016-10-18 8:01 ` [PATCH 17/20] libfc: Replace ->seq_start_next " Hannes Reinecke
@ 2016-10-18 9:04 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 9:04 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:51AM +0200, Hannes Reinecke wrote:
> The ->seq_start_next callback only ever had one implementation,
> so call the function directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 18/20] libfc: Replace ->seq_set_resp callback with direct function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (16 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 17/20] libfc: Replace ->seq_start_next " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 9:04 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 19/20] libfc: Replace ->seq_assign callback with " Hannes Reinecke
` (3 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->seq_set_resp callback only ever had one implementation,
so call it directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/libfc/fc_exch.c | 11 ++++-------
drivers/target/tcm_fc/tfc_cmd.c | 2 +-
include/scsi/libfc.h | 13 +++----------
3 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index 8a99f84..ceeccd7 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -602,10 +602,9 @@ struct fc_seq *fc_seq_start_next(struct fc_seq *sp)
*
* Note: May sleep if invoked from outside a response handler.
*/
-static void fc_seq_set_resp(struct fc_seq *sp,
- void (*resp)(struct fc_seq *, struct fc_frame *,
- void *),
- void *arg)
+void fc_seq_set_resp(struct fc_seq *sp,
+ void (*resp)(struct fc_seq *, struct fc_frame *, void *),
+ void *arg)
{
struct fc_exch *ep = fc_seq_exch(sp);
DEFINE_WAIT(wait);
@@ -624,6 +623,7 @@ static void fc_seq_set_resp(struct fc_seq *sp,
ep->arg = arg;
spin_unlock_bh(&ep->ex_lock);
}
+EXPORT_SYMBOL(fc_seq_set_resp);
/**
* fc_exch_abort_locked() - Abort an exchange
@@ -2650,9 +2650,6 @@ void fc_exch_recv(struct fc_lport *lport, struct fc_frame *fp)
*/
int fc_exch_init(struct fc_lport *lport)
{
- if (!lport->tt.seq_set_resp)
- lport->tt.seq_set_resp = fc_seq_set_resp;
-
if (!lport->tt.exch_mgr_reset)
lport->tt.exch_mgr_reset = fc_exch_mgr_reset;
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index bf6ab3f..6029b90 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -563,7 +563,7 @@ static void ft_send_work(struct work_struct *work)
task_attr = TCM_SIMPLE_TAG;
}
- fc_seq_exch(cmd->seq)->lp->tt.seq_set_resp(cmd->seq, ft_recv_seq, cmd);
+ fc_seq_set_resp(cmd->seq, ft_recv_seq, cmd);
cmd->se_cmd.tag = fc_seq_exch(cmd->seq)->rxid;
/*
* Use a single se_cmd->cmd_kref as we expect to release se_cmd
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 39143ca..e8669f9 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -515,16 +515,6 @@ struct libfc_function_template {
void (*get_lesb)(struct fc_lport *, struct fc_els_lesb *lesb);
/*
- * Set a response handler for the exchange of the sequence.
- *
- * STATUS: OPTIONAL
- */
- void (*seq_set_resp)(struct fc_seq *sp,
- void (*resp)(struct fc_seq *, struct fc_frame *,
- void *),
- void *arg);
-
- /*
* Assign a sequence for an incoming request frame.
*
* STATUS: OPTIONAL
@@ -1013,6 +1003,9 @@ struct fc_seq *fc_exch_seq_send(struct fc_lport *lport,
void fc_seq_els_rsp_send(struct fc_frame *, enum fc_els_cmd,
struct fc_seq_els_data *);
struct fc_seq *fc_seq_start_next(struct fc_seq *sp);
+void fc_seq_set_resp(struct fc_seq *sp,
+ void (*resp)(struct fc_seq *, struct fc_frame *, void *),
+ void *arg);
struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *,
struct fc_exch_mgr *,
bool (*match)(struct fc_frame *));
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 18/20] libfc: Replace ->seq_set_resp callback with direct function call
2016-10-18 8:01 ` [PATCH 18/20] libfc: Replace ->seq_set_resp callback with direct " Hannes Reinecke
@ 2016-10-18 9:04 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 9:04 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:52AM +0200, Hannes Reinecke wrote:
> The ->seq_set_resp callback only ever had one implementation,
> so call it directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 19/20] libfc: Replace ->seq_assign callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (17 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 18/20] libfc: Replace ->seq_set_resp callback with direct " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 9:05 ` Johannes Thumshirn
2016-10-18 8:01 ` [PATCH 20/20] libfc: Replace ->seq_release " Hannes Reinecke
` (2 subsequent siblings)
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->seq_assign callback only ever had one implementation,
so call the function directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/libfc/fc_exch.c | 6 ++----
drivers/target/tcm_fc/tfc_cmd.c | 2 +-
include/scsi/libfc.h | 8 +-------
3 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index ceeccd7..efb6a4b 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -1477,7 +1477,7 @@ static void fc_exch_recv_abts(struct fc_exch *ep, struct fc_frame *rx_fp)
* A reference will be held on the exchange/sequence for the caller, which
* must call fc_seq_release().
*/
-static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp)
+struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp)
{
struct fc_exch_mgr_anchor *ema;
@@ -1491,6 +1491,7 @@ static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp)
break;
return fr_seq(fp);
}
+EXPORT_SYMBOL(fc_seq_assign);
/**
* fc_seq_release() - Release the hold
@@ -2653,9 +2654,6 @@ int fc_exch_init(struct fc_lport *lport)
if (!lport->tt.exch_mgr_reset)
lport->tt.exch_mgr_reset = fc_exch_mgr_reset;
- if (!lport->tt.seq_assign)
- lport->tt.seq_assign = fc_seq_assign;
-
if (!lport->tt.seq_release)
lport->tt.seq_release = fc_seq_release;
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index 6029b90..e684862 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -461,7 +461,7 @@ static void ft_recv_cmd(struct ft_sess *sess, struct fc_frame *fp)
cmd->se_cmd.map_tag = tag;
cmd->sess = sess;
- cmd->seq = lport->tt.seq_assign(lport, fp);
+ cmd->seq = fc_seq_assign(lport, fp);
if (!cmd->seq) {
percpu_ida_free(&se_sess->sess_tag_pool, tag);
goto busy;
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index e8669f9..2baa255 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -515,13 +515,6 @@ struct libfc_function_template {
void (*get_lesb)(struct fc_lport *, struct fc_els_lesb *lesb);
/*
- * Assign a sequence for an incoming request frame.
- *
- * STATUS: OPTIONAL
- */
- struct fc_seq *(*seq_assign)(struct fc_lport *, struct fc_frame *);
-
- /*
* Release the reference on the sequence returned by seq_assign().
*
* STATUS: OPTIONAL
@@ -1006,6 +999,7 @@ void fc_seq_els_rsp_send(struct fc_frame *, enum fc_els_cmd,
void fc_seq_set_resp(struct fc_seq *sp,
void (*resp)(struct fc_seq *, struct fc_frame *, void *),
void *arg);
+struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp);
struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *,
struct fc_exch_mgr *,
bool (*match)(struct fc_frame *));
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 19/20] libfc: Replace ->seq_assign callback with function call
2016-10-18 8:01 ` [PATCH 19/20] libfc: Replace ->seq_assign callback with " Hannes Reinecke
@ 2016-10-18 9:05 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 9:05 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:53AM +0200, Hannes Reinecke wrote:
> The ->seq_assign callback only ever had one implementation,
> so call the function directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* [PATCH 20/20] libfc: Replace ->seq_release callback with function call
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (18 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 19/20] libfc: Replace ->seq_assign callback with " Hannes Reinecke
@ 2016-10-18 8:01 ` Hannes Reinecke
2016-10-18 9:07 ` Johannes Thumshirn
2016-10-19 12:49 ` [PATCH 00/20] libfc callback cleanup Chad Dupuis
2016-10-25 0:37 ` Martin K. Petersen
21 siblings, 1 reply; 50+ messages in thread
From: Hannes Reinecke @ 2016-10-18 8:01 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Johannes Thumshirn, Christoph Hellwig, Bart van Assche,
James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke
The ->seq_release callback only ever had one implementation,
so call the function directly and drop the callback.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/libfc/fc_exch.c | 6 ++----
drivers/target/tcm_fc/tfc_cmd.c | 2 +-
include/scsi/libfc.h | 8 +-------
3 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c
index efb6a4b..442a6c1 100644
--- a/drivers/scsi/libfc/fc_exch.c
+++ b/drivers/scsi/libfc/fc_exch.c
@@ -1497,10 +1497,11 @@ struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp)
* fc_seq_release() - Release the hold
* @sp: The sequence.
*/
-static void fc_seq_release(struct fc_seq *sp)
+void fc_seq_release(struct fc_seq *sp)
{
fc_exch_release(fc_seq_exch(sp));
}
+EXPORT_SYMBOL(fc_seq_release);
/**
* fc_exch_recv_req() - Handler for an incoming request
@@ -2654,9 +2655,6 @@ int fc_exch_init(struct fc_lport *lport)
if (!lport->tt.exch_mgr_reset)
lport->tt.exch_mgr_reset = fc_exch_mgr_reset;
- if (!lport->tt.seq_release)
- lport->tt.seq_release = fc_seq_release;
-
return 0;
}
EXPORT_SYMBOL(fc_exch_init);
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index e684862..2581fff 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -92,7 +92,7 @@ static void ft_free_cmd(struct ft_cmd *cmd)
fp = cmd->req_frame;
lport = fr_dev(fp);
if (fr_seq(fp))
- lport->tt.seq_release(fr_seq(fp));
+ fc_seq_release(fr_seq(fp));
fc_frame_free(fp);
percpu_ida_free(&sess->se_sess->sess_tag_pool, cmd->se_cmd.map_tag);
ft_sess_put(sess); /* undo get from lookup at recv */
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 2baa255..6f81b28 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -515,13 +515,6 @@ struct libfc_function_template {
void (*get_lesb)(struct fc_lport *, struct fc_els_lesb *lesb);
/*
- * Release the reference on the sequence returned by seq_assign().
- *
- * STATUS: OPTIONAL
- */
- void (*seq_release)(struct fc_seq *);
-
- /*
* Reset an exchange manager, completing all sequences and exchanges.
* If s_id is non-zero, reset only exchanges originating from that FID.
* If d_id is non-zero, reset only exchanges sending to that FID.
@@ -1000,6 +993,7 @@ void fc_seq_set_resp(struct fc_seq *sp,
void (*resp)(struct fc_seq *, struct fc_frame *, void *),
void *arg);
struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp);
+void fc_seq_release(struct fc_seq *sp);
struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *,
struct fc_exch_mgr *,
bool (*match)(struct fc_frame *));
--
1.8.5.6
^ permalink raw reply related [flat|nested] 50+ messages in thread* Re: [PATCH 20/20] libfc: Replace ->seq_release callback with function call
2016-10-18 8:01 ` [PATCH 20/20] libfc: Replace ->seq_release " Hannes Reinecke
@ 2016-10-18 9:07 ` Johannes Thumshirn
0 siblings, 0 replies; 50+ messages in thread
From: Johannes Thumshirn @ 2016-10-18 9:07 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi, Hannes Reinecke
On Tue, Oct 18, 2016 at 10:01:54AM +0200, Hannes Reinecke wrote:
> The ->seq_release callback only ever had one implementation,
> so call the function directly and drop the callback.
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
Looks good,
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: [PATCH 00/20] libfc callback cleanup
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (19 preceding siblings ...)
2016-10-18 8:01 ` [PATCH 20/20] libfc: Replace ->seq_release " Hannes Reinecke
@ 2016-10-19 12:49 ` Chad Dupuis
2016-10-25 0:37 ` Martin K. Petersen
21 siblings, 0 replies; 50+ messages in thread
From: Chad Dupuis @ 2016-10-19 12:49 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi
On Tue, 18 Oct 2016, 8:01am -0000, Hannes Reinecke wrote:
> Hi all,
>
> it has been bugging me for a while that libfc has tons of callbacks
> in an attempt to abstract things away. But as it turned out
> no-one ever used those, rendering them quite pointless.
> As I got some time to kill on the train back from Vienna I've decided
> to finally kill them and call the functions directly.
>
> As usual, comments and reviews are welcome.
>
> Hannes Reinecke (20):
> libfc: Replace ->seq_els_rsp_send callback with function call
> libfc: Replace ->lport_reset callback with function call
> libfc: Replace ->lport_recv with function call
> libfc: Replace ->exch_seq_send callback with function call
> libfc: Replace ->rport_destroy callback with function call
> libfc: Replace ->rport_lookup callback with function call
> scsi_transport_fc: rename 'fc_rport_create' to 'fc_remote_port_create'
> libfc: Replace ->rport_create callback with function call
> libfc: Replace ->rport_login callback with function call
> libfc: Replace ->rport_logoff callback with function call
> libfc: Replace ->rport_recv_req callback with function call
> libfc: Replace ->rport_flush_queue callback with function call
> libfc: Remove fc_rport_init()
> libfc: Replace ->seq_send callback with function call
> libfc: Replace ->seq_exch_abort callback with function call
> libfc: Replace ->exch_done callback with function call
> libfc: Replace ->seq_start_next callback with function call
> libfc: Replace ->seq_set_resp callback with direct function call
> libfc: Replace ->seq_assign callback with function call
> libfc: Replace ->seq_release callback with function call
>
> drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 1 -
> drivers/scsi/bnx2fc/bnx2fc_tgt.c | 3 +-
> drivers/scsi/fcoe/fcoe_ctlr.c | 35 ++++---
> drivers/scsi/fnic/fnic_scsi.c | 2 +-
> drivers/scsi/libfc/fc_disc.c | 33 ++++---
> drivers/scsi/libfc/fc_elsct.c | 2 +-
> drivers/scsi/libfc/fc_exch.c | 104 ++++++++++----------
> drivers/scsi/libfc/fc_fcp.c | 45 ++++-----
> drivers/scsi/libfc/fc_libfc.c | 2 +-
> drivers/scsi/libfc/fc_lport.c | 62 ++++++------
> drivers/scsi/libfc/fc_rport.c | 167 ++++++++++++++------------------
> drivers/scsi/scsi_transport_fc.c | 8 +-
> drivers/target/tcm_fc/tfc_cmd.c | 20 ++--
> drivers/target/tcm_fc/tfc_io.c | 4 +-
> include/scsi/libfc.h | 195 ++++++--------------------------------
> 15 files changed, 254 insertions(+), 429 deletions(-)
>
Hannes, thanks for doing this. Should make the code much more readable.
^ permalink raw reply [flat|nested] 50+ messages in thread* Re: [PATCH 00/20] libfc callback cleanup
2016-10-18 8:01 [PATCH 00/20] libfc callback cleanup Hannes Reinecke
` (20 preceding siblings ...)
2016-10-19 12:49 ` [PATCH 00/20] libfc callback cleanup Chad Dupuis
@ 2016-10-25 0:37 ` Martin K. Petersen
21 siblings, 0 replies; 50+ messages in thread
From: Martin K. Petersen @ 2016-10-25 0:37 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Martin K. Petersen, Johannes Thumshirn, Christoph Hellwig,
Bart van Assche, James Bottomley, linux-scsi
>>>>> "Hannes" == Hannes Reinecke <hare@suse.de> writes:
Hannes> Hi all, it has been bugging me for a while that libfc has tons
Hannes> of callbacks in an attempt to abstract things away. But as it
Hannes> turned out no-one ever used those, rendering them quite
Hannes> pointless. As I got some time to kill on the train back from
Hannes> Vienna I've decided to finally kill them and call the functions
Hannes> directly.
Applied to 4.10/scsi-queue.
Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 50+ messages in thread