intel/openlldp

Unable to apply DCB configuration

sregister opened this issue · 1 comments

When using tip of tree 3168e11 I'm unable to apply a dcb map by running:

lldptool -Ti $1 -V ETS-CFG enableTx=yes willing=no up2tc=0:0,1:0,2:0,3:1,4:2,5:0,6:0,7:0 tcbw=10,30,60 tsa=0:ets,1:ets,2:ets
lldptool -Ti $1 -V ETS-REC enableTx=yes up2tc=0:0,1:0,2:0,3:1,4:2,5:0,6:0,7:0 tcbw=10,30,60 tsa=0:ets,1:ets,2:ets
lldptool -Ti $1 -V PFC enable=yes enableTx=yes willing=no enabled=3,4

The above commands return success:

enabled = yes
willing = no
up2tc = 0:0,1:0,2:0,3:1,4:2,5:0,6:0,7:0
tcbw = 10% 30% 60% 0% 0% 0% 0% 0% 
TSA = 0:ets 1:ets 2:ets 3:strict 4:strict 5:strict 6:strict 7:strict 
enabled = yes
up2tc = 0:0,1:0,2:0,3:1,4:2,5:0,6:0,7:0
tcbw = 10% 30% 60% 0% 0% 0% 0% 0% 
TSA = 0:ets 1:ets 2:ets 3:strict 4:strict 5:strict 6:strict 7:strict 
enabled = yes
willing = no
prio = 3,4

But the DCB map never applies. When monitoring the driver the dcbnl set functions never seem to be hit. After bisecting it was determined that commits 59c9a54 189f63a seem to cause this regression.

Sorry, I just saw this. Can you try the following patch?

diff --git a/lldp_8021qaz.c b/lldp_8021qaz.c
index 219db80..09e9060 100644
--- a/lldp_8021qaz.c
+++ b/lldp_8021qaz.c
@@ -214,7 +214,7 @@ bool read_cfg_file_willing(char *ifname, struct lldp_agent *agent, int tlv_type)
 	res = get_config_setting(ifname, agent->type, arg_path, &willing, 
 		CONFIG_TYPE_INT);
  	
-	return (res == 0 ? willing == 1 : true); 
+	return (res == 0 ? !!willing : true);
 }
 
 static int read_cfg_file(char *ifname, struct lldp_agent *agent,

I doubt it should make much difference, but we'll see. I'm also a bit suspicious about some of the function rewrites put in there.