Interop issues with Juniper QFX3500 switch & firmware managed dcbx
authorAnish Bhatt <anish@chelsio.com>
Tue, 6 May 2014 03:18:52 +0000 (03:18 +0000)
committerJohn Fastabend <john.r.fastabend@intel.com>
Fri, 9 May 2014 15:55:18 +0000 (08:55 -0700)
If not explicitly enabled by admin status, disable Tx when DCBx
engine is LLD_MANAGED

This fixes multiple negotiating entity issues seen with Juniper
Switches

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>

lldp_8021qaz.c

index cab1fd5..a8a2e0b 100644 (file)
@@ -525,7 +525,7 @@ void ieee8021qaz_ifup(char *ifname, struct lldp_agent *agent)
        struct ieee_ets *ets = NULL;
        struct ieee_pfc *pfc = NULL;
        struct app_prio *data = NULL;
-       int err;
+       int err, no_set_status;
 
        if (agent->type != NEAREST_BRIDGE)
                return;
@@ -538,11 +538,19 @@ void ieee8021qaz_ifup(char *ifname, struct lldp_agent *agent)
        if (err < 0)
                return;
 
+       /* If admin has explicitly enabled Rx/Tx, don't override it */
+       no_set_status = get_config_setting(ifname, agent->type, ARG_ADMINSTATUS,
+                                               &adminstatus, CONFIG_TYPE_INT);
+
        /* If hardware is not DCBX IEEE compliant or it is managed
         * by an LLD agent most likely a firmware agent abort
         */
-       if (dcbx & DCB_CAP_DCBX_LLD_MANAGED)
+       if (dcbx & DCB_CAP_DCBX_LLD_MANAGED) {
+               if (no_set_status)
+                       set_lldp_agent_admin(ifname, agent->type,
+                                            (adminstatus & enabledRxOnly));
                return;
+       }
 
        /* If 802.1Qaz is already configured no need to continue */
        tlvs = ieee8021qaz_data(ifname);
@@ -552,8 +560,7 @@ void ieee8021qaz_ifup(char *ifname, struct lldp_agent *agent)
        /* if there is no persistent adminStatus setting then set to enabledRx
         * but do not persist that as a setting.
         */
-       if (get_config_setting(ifname, agent->type, ARG_ADMINSTATUS,
-                              &adminstatus, CONFIG_TYPE_INT))
+       if (no_set_status)
                set_lldp_agent_admin(ifname, agent->type, enabledRxOnly);
 
        /* lookup port data */