Skip to content

Fpin v10#9

Closed
johnmeneghini wants to merge 18 commits intofpin_v8from
fpin_v10
Closed

Fpin v10#9
johnmeneghini wants to merge 18 commits intofpin_v8from
fpin_v10

Conversation

@johnmeneghini
Copy link
Owner

Compare branches

Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Refactor the nvme_fc_fpin_li_lport_update function and
provide an API to clear the NVME_CTRL_MARGINAL flag.

Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Added new nvme_fc_fpin_set_state() function
Replaced duplicated code with function calls
Removed unused attached_rport variable
Added EXPORT_SYMBOL_GPL() for global availability
   include/linux/nvme-fc-driver.h:
Added forward declaration for struct nvme_fc_lport
Added function declaration for nvme_fc_fpin_set_state()

Signed-off-by: John Meneghini <jmeneghi@redhat.com>
We don't want to set the state on the attached_wwpn

Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Summary of Changes

1. Modified fc_rport_set_marginal_state Function
File: drivers/scsi/scsi_transport_fc.c
Added calls to nvme_fc_fpin_set_state() when FC port state changes
When FC_PORTSTATE_ONLINE → FC_PORTSTATE_MARGINAL: calls with marginal = true
When FC_PORTSTATE_MARGINAL → FC_PORTSTATE_ONLINE: calls with marginal = false
All calls properly bracketed with #if (IS_ENABLED(CONFIG_NVME_FC))
Added required include: #include <linux/nvme-fc-driver.h>

2. Created Helper Function nvme_fc_lport_from_wwpn
File: drivers/nvme/host/fc.c
struct nvme_fc_lport *nvme_fc_lport_from_wwpn(u64 wwpn)
Searches global nvme_fc_lport_list for matching WWPN
Returns lport with incremented reference count (caller must call nvme_fc_lport_put())
Thread-safe with proper spinlock protection
Exported with EXPORT_SYMBOL_GPL()

3. Enhanced nvme_fc_fpin_set_state Function
File: drivers/nvme/host/fc.c
Now supports both setting (marginal = true) and clearing (marginal = false) the NVME_CTRL_MARGINAL bit
Uses set_bit() when marginal = true
Uses clear_bit() when marginal = false
Exported with EXPORT_SYMBOL_GPL()

4. Exported nvme_fc_lport_put Function
File: drivers/nvme/host/fc.c
Made the previously static function available to external callers
Added EXPORT_SYMBOL_GPL(nvme_fc_lport_put)
Enables proper reference count management from SCSI transport layer

5. Added Function Declarations
File: include/linux/nvme-fc-driver.h
struct nvme_fc_lport;
struct nvme_fc_lport *nvme_fc_lport_from_wwpn(u64 wwpn);
void nvme_fc_lport_put(struct nvme_fc_lport *lport);
void nvme_fc_fpin_set_state(struct nvme_fc_lport *lport, u64 wwpn, bool marginal);

Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Add the files:

   fc_portstate_marginal_call_graph.md
   lpfc_nvme_info_show_call_graph.md

Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
This function automatically sets FC_PORTSTATE_MARGINAL state on remote
ports based on FPIN ELS message.

Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Set the FC_PORTSTATE_MARGINAL state on all remote rports
when an FPIN ELS message is received.

Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant