net/qede/base: remove unused input parameter
[dpdk.git] / drivers / net / qede / base / ecore_dcbx.c
index 0e11927..637d5bb 100644 (file)
 
 static bool ecore_dcbx_app_ethtype(u32 app_info_bitmap)
 {
-       return !!(ECORE_MFW_GET_FIELD(app_info_bitmap, DCBX_APP_SF) ==
+       return !!(GET_MFW_FIELD(app_info_bitmap, DCBX_APP_SF) ==
                  DCBX_APP_SF_ETHTYPE);
 }
 
 static bool ecore_dcbx_ieee_app_ethtype(u32 app_info_bitmap)
 {
-       u8 mfw_val = ECORE_MFW_GET_FIELD(app_info_bitmap, DCBX_APP_SF_IEEE);
+       u8 mfw_val = GET_MFW_FIELD(app_info_bitmap, DCBX_APP_SF_IEEE);
 
        /* Old MFW */
        if (mfw_val == DCBX_APP_SF_IEEE_RESERVED)
@@ -45,13 +45,13 @@ static bool ecore_dcbx_ieee_app_ethtype(u32 app_info_bitmap)
 
 static bool ecore_dcbx_app_port(u32 app_info_bitmap)
 {
-       return !!(ECORE_MFW_GET_FIELD(app_info_bitmap, DCBX_APP_SF) ==
+       return !!(GET_MFW_FIELD(app_info_bitmap, DCBX_APP_SF) ==
                  DCBX_APP_SF_PORT);
 }
 
 static bool ecore_dcbx_ieee_app_port(u32 app_info_bitmap, u8 type)
 {
-       u8 mfw_val = ECORE_MFW_GET_FIELD(app_info_bitmap, DCBX_APP_SF_IEEE);
+       u8 mfw_val = GET_MFW_FIELD(app_info_bitmap, DCBX_APP_SF_IEEE);
 
        /* Old MFW */
        if (mfw_val == DCBX_APP_SF_IEEE_RESERVED)
@@ -72,6 +72,23 @@ static bool ecore_dcbx_default_tlv(u32 app_info_bitmap, u16 proto_id, bool ieee)
        return !!(ethtype && (proto_id == ECORE_ETH_TYPE_DEFAULT));
 }
 
+static bool ecore_dcbx_iwarp_tlv(struct ecore_hwfn *p_hwfn, u32 app_info_bitmap,
+                                u16 proto_id, bool ieee)
+{
+       bool port;
+
+       if (!p_hwfn->p_dcbx_info->iwarp_port)
+               return false;
+
+       if (ieee)
+               port = ecore_dcbx_ieee_app_port(app_info_bitmap,
+                                               DCBX_APP_SF_IEEE_TCP_PORT);
+       else
+               port = ecore_dcbx_app_port(app_info_bitmap);
+
+       return !!(port && (proto_id == p_hwfn->p_dcbx_info->iwarp_port));
+}
+
 static void
 ecore_dcbx_dp_protocol(struct ecore_hwfn *p_hwfn,
                       struct ecore_dcbx_results *p_data)
@@ -97,36 +114,40 @@ ecore_dcbx_dp_protocol(struct ecore_hwfn *p_hwfn,
        }
 }
 
-void
+u8 ecore_dcbx_get_dscp_value(struct ecore_hwfn *p_hwfn, u8 pri)
+{
+       struct ecore_dcbx_dscp_params *dscp = &p_hwfn->p_dcbx_info->get.dscp;
+       u8 i;
+
+       if (!dscp->enabled)
+               return ECORE_DCBX_DSCP_DISABLED;
+
+       for (i = 0; i < ECORE_DCBX_DSCP_SIZE; i++)
+               if (pri == dscp->dscp_pri_map[i])
+                       return i;
+
+       return ECORE_DCBX_DSCP_DISABLED;
+}
+
+static void
 ecore_dcbx_set_params(struct ecore_dcbx_results *p_data,
                      struct ecore_hwfn *p_hwfn,
                      bool enable, u8 prio, u8 tc,
                      enum dcbx_protocol_type type,
                      enum ecore_pci_personality personality)
 {
-       struct ecore_dcbx_dscp_params *dscp = &p_hwfn->p_dcbx_info->get.dscp;
-
        /* PF update ramrod data */
        p_data->arr[type].enable = enable;
        p_data->arr[type].priority = prio;
        p_data->arr[type].tc = tc;
-       p_data->arr[type].dscp_enable = dscp->enabled;
-       if (p_data->arr[type].dscp_enable) {
-               u8 i;
-
-               for (i = 0; i < ECORE_DCBX_DSCP_SIZE; i++)
-                       if (prio == dscp->dscp_pri_map[i]) {
-                               p_data->arr[type].dscp_val = i;
-                               break;
-                       }
+       p_data->arr[type].dscp_val = ecore_dcbx_get_dscp_value(p_hwfn, prio);
+       if (p_data->arr[type].dscp_val == ECORE_DCBX_DSCP_DISABLED) {
+               p_data->arr[type].dscp_enable = false;
+               p_data->arr[type].dscp_val = 0;
+       } else {
+               p_data->arr[type].dscp_enable = true;
        }
-
-       if (enable && p_data->arr[type].dscp_enable)
-               p_data->arr[type].update = UPDATE_DCB_DSCP;
-       else if (enable)
-               p_data->arr[type].update = UPDATE_DCB;
-       else
-               p_data->arr[type].update = DONT_UPDATE_DCB_DSCP;
+       p_data->arr[type].update = UPDATE_DCB_DSCP;
 
        /* QM reconf data */
        if (p_hwfn->hw_info.personality == personality)
@@ -217,8 +238,8 @@ ecore_dcbx_process_tlv(struct ecore_hwfn *p_hwfn,
                       int count, u8 dcbx_version)
 {
        enum dcbx_protocol_type type;
+       bool enable, ieee, eth_tlv;
        u8 tc, priority_map;
-       bool enable, ieee;
        u16 protocol_id;
        u8 priority;
        enum _ecore_status_t rc = ECORE_SUCCESS;
@@ -229,12 +250,12 @@ ecore_dcbx_process_tlv(struct ecore_hwfn *p_hwfn,
                   count, pri_tc_tbl, dcbx_version);
 
        ieee = (dcbx_version == DCBX_CONFIG_VERSION_IEEE);
+       eth_tlv = false;
        /* Parse APP TLV */
        for (i = 0; i < count; i++) {
-               protocol_id = ECORE_MFW_GET_FIELD(p_tbl[i].entry,
-                                                 DCBX_APP_PROTOCOL_ID);
-               priority_map = ECORE_MFW_GET_FIELD(p_tbl[i].entry,
-                                                  DCBX_APP_PRI_MAP);
+               protocol_id = GET_MFW_FIELD(p_tbl[i].entry,
+                                           DCBX_APP_PROTOCOL_ID);
+               priority_map = GET_MFW_FIELD(p_tbl[i].entry, DCBX_APP_PRI_MAP);
                DP_VERBOSE(p_hwfn, ECORE_MSG_DCB, "Id = 0x%x pri_map = %u\n",
                           protocol_id, priority_map);
                rc = ecore_dcbx_get_app_priority(priority_map, &priority);
@@ -253,12 +274,23 @@ ecore_dcbx_process_tlv(struct ecore_hwfn *p_hwfn,
                         * indication, but we only got here if there was an
                         * app tlv for the protocol, so dcbx must be enabled.
                         */
-                       enable = !(type == DCBX_PROTOCOL_ETH);
+                       if (type == DCBX_PROTOCOL_ETH) {
+                               enable = false;
+                               eth_tlv = true;
+                       } else {
+                               enable = true;
+                       }
 
                        ecore_dcbx_update_app_info(p_data, p_hwfn, enable,
                                                   priority, tc, type);
                }
        }
+
+       /* If Eth TLV is not detected, use UFP TC as default TC */
+       if (OSAL_TEST_BIT(ECORE_MF_UFP_SPECIFIC,
+                         &p_hwfn->p_dev->mf_bits) && !eth_tlv)
+               p_data->arr[DCBX_PROTOCOL_ETH].tc = p_hwfn->ufp_info.tc;
+
        /* Update ramrod protocol data and hw_info fields
         * with default info when corresponding APP TLV's are not detected.
         * The enabled field has a different logic for ethernet as only for
@@ -296,7 +328,7 @@ ecore_dcbx_process_mib_info(struct ecore_hwfn *p_hwfn)
        int num_entries;
 
        flags = p_hwfn->p_dcbx_info->operational.flags;
-       dcbx_version = ECORE_MFW_GET_FIELD(flags, DCBX_CONFIG_VERSION);
+       dcbx_version = GET_MFW_FIELD(flags, DCBX_CONFIG_VERSION);
 
        p_app = &p_hwfn->p_dcbx_info->operational.features.app;
        p_tbl = p_app->app_pri_tbl;
@@ -305,16 +337,15 @@ ecore_dcbx_process_mib_info(struct ecore_hwfn *p_hwfn)
        pri_tc_tbl = p_ets->pri_tc_tbl[0];
 
        p_info = &p_hwfn->hw_info;
-       num_entries = ECORE_MFW_GET_FIELD(p_app->flags, DCBX_APP_NUM_ENTRIES);
+       num_entries = GET_MFW_FIELD(p_app->flags, DCBX_APP_NUM_ENTRIES);
 
        rc = ecore_dcbx_process_tlv(p_hwfn, &data, p_tbl, pri_tc_tbl,
                                    num_entries, dcbx_version);
        if (rc != ECORE_SUCCESS)
                return rc;
 
-       p_info->num_active_tc = ECORE_MFW_GET_FIELD(p_ets->flags,
-                                                   DCBX_ETS_MAX_TCS);
-       p_hwfn->qm_info.ooo_tc = ECORE_MFW_GET_FIELD(p_ets->flags, DCBX_OOO_TC);
+       p_info->num_active_tc = GET_MFW_FIELD(p_ets->flags, DCBX_ETS_MAX_TCS);
+       p_hwfn->qm_info.ooo_tc = GET_MFW_FIELD(p_ets->flags, DCBX_OOO_TC);
        data.pf_id = p_hwfn->rel_pf_id;
        data.dcbx_enabled = !!dcbx_version;
 
@@ -397,26 +428,24 @@ ecore_dcbx_get_app_data(struct ecore_hwfn *p_hwfn,
        u8 pri_map;
        int i;
 
-       p_params->app_willing = ECORE_MFW_GET_FIELD(p_app->flags,
-                                                   DCBX_APP_WILLING);
-       p_params->app_valid = ECORE_MFW_GET_FIELD(p_app->flags,
-                                                 DCBX_APP_ENABLED);
-       p_params->app_error = ECORE_MFW_GET_FIELD(p_app->flags, DCBX_APP_ERROR);
-       p_params->num_app_entries = ECORE_MFW_GET_FIELD(p_app->flags,
-                                                       DCBX_APP_NUM_ENTRIES);
-       for (i = 0; i < DCBX_MAX_APP_PROTOCOL; i++) {
+       p_params->app_willing = GET_MFW_FIELD(p_app->flags, DCBX_APP_WILLING);
+       p_params->app_valid = GET_MFW_FIELD(p_app->flags, DCBX_APP_ENABLED);
+       p_params->app_error = GET_MFW_FIELD(p_app->flags, DCBX_APP_ERROR);
+       p_params->num_app_entries = GET_MFW_FIELD(p_app->flags,
+                                                 DCBX_APP_NUM_ENTRIES);
+       for (i = 0; i < p_params->num_app_entries; i++) {
                entry = &p_params->app_entry[i];
                if (ieee) {
                        u8 sf_ieee;
                        u32 val;
 
-                       sf_ieee = ECORE_MFW_GET_FIELD(p_tbl[i].entry,
-                                                     DCBX_APP_SF_IEEE);
+                       sf_ieee = GET_MFW_FIELD(p_tbl[i].entry,
+                                               DCBX_APP_SF_IEEE);
                        switch (sf_ieee) {
                        case DCBX_APP_SF_IEEE_RESERVED:
                                /* Old MFW */
-                               val = ECORE_MFW_GET_FIELD(p_tbl[i].entry,
-                                                           DCBX_APP_SF);
+                               val = GET_MFW_FIELD(p_tbl[i].entry,
+                                                   DCBX_APP_SF);
                                entry->sf_ieee = val ?
                                        ECORE_DCBX_SF_IEEE_TCP_UDP_PORT :
                                        ECORE_DCBX_SF_IEEE_ETHTYPE;
@@ -436,14 +465,14 @@ ecore_dcbx_get_app_data(struct ecore_hwfn *p_hwfn,
                                break;
                        }
                } else {
-                       entry->ethtype = !(ECORE_MFW_GET_FIELD(p_tbl[i].entry,
-                                                              DCBX_APP_SF));
+                       entry->ethtype = !(GET_MFW_FIELD(p_tbl[i].entry,
+                                                        DCBX_APP_SF));
                }
 
-               pri_map = ECORE_MFW_GET_FIELD(p_tbl[i].entry, DCBX_APP_PRI_MAP);
+               pri_map = GET_MFW_FIELD(p_tbl[i].entry, DCBX_APP_PRI_MAP);
                ecore_dcbx_get_app_priority(pri_map, &entry->prio);
-               entry->proto_id = ECORE_MFW_GET_FIELD(p_tbl[i].entry,
-                                                     DCBX_APP_PROTOCOL_ID);
+               entry->proto_id = GET_MFW_FIELD(p_tbl[i].entry,
+                                               DCBX_APP_PROTOCOL_ID);
                ecore_dcbx_get_app_protocol_type(p_hwfn, p_tbl[i].entry,
                                                 entry->proto_id,
                                                 &entry->proto_type, ieee);
@@ -461,10 +490,10 @@ ecore_dcbx_get_pfc_data(struct ecore_hwfn *p_hwfn,
 {
        u8 pfc_map;
 
-       p_params->pfc.willing = ECORE_MFW_GET_FIELD(pfc, DCBX_PFC_WILLING);
-       p_params->pfc.max_tc = ECORE_MFW_GET_FIELD(pfc, DCBX_PFC_CAPS);
-       p_params->pfc.enabled = ECORE_MFW_GET_FIELD(pfc, DCBX_PFC_ENABLED);
-       pfc_map = ECORE_MFW_GET_FIELD(pfc, DCBX_PFC_PRI_EN_BITMAP);
+       p_params->pfc.willing = GET_MFW_FIELD(pfc, DCBX_PFC_WILLING);
+       p_params->pfc.max_tc = GET_MFW_FIELD(pfc, DCBX_PFC_CAPS);
+       p_params->pfc.enabled = GET_MFW_FIELD(pfc, DCBX_PFC_ENABLED);
+       pfc_map = GET_MFW_FIELD(pfc, DCBX_PFC_PRI_EN_BITMAP);
        p_params->pfc.prio[0] = !!(pfc_map & DCBX_PFC_PRI_EN_BITMAP_PRI_0);
        p_params->pfc.prio[1] = !!(pfc_map & DCBX_PFC_PRI_EN_BITMAP_PRI_1);
        p_params->pfc.prio[2] = !!(pfc_map & DCBX_PFC_PRI_EN_BITMAP_PRI_2);
@@ -488,13 +517,10 @@ ecore_dcbx_get_ets_data(struct ecore_hwfn *p_hwfn,
        u32 bw_map[2], tsa_map[2], pri_map;
        int i;
 
-       p_params->ets_willing = ECORE_MFW_GET_FIELD(p_ets->flags,
-                                                   DCBX_ETS_WILLING);
-       p_params->ets_enabled = ECORE_MFW_GET_FIELD(p_ets->flags,
-                                                   DCBX_ETS_ENABLED);
-       p_params->ets_cbs = ECORE_MFW_GET_FIELD(p_ets->flags, DCBX_ETS_CBS);
-       p_params->max_ets_tc = ECORE_MFW_GET_FIELD(p_ets->flags,
-                                                  DCBX_ETS_MAX_TCS);
+       p_params->ets_willing = GET_MFW_FIELD(p_ets->flags, DCBX_ETS_WILLING);
+       p_params->ets_enabled = GET_MFW_FIELD(p_ets->flags, DCBX_ETS_ENABLED);
+       p_params->ets_cbs = GET_MFW_FIELD(p_ets->flags, DCBX_ETS_CBS);
+       p_params->max_ets_tc = GET_MFW_FIELD(p_ets->flags, DCBX_ETS_MAX_TCS);
        DP_VERBOSE(p_hwfn, ECORE_MSG_DCB,
                   "ETS params: willing %d, enabled = %d ets_cbs %d pri_tc_tbl_0 %x max_ets_tc %d\n",
                   p_params->ets_willing, p_params->ets_enabled,
@@ -535,7 +561,6 @@ ecore_dcbx_get_common_params(struct ecore_hwfn *p_hwfn,
 
 static void
 ecore_dcbx_get_local_params(struct ecore_hwfn *p_hwfn,
-                           struct ecore_ptt *p_ptt,
                            struct ecore_dcbx_get *params)
 {
        struct dcbx_features *p_feat;
@@ -549,7 +574,6 @@ ecore_dcbx_get_local_params(struct ecore_hwfn *p_hwfn,
 
 static void
 ecore_dcbx_get_remote_params(struct ecore_hwfn *p_hwfn,
-                            struct ecore_ptt *p_ptt,
                             struct ecore_dcbx_get *params)
 {
        struct dcbx_features *p_feat;
@@ -562,9 +586,33 @@ ecore_dcbx_get_remote_params(struct ecore_hwfn *p_hwfn,
        params->remote.valid = true;
 }
 
-static enum _ecore_status_t
+static void  ecore_dcbx_get_dscp_params(struct ecore_hwfn *p_hwfn,
+                                       struct ecore_dcbx_get *params)
+{
+       struct ecore_dcbx_dscp_params *p_dscp;
+       struct dcb_dscp_map *p_dscp_map;
+       int i, j, entry;
+       u32 pri_map;
+
+       p_dscp = &params->dscp;
+       p_dscp_map = &p_hwfn->p_dcbx_info->dscp_map;
+       p_dscp->enabled = GET_MFW_FIELD(p_dscp_map->flags, DCB_DSCP_ENABLE);
+
+       /* MFW encodes 64 dscp entries into 8 element array of u32 entries,
+        * where each entry holds the 4bit priority map for 8 dscp entries.
+        */
+       for (i = 0, entry = 0; i < ECORE_DCBX_DSCP_SIZE / 8; i++) {
+               pri_map = OSAL_BE32_TO_CPU(p_dscp_map->dscp_pri_map[i]);
+               DP_VERBOSE(p_hwfn, ECORE_MSG_DCB, "elem %d pri_map 0x%x\n",
+                          entry, pri_map);
+               for (j = 0; j < ECORE_DCBX_DSCP_SIZE / 8; j++, entry++)
+                       p_dscp->dscp_pri_map[entry] = (u32)(pri_map >>
+                                                          (j * 4)) & 0xf;
+       }
+}
+
+static void
 ecore_dcbx_get_operational_params(struct ecore_hwfn *p_hwfn,
-                                 struct ecore_ptt *p_ptt,
                                  struct ecore_dcbx_get *params)
 {
        struct ecore_dcbx_operational_params *p_operational;
@@ -580,27 +628,27 @@ ecore_dcbx_get_operational_params(struct ecore_hwfn *p_hwfn,
         * was successfuly performed
         */
        p_operational = &params->operational;
-       enabled = !!(ECORE_MFW_GET_FIELD(flags, DCBX_CONFIG_VERSION) !=
+       enabled = !!(GET_MFW_FIELD(flags, DCBX_CONFIG_VERSION) !=
                     DCBX_CONFIG_VERSION_DISABLED);
        if (!enabled) {
                p_operational->enabled = enabled;
                p_operational->valid = false;
                DP_VERBOSE(p_hwfn, ECORE_MSG_DCB, "Dcbx is disabled\n");
-               return ECORE_INVAL;
+               return;
        }
 
        p_feat = &p_hwfn->p_dcbx_info->operational.features;
        p_results = &p_hwfn->p_dcbx_info->results;
 
-       val = !!(ECORE_MFW_GET_FIELD(flags, DCBX_CONFIG_VERSION) ==
+       val = !!(GET_MFW_FIELD(flags, DCBX_CONFIG_VERSION) ==
                 DCBX_CONFIG_VERSION_IEEE);
        p_operational->ieee = val;
 
-       val = !!(ECORE_MFW_GET_FIELD(flags, DCBX_CONFIG_VERSION) ==
+       val = !!(GET_MFW_FIELD(flags, DCBX_CONFIG_VERSION) ==
                 DCBX_CONFIG_VERSION_CEE);
        p_operational->cee = val;
 
-       val = !!(ECORE_MFW_GET_FIELD(flags, DCBX_CONFIG_VERSION) ==
+       val = !!(GET_MFW_FIELD(flags, DCBX_CONFIG_VERSION) ==
                 DCBX_CONFIG_VERSION_STATIC);
        p_operational->local = val;
 
@@ -615,45 +663,14 @@ ecore_dcbx_get_operational_params(struct ecore_hwfn *p_hwfn,
                                     p_operational->ieee);
        ecore_dcbx_get_priority_info(p_hwfn, &p_operational->app_prio,
                                     p_results);
-       err = ECORE_MFW_GET_FIELD(p_feat->app.flags, DCBX_APP_ERROR);
+       err = GET_MFW_FIELD(p_feat->app.flags, DCBX_APP_ERROR);
        p_operational->err = err;
        p_operational->enabled = enabled;
        p_operational->valid = true;
-
-       return ECORE_SUCCESS;
 }
 
-static void
-ecore_dcbx_get_dscp_params(struct ecore_hwfn *p_hwfn,
-                          struct ecore_ptt *p_ptt,
-                          struct ecore_dcbx_get *params)
-{
-       struct ecore_dcbx_dscp_params *p_dscp;
-       struct dcb_dscp_map *p_dscp_map;
-       int i, j, entry;
-       u32 pri_map;
-
-       p_dscp = &params->dscp;
-       p_dscp_map = &p_hwfn->p_dcbx_info->dscp_map;
-       p_dscp->enabled = ECORE_MFW_GET_FIELD(p_dscp_map->flags,
-                                             DCB_DSCP_ENABLE);
-       /* MFW encodes 64 dscp entries into 8 element array of u32 entries,
-        * where each entry holds the 4bit priority map for 8 dscp entries.
-        */
-       for (i = 0, entry = 0; i < ECORE_DCBX_DSCP_SIZE / 8; i++) {
-               pri_map = OSAL_BE32_TO_CPU(p_dscp_map->dscp_pri_map[i]);
-               DP_VERBOSE(p_hwfn, ECORE_MSG_DCB, "elem %d pri_map 0x%x\n",
-                          entry, pri_map);
-               for (j = 0; j < ECORE_DCBX_DSCP_SIZE / 8; j++, entry++)
-                       p_dscp->dscp_pri_map[entry] = (u32)(pri_map >>
-                                                          (j * 4)) & 0xf;
-       }
-}
-
-static void
-ecore_dcbx_get_local_lldp_params(struct ecore_hwfn *p_hwfn,
-                                struct ecore_ptt *p_ptt,
-                                struct ecore_dcbx_get *params)
+static void ecore_dcbx_get_local_lldp_params(struct ecore_hwfn *p_hwfn,
+                                            struct ecore_dcbx_get *params)
 {
        struct lldp_config_params_s *p_local;
 
@@ -666,10 +683,8 @@ ecore_dcbx_get_local_lldp_params(struct ecore_hwfn *p_hwfn,
                    OSAL_ARRAY_SIZE(p_local->local_port_id));
 }
 
-static void
-ecore_dcbx_get_remote_lldp_params(struct ecore_hwfn *p_hwfn,
-                                 struct ecore_ptt *p_ptt,
-                                 struct ecore_dcbx_get *params)
+static void ecore_dcbx_get_remote_lldp_params(struct ecore_hwfn *p_hwfn,
+                                             struct ecore_dcbx_get *params)
 {
        struct lldp_status_params_s *p_remote;
 
@@ -683,34 +698,32 @@ ecore_dcbx_get_remote_lldp_params(struct ecore_hwfn *p_hwfn,
 }
 
 static enum _ecore_status_t
-ecore_dcbx_get_params(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
+ecore_dcbx_get_params(struct ecore_hwfn *p_hwfn,
                      struct ecore_dcbx_get *p_params,
                      enum ecore_mib_read_type type)
 {
-       enum _ecore_status_t rc = ECORE_SUCCESS;
-
        switch (type) {
        case ECORE_DCBX_REMOTE_MIB:
-               ecore_dcbx_get_remote_params(p_hwfn, p_ptt, p_params);
+               ecore_dcbx_get_remote_params(p_hwfn, p_params);
                break;
        case ECORE_DCBX_LOCAL_MIB:
-               ecore_dcbx_get_local_params(p_hwfn, p_ptt, p_params);
+               ecore_dcbx_get_local_params(p_hwfn, p_params);
                break;
        case ECORE_DCBX_OPERATIONAL_MIB:
-               ecore_dcbx_get_operational_params(p_hwfn, p_ptt, p_params);
+               ecore_dcbx_get_operational_params(p_hwfn, p_params);
                break;
        case ECORE_DCBX_REMOTE_LLDP_MIB:
-               ecore_dcbx_get_remote_lldp_params(p_hwfn, p_ptt, p_params);
+               ecore_dcbx_get_remote_lldp_params(p_hwfn, p_params);
                break;
        case ECORE_DCBX_LOCAL_LLDP_MIB:
-               ecore_dcbx_get_local_lldp_params(p_hwfn, p_ptt, p_params);
+               ecore_dcbx_get_local_lldp_params(p_hwfn, p_params);
                break;
        default:
                DP_ERR(p_hwfn, "MIB read err, unknown mib type %d\n", type);
                return ECORE_INVAL;
        }
 
-       return rc;
+       return ECORE_SUCCESS;
 }
 
 static enum _ecore_status_t
@@ -859,8 +872,7 @@ ecore_dcbx_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
                return rc;
 
        if (type == ECORE_DCBX_OPERATIONAL_MIB) {
-               ecore_dcbx_get_dscp_params(p_hwfn, p_ptt,
-                                          &p_hwfn->p_dcbx_info->get);
+               ecore_dcbx_get_dscp_params(p_hwfn, &p_hwfn->p_dcbx_info->get);
 
                rc = ecore_dcbx_process_mib_info(p_hwfn);
                if (!rc) {
@@ -872,7 +884,7 @@ ecore_dcbx_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
                        ecore_qm_reconf(p_hwfn, p_ptt);
 
                        /* update storm FW with negotiation results */
-                       ecore_sp_pf_update(p_hwfn);
+                       ecore_sp_pf_update_dcbx(p_hwfn);
 
                        /* set eagle enigne 1 flow control workaround
                         * according to negotiation results
@@ -880,12 +892,15 @@ ecore_dcbx_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
                        enabled = p_hwfn->p_dcbx_info->results.dcbx_enabled;
                }
        }
-       ecore_dcbx_get_params(p_hwfn, p_ptt, &p_hwfn->p_dcbx_info->get, type);
+
+       ecore_dcbx_get_params(p_hwfn, &p_hwfn->p_dcbx_info->get, type);
 
        /* Update the DSCP to TC mapping bit if required */
        if ((type == ECORE_DCBX_OPERATIONAL_MIB) &&
            p_hwfn->p_dcbx_info->dscp_nig_update) {
-               ecore_wr(p_hwfn, p_ptt, NIG_REG_DSCP_TO_TC_MAP_ENABLE, 0x1);
+               u8 val = !!p_hwfn->p_dcbx_info->get.dscp.enabled;
+
+               ecore_wr(p_hwfn, p_ptt, NIG_REG_DSCP_TO_TC_MAP_ENABLE, val);
                p_hwfn->p_dcbx_info->dscp_nig_update = false;
        }
 
@@ -896,21 +911,21 @@ ecore_dcbx_mib_update_event(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
 
 enum _ecore_status_t ecore_dcbx_info_alloc(struct ecore_hwfn *p_hwfn)
 {
-       enum _ecore_status_t rc = ECORE_SUCCESS;
-
        p_hwfn->p_dcbx_info = OSAL_ZALLOC(p_hwfn->p_dev, GFP_KERNEL,
                                          sizeof(*p_hwfn->p_dcbx_info));
        if (!p_hwfn->p_dcbx_info) {
                DP_NOTICE(p_hwfn, true,
                          "Failed to allocate `struct ecore_dcbx_info'");
-               rc = ECORE_NOMEM;
+               return ECORE_NOMEM;
        }
 
-       return rc;
+       p_hwfn->p_dcbx_info->iwarp_port =
+               p_hwfn->pf_params.rdma_pf_params.iwarp_port;
+
+       return ECORE_SUCCESS;
 }
 
-void ecore_dcbx_info_free(struct ecore_hwfn *p_hwfn,
-                         struct ecore_dcbx_info *p_dcbx_info)
+void ecore_dcbx_info_free(struct ecore_hwfn *p_hwfn)
 {
        OSAL_FREE(p_hwfn->p_dev, p_hwfn->p_dcbx_info);
 }
@@ -933,13 +948,15 @@ void ecore_dcbx_set_pf_update_params(struct ecore_dcbx_results *p_src,
        struct protocol_dcb_data *p_dcb_data;
        u8 update_flag;
 
-       p_dest->pf_id = p_src->pf_id;
-
        update_flag = p_src->arr[DCBX_PROTOCOL_ETH].update;
        p_dest->update_eth_dcb_data_mode = update_flag;
+       update_flag = p_src->arr[DCBX_PROTOCOL_IWARP].update;
+       p_dest->update_iwarp_dcb_data_mode = update_flag;
 
        p_dcb_data = &p_dest->eth_dcb_data;
        ecore_dcbx_update_protocol_data(p_dcb_data, p_src, DCBX_PROTOCOL_ETH);
+       p_dcb_data = &p_dest->iwarp_dcb_data;
+       ecore_dcbx_update_protocol_data(p_dcb_data, p_src, DCBX_PROTOCOL_IWARP);
 }
 
 enum _ecore_status_t ecore_dcbx_query_params(struct ecore_hwfn *p_hwfn,
@@ -953,17 +970,16 @@ enum _ecore_status_t ecore_dcbx_query_params(struct ecore_hwfn *p_hwfn,
                return ECORE_INVAL;
 
        p_ptt = ecore_ptt_acquire(p_hwfn);
-       if (!p_ptt) {
-               rc = ECORE_TIMEOUT;
-               DP_ERR(p_hwfn, "rc = %d\n", rc);
-               return rc;
-       }
+       if (!p_ptt)
+               return ECORE_TIMEOUT;
 
        rc = ecore_dcbx_read_mib(p_hwfn, p_ptt, type);
        if (rc != ECORE_SUCCESS)
                goto out;
 
-       rc = ecore_dcbx_get_params(p_hwfn, p_ptt, p_get, type);
+       ecore_dcbx_get_dscp_params(p_hwfn, p_get);
+
+       rc = ecore_dcbx_get_params(p_hwfn, p_get, type);
 
 out:
        ecore_ptt_release(p_hwfn, p_ptt);
@@ -988,13 +1004,13 @@ ecore_dcbx_set_pfc_data(struct ecore_hwfn *p_hwfn,
                *pfc &= ~DCBX_PFC_ENABLED_MASK;
 
        *pfc &= ~DCBX_PFC_CAPS_MASK;
-       *pfc |= (u32)p_params->pfc.max_tc << DCBX_PFC_CAPS_SHIFT;
+       *pfc |= (u32)p_params->pfc.max_tc << DCBX_PFC_CAPS_OFFSET;
 
        for (i = 0; i < ECORE_MAX_PFC_PRIORITIES; i++)
                if (p_params->pfc.prio[i])
                        pfc_map |= (1 << i);
        *pfc &= ~DCBX_PFC_PRI_EN_BITMAP_MASK;
-       *pfc |= (pfc_map << DCBX_PFC_PRI_EN_BITMAP_SHIFT);
+       *pfc |= (pfc_map << DCBX_PFC_PRI_EN_BITMAP_OFFSET);
 
        DP_VERBOSE(p_hwfn, ECORE_MSG_DCB, "pfc = 0x%x\n", *pfc);
 }
@@ -1024,7 +1040,7 @@ ecore_dcbx_set_ets_data(struct ecore_hwfn *p_hwfn,
                p_ets->flags &= ~DCBX_ETS_ENABLED_MASK;
 
        p_ets->flags &= ~DCBX_ETS_MAX_TCS_MASK;
-       p_ets->flags |= (u32)p_params->max_ets_tc << DCBX_ETS_MAX_TCS_SHIFT;
+       p_ets->flags |= (u32)p_params->max_ets_tc << DCBX_ETS_MAX_TCS_OFFSET;
 
        bw_map = (u8 *)&p_ets->tc_bw_tbl[0];
        tsa_map = (u8 *)&p_ets->tc_tsa_tbl[0];
@@ -1070,9 +1086,9 @@ ecore_dcbx_set_app_data(struct ecore_hwfn *p_hwfn,
 
        p_app->flags &= ~DCBX_APP_NUM_ENTRIES_MASK;
        p_app->flags |= (u32)p_params->num_app_entries <<
-                                       DCBX_APP_NUM_ENTRIES_SHIFT;
+                       DCBX_APP_NUM_ENTRIES_OFFSET;
 
-       for (i = 0; i < DCBX_MAX_APP_PROTOCOL; i++) {
+       for (i = 0; i < p_params->num_app_entries; i++) {
                entry = &p_app->app_pri_tbl[i].entry;
                *entry = 0;
                if (ieee) {
@@ -1080,50 +1096,50 @@ ecore_dcbx_set_app_data(struct ecore_hwfn *p_hwfn,
                        switch (p_params->app_entry[i].sf_ieee) {
                        case ECORE_DCBX_SF_IEEE_ETHTYPE:
                                *entry  |= ((u32)DCBX_APP_SF_IEEE_ETHTYPE <<
-                                           DCBX_APP_SF_IEEE_SHIFT);
+                                           DCBX_APP_SF_IEEE_OFFSET);
                                *entry  |= ((u32)DCBX_APP_SF_ETHTYPE <<
-                                           DCBX_APP_SF_SHIFT);
+                                           DCBX_APP_SF_OFFSET);
                                break;
                        case ECORE_DCBX_SF_IEEE_TCP_PORT:
                                *entry  |= ((u32)DCBX_APP_SF_IEEE_TCP_PORT <<
-                                           DCBX_APP_SF_IEEE_SHIFT);
+                                           DCBX_APP_SF_IEEE_OFFSET);
                                *entry  |= ((u32)DCBX_APP_SF_PORT <<
-                                           DCBX_APP_SF_SHIFT);
+                                           DCBX_APP_SF_OFFSET);
                                break;
                        case ECORE_DCBX_SF_IEEE_UDP_PORT:
                                *entry  |= ((u32)DCBX_APP_SF_IEEE_UDP_PORT <<
-                                           DCBX_APP_SF_IEEE_SHIFT);
+                                           DCBX_APP_SF_IEEE_OFFSET);
                                *entry  |= ((u32)DCBX_APP_SF_PORT <<
-                                           DCBX_APP_SF_SHIFT);
+                                           DCBX_APP_SF_OFFSET);
                                break;
                        case ECORE_DCBX_SF_IEEE_TCP_UDP_PORT:
                                *entry  |= (u32)DCBX_APP_SF_IEEE_TCP_UDP_PORT <<
-                                           DCBX_APP_SF_IEEE_SHIFT;
+                                           DCBX_APP_SF_IEEE_OFFSET;
                                *entry  |= ((u32)DCBX_APP_SF_PORT <<
-                                           DCBX_APP_SF_SHIFT);
+                                           DCBX_APP_SF_OFFSET);
                                break;
                        }
                } else {
                        *entry &= ~DCBX_APP_SF_MASK;
                        if (p_params->app_entry[i].ethtype)
                                *entry  |= ((u32)DCBX_APP_SF_ETHTYPE <<
-                                           DCBX_APP_SF_SHIFT);
+                                           DCBX_APP_SF_OFFSET);
                        else
                                *entry  |= ((u32)DCBX_APP_SF_PORT <<
-                                           DCBX_APP_SF_SHIFT);
+                                           DCBX_APP_SF_OFFSET);
                }
                *entry &= ~DCBX_APP_PROTOCOL_ID_MASK;
                *entry |= ((u32)p_params->app_entry[i].proto_id <<
-                               DCBX_APP_PROTOCOL_ID_SHIFT);
+                          DCBX_APP_PROTOCOL_ID_OFFSET);
                *entry &= ~DCBX_APP_PRI_MAP_MASK;
                *entry |= ((u32)(p_params->app_entry[i].prio) <<
-                               DCBX_APP_PRI_MAP_SHIFT);
+                          DCBX_APP_PRI_MAP_OFFSET);
        }
 
        DP_VERBOSE(p_hwfn, ECORE_MSG_DCB, "flags = 0x%x\n", p_app->flags);
 }
 
-static enum _ecore_status_t
+static void
 ecore_dcbx_set_local_params(struct ecore_hwfn *p_hwfn,
                            struct dcbx_local_params *local_admin,
                            struct ecore_dcbx_set *params)
@@ -1153,8 +1169,6 @@ ecore_dcbx_set_local_params(struct ecore_hwfn *p_hwfn,
        if (params->override_flags & ECORE_DCBX_OVERRIDE_APP_CFG)
                ecore_dcbx_set_app_data(p_hwfn, &local_admin->features.app,
                                        &params->config.params, ieee);
-
-       return ECORE_SUCCESS;
 }
 
 static enum _ecore_status_t
@@ -1184,6 +1198,12 @@ ecore_dcbx_set_dscp_params(struct ecore_hwfn *p_hwfn,
        p_hwfn->p_dcbx_info->dscp_nig_update = true;
 
        DP_VERBOSE(p_hwfn, ECORE_MSG_DCB, "flags = 0x%x\n", p_dscp_map->flags);
+       DP_VERBOSE(p_hwfn, ECORE_MSG_DCB,
+                  "pri_map[] = 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
+                  p_dscp_map->dscp_pri_map[0], p_dscp_map->dscp_pri_map[1],
+                  p_dscp_map->dscp_pri_map[2], p_dscp_map->dscp_pri_map[3],
+                  p_dscp_map->dscp_pri_map[4], p_dscp_map->dscp_pri_map[5],
+                  p_dscp_map->dscp_pri_map[6], p_dscp_map->dscp_pri_map[7]);
 
        return ECORE_SUCCESS;
 }
@@ -1199,15 +1219,10 @@ enum _ecore_status_t ecore_dcbx_config_params(struct ecore_hwfn *p_hwfn,
        u32 resp = 0, param = 0;
        enum _ecore_status_t rc = ECORE_SUCCESS;
 
-       if (!hw_commit) {
-               OSAL_MEMCPY(&p_hwfn->p_dcbx_info->set, params,
-                           sizeof(p_hwfn->p_dcbx_info->set));
+       OSAL_MEMCPY(&p_hwfn->p_dcbx_info->set, params,
+                   sizeof(p_hwfn->p_dcbx_info->set));
+       if (!hw_commit)
                return ECORE_SUCCESS;
-       }
-
-       /* clear set-parmas cache */
-       OSAL_MEMSET(&p_hwfn->p_dcbx_info->set, 0,
-                   sizeof(struct ecore_dcbx_set));
 
        OSAL_MEMSET(&local_admin, 0, sizeof(local_admin));
        ecore_dcbx_set_local_params(p_hwfn, &local_admin, params);
@@ -1231,12 +1246,10 @@ enum _ecore_status_t ecore_dcbx_config_params(struct ecore_hwfn *p_hwfn,
        }
 
        rc = ecore_mcp_cmd(p_hwfn, p_ptt, DRV_MSG_CODE_SET_DCBX,
-                          1 << DRV_MB_PARAM_LLDP_SEND_SHIFT, &resp, &param);
-       if (rc != ECORE_SUCCESS) {
+                          1 << DRV_MB_PARAM_LLDP_SEND_OFFSET, &resp, &param);
+       if (rc != ECORE_SUCCESS)
                DP_NOTICE(p_hwfn, false,
                          "Failed to send DCBX update request\n");
-               return rc;
-       }
 
        return rc;
 }
@@ -1255,10 +1268,8 @@ enum _ecore_status_t ecore_dcbx_get_config_params(struct ecore_hwfn *p_hwfn,
 
        dcbx_info = OSAL_ALLOC(p_hwfn->p_dev, GFP_KERNEL,
                               sizeof(*dcbx_info));
-       if (!dcbx_info) {
-               DP_ERR(p_hwfn, "Failed to allocate struct ecore_dcbx_info\n");
+       if (!dcbx_info)
                return ECORE_NOMEM;
-       }
 
        OSAL_MEMSET(dcbx_info, 0, sizeof(*dcbx_info));
        rc = ecore_dcbx_query_params(p_hwfn, dcbx_info,
@@ -1278,9 +1289,12 @@ enum _ecore_status_t ecore_dcbx_get_config_params(struct ecore_hwfn *p_hwfn,
                p_hwfn->p_dcbx_info->set.ver_num |= DCBX_CONFIG_VERSION_STATIC;
 
        p_hwfn->p_dcbx_info->set.enabled = dcbx_info->operational.enabled;
+       OSAL_MEMCPY(&p_hwfn->p_dcbx_info->set.dscp,
+                   &p_hwfn->p_dcbx_info->get.dscp,
+                   sizeof(struct ecore_dcbx_dscp_params));
        OSAL_MEMCPY(&p_hwfn->p_dcbx_info->set.config.params,
                    &dcbx_info->operational.params,
-                   sizeof(struct ecore_dcbx_admin_params));
+                   sizeof(p_hwfn->p_dcbx_info->set.config.params));
        p_hwfn->p_dcbx_info->set.config.valid = true;
 
        OSAL_MEMCPY(params, &p_hwfn->p_dcbx_info->set,