Patchwork [Open-FCoE] fcoemon.c: Add a check to verify if dcbd is to be initialized, else do not try to connect to dcbd/lldpad

login
register
mail settings
Submitter Laurence Oberman
Date March 28, 2016, 12:20 p.m.
Message ID <21407962.25341244.1459167641384.JavaMail.zimbra@redhat.com>
Download mbox | patch
Permalink /patch/318/
State Superseded
Headers show

Comments

Laurence Oberman - March 28, 2016, 12:20 p.m.
Tested and validated in an FCOE configuration.

Reviewed-by: Laurence Oberman <loberman@redhat.com>
Tested-by: Laurence Oberman <loberman@redhat.com>

Laurence Oberman
Principal Software Maintenance Engineer
Red Hat Global Support Services

----- Original Message -----
From: "Milan P. Gandhi" <mgandhi@redhat.com>
To: fcoe-devel@open-fcoe.org
Cc: "Laurence Oberman" <loberman@redhat.com>
Sent: Monday, March 28, 2016 12:52:12 AM
Subject: [Open-FCoE] [PATCH] fcoemon.c: Add a check to verify if dcbd is to be initialized, else do not try to connect to dcbd/lldpad

Hello,

Some of the FCoE capable adapters e.g. BCM57810 network interfaces
has DCBX/LLDP client on-chip, and kernel documentation recommends
to keep software based DCBX/LLDP clients (e.g. lldpad) disabled.
https://www.kernel.org/doc/Documentation/scsi/bnx2fc.txt

It was found that, if lldpad is disabled while using above interfaces,
then fcoemon shows following errors every 10 seconds:

fcoemon: error 111 Connection refused
fcoemon: Failed to connect to lldpad

Below patch checks each interface configuration in /etc/fcoe/cfg-ethX
file to verify if there is at least 1 interface with DCB_REQUIRED flag
set to yes and will try to initialize dcbd only if there is at least 1
interface with DCB_REQUIRED="yes", else fcoemon will not try to
initialize dcbd or connect to lldpad, thus eliminating above errors:

Signed-off-by: Milan P. Gandhi <mgandhi@redhat.com>
---

fcoe-devel mailing list
fcoe-devel@open-fcoe.org
http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel

Patch

diff --git a/fcoemon.c b/fcoemon.c
index 91d12c7..d84d1e5 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -557,6 +557,9 @@  static int fcm_read_config_files(void)
 		if (!strncasecmp(val, "yes", 3) && rc == 1)
 			next->dcb_required = 1;
 
+		if (next->dcb_required == 1 && fcoe_config.dcb_init == 0)
+			fcoe_config.dcb_init = 1;
+
 		/* AUTO_VLAN */
 		rc = fcm_read_config_variable(file, val, sizeof(val),
 					      fp, CFG_IF_VAR_AUTOVLAN);
@@ -3768,7 +3771,9 @@  int main(int argc, char **argv)
 	if (rc != 0)
 		goto err_cleanup;
 
-	fcm_dcbd_init();
+	if (fcoe_config.dcb_init)
+		fcm_dcbd_init();
+
 	rc = fcm_srv_create(&srv_info);
 	if (rc != 0)
 		goto err_cleanup;
diff --git a/fcoemon.h b/fcoemon.h
index 3869bae..0e0e6a2 100644
--- a/fcoemon.h
+++ b/fcoemon.h
@@ -25,6 +25,7 @@ 
 struct fcoe_config {
 	int debug;
 	int use_syslog;
+	int dcb_init;
 	struct fcoe_port *port;
 } fcoe_config;
_______________________________________________