scsi: fnic: Pass pointers directly to several functions

In fdls_target_restart_nexus(), pass the struct fnic_iport_s pointer
directly from callers instead of deriving it from tport->iport. In
fnic_fdls_add_tport() and fnic_fdls_remove_tport(), pass the struct fnic
pointer directly instead of the struct fnic_iport_s pointer. This patch
prepares for enabling lock context analysis. No functionality has been
changed.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/8351d2f8c89a02fe537238d70d25d443375dca94.1790360262.git.bvanassche@acm.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
This commit is contained in:
Bart Van Assche 2026-09-25 11:26:03 -07:00 committed by Martin K. Petersen (Oracle)
parent f9581845d9
commit ac063a30e8
3 changed files with 17 additions and 20 deletions

View File

@ -87,7 +87,8 @@ static void fnic_fdls_start_flogi(struct fnic_iport_s *iport);
static struct fnic_tport_s *fdls_create_tport(struct fnic_iport_s *iport,
uint32_t fcid,
uint64_t wwpn);
static void fdls_target_restart_nexus(struct fnic_tport_s *tport);
static void fdls_target_restart_nexus(struct fnic_iport_s *iport,
struct fnic_tport_s *tport);
static void fdls_start_tport_timer(struct fnic_iport_s *iport,
struct fnic_tport_s *tport, int timeout);
static void fdls_tport_timer_callback(struct timer_list *t);
@ -1810,9 +1811,9 @@ static void fdls_tgt_discovery_start(struct fnic_iport_s *iport)
* safely since the memory it is
* pointing to it will be freed later
*/
static void fdls_target_restart_nexus(struct fnic_tport_s *tport)
static void fdls_target_restart_nexus(struct fnic_iport_s *iport,
struct fnic_tport_s *tport)
{
struct fnic_iport_s *iport = tport->iport;
struct fnic_tport_s *new_tport = NULL;
uint32_t fcid;
uint64_t wwpn;
@ -2767,7 +2768,7 @@ fdls_process_tgt_plogi_rsp(struct fnic_iport_s *iport,
if (tport->state != FDLS_TGT_STATE_PLOGI) {
FNIC_FCS_DBG(KERN_INFO, fnic,
"PLOGI rsp recvd in wrong state. Drop the frame and restart nexus");
fdls_target_restart_nexus(tport);
fdls_target_restart_nexus(iport, tport);
return;
}
@ -2893,7 +2894,7 @@ fdls_process_tgt_prli_rsp(struct fnic_iport_s *iport,
if (tport->state != FDLS_TGT_STATE_PRLI) {
FNIC_FCS_DBG(KERN_INFO, fnic,
"PRLI rsp recvd in wrong state. Drop frame. Restarting nexus");
fdls_target_restart_nexus(tport);
fdls_target_restart_nexus(iport, tport);
return;
}

View File

@ -942,10 +942,9 @@ void fnic_free_wq_buf(struct vnic_wq *wq, struct vnic_wq_buf *buf)
}
void
fnic_fdls_add_tport(struct fnic_iport_s *iport, struct fnic_tport_s *tport,
unsigned long flags)
fnic_fdls_add_tport(struct fnic *fnic, struct fnic_tport_s *tport,
unsigned long flags)
{
struct fnic *fnic = iport->fnic;
struct fc_rport *rport;
struct fc_rport_identifiers ids;
struct rport_dd_data_s *rdd_data;
@ -975,18 +974,16 @@ fnic_fdls_add_tport(struct fnic_iport_s *iport, struct fnic_tport_s *tport,
rport->supported_classes = FC_COS_CLASS3 | FC_RPORT_ROLE_FCP_TARGET;
rdd_data = rport->dd_data;
rdd_data->tport = tport;
rdd_data->iport = iport;
rdd_data->iport = &fnic->iport;
tport->rport = rport;
tport->flags |= FNIC_FDLS_SCSI_REGISTERED;
}
void
fnic_fdls_remove_tport(struct fnic_iport_s *iport,
struct fnic_tport_s *tport, unsigned long flags)
fnic_fdls_remove_tport(struct fnic *fnic, struct fnic_tport_s *tport,
unsigned long flags)
{
struct fnic *fnic = iport->fnic;
struct rport_dd_data_s *rdd_data;
struct fc_rport *rport;
if (!tport)
@ -1038,7 +1035,7 @@ void fnic_delete_fcp_tports(struct fnic *fnic)
fdls_set_tport_state(tport, FDLS_TGT_STATE_OFFLINING);
fnic_del_tport_timer_sync(fnic, tport);
if (IS_FNIC_FCP_INITIATOR(fnic))
fnic_fdls_remove_tport(&fnic->iport, tport, flags);
fnic_fdls_remove_tport(fnic, tport, flags);
else if (IS_FNIC_NVME_INITIATOR(fnic))
nvfnic_delete_tport(&fnic->iport, tport, flags);
}
@ -1067,7 +1064,7 @@ void fnic_tport_event_handler(struct work_struct *work)
"Add rport event");
if (tport->state == FDLS_TGT_STATE_READY) {
if (IS_FNIC_FCP_INITIATOR(fnic))
fnic_fdls_add_tport(&fnic->iport, tport, flags);
fnic_fdls_add_tport(fnic, tport, flags);
else if (IS_FNIC_NVME_INITIATOR(fnic))
nvfnic_add_tport(fnic, tport, flags);
} else {
@ -1081,7 +1078,7 @@ void fnic_tport_event_handler(struct work_struct *work)
"Remove rport event");
if (tport->state == FDLS_TGT_STATE_OFFLINING) {
if (IS_FNIC_FCP_INITIATOR(fnic))
fnic_fdls_remove_tport(&fnic->iport, tport, flags);
fnic_fdls_remove_tport(fnic, tport, flags);
else if (IS_FNIC_NVME_INITIATOR(fnic))
nvfnic_delete_tport(&fnic->iport, tport, flags);
} else {

View File

@ -433,10 +433,9 @@ int fnic_send_fip_frame(struct fnic_iport_s *iport,
void *frame, int frame_size);
void fnic_fdls_learn_fcoe_macs(struct fnic_iport_s *iport, void *rx_frame,
uint8_t *fcid);
void fnic_fdls_add_tport(struct fnic_iport_s *iport,
struct fnic_tport_s *tport, unsigned long flags);
void fnic_fdls_remove_tport(struct fnic_iport_s *iport,
struct fnic_tport_s *tport,
void fnic_fdls_add_tport(struct fnic *fnic, struct fnic_tport_s *tport,
unsigned long flags);
void fnic_fdls_remove_tport(struct fnic *fnic, struct fnic_tport_s *tport,
unsigned long flags);
void fnic_fcpio_reset(struct fnic *fnic);