git: 30dfb85abb17 - stable/12 - ocs_fc: Ignore flogi failure when the remote node is pt2pt winner

From: Ram Kishore Vegesna <ram_at_FreeBSD.org>
Date: Mon, 07 Mar 2022 11:00:41 UTC
The branch stable/12 has been updated by ram:

URL: https://cgit.FreeBSD.org/src/commit/?id=30dfb85abb17cf06a62499183b346cfc1d8d8f55

commit 30dfb85abb17cf06a62499183b346cfc1d8d8f55
Author:     Ram Kishore Vegesna <ram@FreeBSD.org>
AuthorDate: 2022-03-04 14:40:32 +0000
Commit:     Ram Kishore Vegesna <ram@FreeBSD.org>
CommitDate: 2022-03-07 10:52:52 +0000

    ocs_fc: Ignore flogi failure when the remote node is pt2pt winner
    
    Updated commit 79c56c9af583, do not proceed with discovery
    if flogi fails in pt2pt winner case.
    
    MFC after: 3 days
    
    (cherry picked from commit 625a8bfb047a94459b4ab41f08fe5a2c23694039)
---
 sys/dev/ocs_fc/ocs_fabric.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/sys/dev/ocs_fc/ocs_fabric.c b/sys/dev/ocs_fc/ocs_fabric.c
index 015d6bde8b3f..0d6e91f2ffd6 100644
--- a/sys/dev/ocs_fc/ocs_fabric.c
+++ b/sys/dev/ocs_fc/ocs_fabric.c
@@ -231,18 +231,14 @@ __ocs_fabric_flogi_wait_rsp(ocs_sm_ctx_t *ctx, ocs_sm_event_t evt, void *arg)
 		}
 		ocs_assert(node->els_req_cnt, NULL);
 		node->els_req_cnt--;
-		if (node->sport->domain->attached) {
-			node_printf(node, "FLOGI failed, Domain already attached\n");
-			if (node->sport->p2p_winner) {
-				node_printf(node, "p2p winner, domain already attached\n");
-				ocs_node_post_event(node, OCS_EVT_DOMAIN_ATTACH_OK, NULL);
-			} else {
-				node_printf(node, "peer p2p winner, shutdown node\n");
-				node->shutdown_reason = OCS_NODE_SHUTDOWN_DEFAULT;
-				ocs_fabric_initiate_shutdown(node);
-			}
+
+		if (node->sport->topology == OCS_SPORT_TOPOLOGY_P2P && !node->sport->p2p_winner) {
+			node_printf(node, "FLOGI failed, peer p2p winner, shutdown node\n");
+			node->shutdown_reason = OCS_NODE_SHUTDOWN_DEFAULT;
+			ocs_fabric_initiate_shutdown(node);
 			break;
 		}
+
 		node_printf(node, "FLOGI failed evt=%s, shutting down sport [%s]\n", ocs_sm_event_name(evt),
 			sport->display_name);
 		ocs_sm_post_event(&sport->sm, OCS_EVT_SHUTDOWN, NULL);