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 Milan P. Gandhi
Date March 28, 2016, 4:52 a.m.
Message ID <56F8B87C.3010305@redhat.com>
Download mbox | patch
Permalink /patch/317/
State Accepted
Headers show

Comments

Milan P. Gandhi - March 28, 2016, 4:52 a.m.
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
Johannes Thumshirn - March 29, 2016, 8:03 a.m.
On Montag, 28. März 2016 10:22:12 CEST Milan P. Gandhi wrote:
> 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>

Looks OK to me.
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Johannes Thumshirn - April 8, 2016, 1:48 p.m.
On Montag, 28. März 2016 10:22:12 CEST Milan P. Gandhi wrote:
> 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>
> ---
> 
> 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;
> _______________________________________________
> fcoe-devel mailing list
> fcoe-devel@open-fcoe.org
> http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel
> 


Vasu, have you seen above patch, or did it slip through the cracks?

It already has:
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>


Thanks

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;
_______________________________________________