Skip to content

Commit 6335be1

Browse files
Karan Tilak Kumarmartinkpetersen
authored andcommitted
scsi: fnic: Modify IO path to use FDLS
Modify IO path to use FDLS. Add helper functions to process IOs. Remove unused template functions. Clean up obsolete code. Refactor old function definitions. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202410210147.fQp7tYeb-lkp@intel.com/ Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com> Reviewed-by: Gian Carlo Boffa <gcboffa@cisco.com> Reviewed-by: Arun Easi <aeasi@cisco.com> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com> Link: https://lore.kernel.org/r/20241212020312.4786-11-kartilak@cisco.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 9cf9fe2 commit 6335be1

File tree

5 files changed

+504
-369
lines changed

5 files changed

+504
-369
lines changed

drivers/scsi/fnic/fnic.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@ int fnic_set_intr_mode_msix(struct fnic *fnic);
479479
void fnic_free_intr(struct fnic *fnic);
480480
int fnic_request_intr(struct fnic *fnic);
481481

482-
int fnic_send(struct fc_lport *, struct fc_frame *);
483482
void fnic_free_wq_buf(struct vnic_wq *wq, struct vnic_wq_buf *buf);
484483
void fnic_handle_frame(struct work_struct *work);
485484
void fnic_tport_event_handler(struct work_struct *work);
@@ -499,11 +498,9 @@ int fnic_abort_cmd(struct scsi_cmnd *);
499498
int fnic_device_reset(struct scsi_cmnd *);
500499
int fnic_eh_host_reset_handler(struct scsi_cmnd *sc);
501500
int fnic_host_reset(struct Scsi_Host *shost);
502-
int fnic_reset(struct Scsi_Host *);
503-
void fnic_scsi_cleanup(struct fc_lport *);
504-
void fnic_scsi_abort_io(struct fc_lport *);
505-
void fnic_empty_scsi_cleanup(struct fc_lport *);
506-
void fnic_exch_mgr_reset(struct fc_lport *, u32, u32);
501+
void fnic_reset(struct Scsi_Host *shost);
502+
int fnic_issue_fc_host_lip(struct Scsi_Host *shost);
503+
void fnic_scsi_fcpio_reset(struct fnic *fnic);
507504
int fnic_wq_copy_cmpl_handler(struct fnic *fnic, int copy_work_to_do, unsigned int cq_index);
508505
int fnic_wq_cmpl_handler(struct fnic *fnic, int);
509506
int fnic_flogi_reg_handler(struct fnic *fnic, u32);
@@ -515,7 +512,8 @@ const char *fnic_state_to_str(unsigned int state);
515512
void fnic_mq_map_queues_cpus(struct Scsi_Host *host);
516513
void fnic_log_q_error(struct fnic *fnic);
517514
void fnic_handle_link_event(struct fnic *fnic);
518-
515+
void fnic_stats_debugfs_init(struct fnic *fnic);
516+
void fnic_stats_debugfs_remove(struct fnic *fnic);
519517
int fnic_is_abts_pending(struct fnic *, struct scsi_cmnd *);
520518

521519
void fnic_handle_fip_frame(struct work_struct *work);
@@ -536,6 +534,13 @@ int fnic_get_desc_by_devid(struct pci_dev *pdev, char **desc,
536534
void fnic_fdls_link_status_change(struct fnic *fnic, int linkup);
537535
void fnic_delete_fcp_tports(struct fnic *fnic);
538536
void fnic_flush_tport_event_list(struct fnic *fnic);
537+
int fnic_count_ioreqs_wq(struct fnic *fnic, u32 hwq, u32 portid);
538+
unsigned int fnic_count_ioreqs(struct fnic *fnic, u32 portid);
539+
unsigned int fnic_count_all_ioreqs(struct fnic *fnic);
540+
unsigned int fnic_count_lun_ioreqs_wq(struct fnic *fnic, u32 hwq,
541+
struct scsi_device *device);
542+
unsigned int fnic_count_lun_ioreqs(struct fnic *fnic,
543+
struct scsi_device *device);
539544

540545
struct fnic_scsi_iter_data {
541546
struct fnic *fnic;

drivers/scsi/fnic/fnic_io.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#define _FNIC_IO_H_
88

99
#include <scsi/fc/fc_fcp.h>
10+
#include "fnic_fdls.h"
1011

1112
#define FNIC_DFLT_SG_DESC_CNT 32
1213
#define FNIC_MAX_SG_DESC_CNT 256 /* Maximum descriptors per sgl */
@@ -41,6 +42,8 @@ enum fnic_ioreq_state {
4142
};
4243

4344
struct fnic_io_req {
45+
struct fnic_iport_s *iport;
46+
struct fnic_tport_s *tport;
4447
struct host_sg_desc *sgl_list; /* sgl list */
4548
void *sgl_list_alloc; /* sgl list address used for free */
4649
dma_addr_t sense_buf_pa; /* dma address for sense buffer*/

drivers/scsi/fnic/fnic_main.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@ static unsigned int fnic_max_qdepth = FNIC_DFLT_QUEUE_DEPTH;
8585
module_param(fnic_max_qdepth, uint, S_IRUGO|S_IWUSR);
8686
MODULE_PARM_DESC(fnic_max_qdepth, "Queue depth to report for each LUN");
8787

88-
static struct libfc_function_template fnic_transport_template = {
89-
.fcp_abort_io = fnic_empty_scsi_cleanup,
90-
.fcp_cleanup = fnic_empty_scsi_cleanup,
91-
.exch_mgr_reset = fnic_exch_mgr_reset
92-
};
93-
9488
struct workqueue_struct *fnic_fip_queue;
9589

9690
static int fnic_slave_alloc(struct scsi_device *sdev)
@@ -163,7 +157,7 @@ static struct fc_function_template fnic_fc_functions = {
163157
.show_starget_port_id = 1,
164158
.show_rport_dev_loss_tmo = 1,
165159
.set_rport_dev_loss_tmo = fnic_set_rport_dev_loss_tmo,
166-
.issue_fc_host_lip = fnic_reset,
160+
.issue_fc_host_lip = fnic_issue_fc_host_lip,
167161
.get_fc_host_stats = fnic_get_stats,
168162
.reset_fc_host_stats = fnic_reset_host_stats,
169163
.dd_fcrport_size = sizeof(struct fc_rport_libfc_priv),
@@ -906,8 +900,6 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
906900
fc_set_wwnn(lp, fnic->config.node_wwn);
907901
fc_set_wwpn(lp, fnic->config.port_wwn);
908902

909-
fcoe_libfc_config(lp, &fnic->ctlr, &fnic_transport_template, 0);
910-
911903
if (!fc_exch_mgr_alloc(lp, FC_CLASS_3, FCPIO_HOST_EXCH_RANGE_START,
912904
FCPIO_HOST_EXCH_RANGE_END, NULL)) {
913905
err = -ENOMEM;

0 commit comments

Comments
 (0)