Blame SOURCES/fcoe-utils-v1.0.31-1-fcoemon.c-Add-a-check-to-verify-if-dcbd-is-to-be-ini.patch

d5ef94
From 0231b0c71464af17a0cf392e55174c97a5986640 Mon Sep 17 00:00:00 2001
d5ef94
From: "Milan P. Gandhi" <mgandhi@redhat.com>
d5ef94
Date: Mon, 28 Mar 2016 12:52:12 +0000
d5ef94
Subject: [PATCH] fcoemon.c: Add a check to verify if dcbd is to be
d5ef94
 initialized, else do not try to connect to dcbd/lldpad
d5ef94
d5ef94
Some of the FCoE capable adapters e.g. BCM57810 network interfaces
d5ef94
has DCBX/LLDP client on-chip, and kernel documentation recommends
d5ef94
to keep software based DCBX/LLDP clients (e.g. lldpad) disabled.
d5ef94
https://www.kernel.org/doc/Documentation/scsi/bnx2fc.txt
d5ef94
d5ef94
It was found that, if lldpad is disabled while using above interfaces,
d5ef94
then fcoemon shows following errors every 10 seconds:
d5ef94
d5ef94
fcoemon: error 111 Connection refused
d5ef94
fcoemon: Failed to connect to lldpad
d5ef94
d5ef94
Below patch checks each interface configuration in /etc/fcoe/cfg-ethX
d5ef94
file to verify if there is at least 1 interface with DCB_REQUIRED flag
d5ef94
set to yes and will try to initialize dcbd only if there is at least 1
d5ef94
interface with DCB_REQUIRED="yes", else fcoemon will not try to
d5ef94
initialize dcbd or connect to lldpad, thus eliminating above errors:
d5ef94
d5ef94
Signed-off-by: Milan P. Gandhi <mgandhi@redhat.com>
d5ef94
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
d5ef94
Reviewed-by: Laurence Oberman <loberman@redhat.com>
d5ef94
Tested-by: Laurence Oberman <loberman@redhat.com>
d5ef94
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
d5ef94
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
d5ef94
---
d5ef94
 fcoemon.c | 7 ++++++-
d5ef94
 fcoemon.h | 1 +
d5ef94
 2 files changed, 7 insertions(+), 1 deletion(-)
d5ef94
d5ef94
diff --git a/fcoemon.c b/fcoemon.c
d5ef94
index 91d12c7..d84d1e5 100644
d5ef94
--- a/fcoemon.c
d5ef94
+++ b/fcoemon.c
d5ef94
@@ -557,6 +557,9 @@ static int fcm_read_config_files(void)
d5ef94
 		if (!strncasecmp(val, "yes", 3) && rc == 1)
d5ef94
 			next->dcb_required = 1;
d5ef94
 
d5ef94
+		if (next->dcb_required == 1 && fcoe_config.dcb_init == 0)
d5ef94
+			fcoe_config.dcb_init = 1;
d5ef94
+
d5ef94
 		/* AUTO_VLAN */
d5ef94
 		rc = fcm_read_config_variable(file, val, sizeof(val),
d5ef94
 					      fp, CFG_IF_VAR_AUTOVLAN);
d5ef94
@@ -3768,7 +3771,9 @@ int main(int argc, char **argv)
d5ef94
 	if (rc != 0)
d5ef94
 		goto err_cleanup;
d5ef94
 
d5ef94
-	fcm_dcbd_init();
d5ef94
+	if (fcoe_config.dcb_init)
d5ef94
+		fcm_dcbd_init();
d5ef94
+
d5ef94
 	rc = fcm_srv_create(&srv_info);
d5ef94
 	if (rc != 0)
d5ef94
 		goto err_cleanup;
d5ef94
diff --git a/fcoemon.h b/fcoemon.h
d5ef94
index 3869bae..0e0e6a2 100644
d5ef94
--- a/fcoemon.h
d5ef94
+++ b/fcoemon.h
d5ef94
@@ -25,6 +25,7 @@
d5ef94
 struct fcoe_config {
d5ef94
 	int debug;
d5ef94
 	int use_syslog;
d5ef94
+	int dcb_init;
d5ef94
 	struct fcoe_port *port;
d5ef94
 } fcoe_config;
d5ef94
 
d5ef94
-- 
d5ef94
2.5.5
d5ef94