build: disable experimental API check internally
[dpdk.git] / drivers / net / bnx2x / ecore_sp.c
index a75a7fa..00c33a3 100644 (file)
@@ -1,16 +1,14 @@
-/*-
- * Copyright (c) 2007-2013 QLogic Corporation. All rights reserved.
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2007-2013 Broadcom Corporation.
  *
  * Eric Davis        <edavis@broadcom.com>
  * David Christensen <davidch@broadcom.com>
  * Gary Zambrano     <zambrano@broadcom.com>
  *
  * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
- * Copyright (c) 2015 QLogic Corporation.
+ * Copyright (c) 2015-2018 Cavium Inc.
  * All rights reserved.
- * www.qlogic.com
- *
- * See LICENSE.bnx2x_pmd for copyright and licensing details.
+ * www.cavium.com
  */
 
 #include "bnx2x.h"
@@ -55,14 +53,14 @@ ecore_exe_queue_init(struct bnx2x_softc *sc __rte_unused,
        o->execute = exec;
        o->get = get;
 
-       ECORE_MSG("Setup the execution queue with the chunk length of %d",
+       ECORE_MSG(sc, "Setup the execution queue with the chunk length of %d",
                  exe_len);
 }
 
 static void ecore_exe_queue_free_elem(struct bnx2x_softc *sc __rte_unused,
                                      struct ecore_exeq_elem *elem)
 {
-       ECORE_MSG("Deleting an exe_queue element");
+       ECORE_MSG(sc, "Deleting an exe_queue element");
        ECORE_FREE(sc, elem, sizeof(*elem));
 }
 
@@ -108,7 +106,7 @@ static int ecore_exe_queue_add(struct bnx2x_softc *sc,
                /* Check if this request is ok */
                rc = o->validate(sc, o->owner, elem);
                if (rc) {
-                       ECORE_MSG("Preamble failed: %d", rc);
+                       ECORE_MSG(sc, "Preamble failed: %d", rc);
                        goto free_and_exit;
                }
        }
@@ -178,8 +176,8 @@ static int ecore_exe_queue_step(struct bnx2x_softc *sc,
         */
        if (!ECORE_LIST_IS_EMPTY(&o->pending_comp)) {
                if (ECORE_TEST_BIT(RAMROD_DRV_CLR_ONLY, ramrod_flags)) {
-                       ECORE_MSG
-                           ("RAMROD_DRV_CLR_ONLY requested: resetting a pending_comp list");
+                       ECORE_MSG(sc,
+                                 "RAMROD_DRV_CLR_ONLY requested: resetting a pending_comp list");
                        __ecore_exe_queue_reset_pending(sc, o);
                } else {
                        return ECORE_PENDING;
@@ -242,12 +240,12 @@ static struct ecore_exeq_elem *ecore_exe_queue_alloc_elem(struct
                                                          bnx2x_softc *sc
                                                          __rte_unused)
 {
-       ECORE_MSG("Allocating a new exe_queue element");
+       ECORE_MSG(sc, "Allocating a new exe_queue element");
        return ECORE_ZALLOC(sizeof(struct ecore_exeq_elem), GFP_ATOMIC, sc);
 }
 
 /************************ raw_obj functions ***********************************/
-static int ecore_raw_check_pending(struct ecore_raw_obj *o)
+static bool ecore_raw_check_pending(struct ecore_raw_obj *o)
 {
        /*
         * !! converts the value returned by ECORE_TEST_BIT such that it
@@ -292,26 +290,30 @@ static int ecore_state_wait(struct bnx2x_softc *sc, int state,
        if (CHIP_REV_IS_EMUL(sc))
                cnt *= 20;
 
-       ECORE_MSG("waiting for state to become %d", state);
+       ECORE_MSG(sc, "waiting for state to become %d", state);
 
        ECORE_MIGHT_SLEEP();
        while (cnt--) {
-               bnx2x_intr_legacy(sc, 1);
+               bnx2x_intr_legacy(sc);
                if (!ECORE_TEST_BIT(state, pstate)) {
 #ifdef ECORE_STOP_ON_ERROR
-                       ECORE_MSG("exit  (cnt %d)", 5000 - cnt);
+                       ECORE_MSG(sc, "exit  (cnt %d)", 5000 - cnt);
 #endif
+                       rte_atomic32_set(&sc->scan_fp, 0);
                        return ECORE_SUCCESS;
                }
 
                ECORE_WAIT(sc, delay_us);
 
-               if (sc->panic)
+               if (sc->panic) {
+                       rte_atomic32_set(&sc->scan_fp, 0);
                        return ECORE_IO;
+               }
        }
 
        /* timeout! */
-       PMD_DRV_LOG(ERR, "timeout waiting for state %d", state);
+       PMD_DRV_LOG(ERR, sc, "timeout waiting for state %d", state);
+       rte_atomic32_set(&sc->scan_fp, 0);
 #ifdef ECORE_STOP_ON_ERROR
        ecore_panic();
 #endif
@@ -326,7 +328,7 @@ static int ecore_raw_wait(struct bnx2x_softc *sc, struct ecore_raw_obj *raw)
 
 /***************** Classification verbs: Set/Del MAC/VLAN/VLAN-MAC ************/
 /* credit handling callbacks */
-static int ecore_get_cam_offset_mac(struct ecore_vlan_mac_obj *o, int *offset)
+static bool ecore_get_cam_offset_mac(struct ecore_vlan_mac_obj *o, int *offset)
 {
        struct ecore_credit_pool_obj *mp = o->macs_pool;
 
@@ -335,7 +337,7 @@ static int ecore_get_cam_offset_mac(struct ecore_vlan_mac_obj *o, int *offset)
        return mp->get_entry(mp, offset);
 }
 
-static int ecore_get_credit_mac(struct ecore_vlan_mac_obj *o)
+static bool ecore_get_credit_mac(struct ecore_vlan_mac_obj *o)
 {
        struct ecore_credit_pool_obj *mp = o->macs_pool;
 
@@ -344,14 +346,14 @@ static int ecore_get_credit_mac(struct ecore_vlan_mac_obj *o)
        return mp->get(mp, 1);
 }
 
-static int ecore_put_cam_offset_mac(struct ecore_vlan_mac_obj *o, int offset)
+static bool ecore_put_cam_offset_mac(struct ecore_vlan_mac_obj *o, int offset)
 {
        struct ecore_credit_pool_obj *mp = o->macs_pool;
 
        return mp->put_entry(mp, offset);
 }
 
-static int ecore_put_credit_mac(struct ecore_vlan_mac_obj *o)
+static bool ecore_put_credit_mac(struct ecore_vlan_mac_obj *o)
 {
        struct ecore_credit_pool_obj *mp = o->macs_pool;
 
@@ -372,11 +374,11 @@ static int __ecore_vlan_mac_h_write_trylock(struct bnx2x_softc *sc __rte_unused,
                                            struct ecore_vlan_mac_obj *o)
 {
        if (o->head_reader) {
-               ECORE_MSG("vlan_mac_lock writer - There are readers; Busy");
+               ECORE_MSG(sc, "vlan_mac_lock writer - There are readers; Busy");
                return ECORE_BUSY;
        }
 
-       ECORE_MSG("vlan_mac_lock writer - Taken");
+       ECORE_MSG(sc, "vlan_mac_lock writer - Taken");
        return ECORE_SUCCESS;
 }
 
@@ -396,13 +398,13 @@ static void __ecore_vlan_mac_h_exec_pending(struct bnx2x_softc *sc,
        int rc;
        unsigned long ramrod_flags = o->saved_ramrod_flags;
 
-       ECORE_MSG("vlan_mac_lock execute pending command with ramrod flags %lu",
+       ECORE_MSG(sc, "vlan_mac_lock execute pending command with ramrod flags %lu",
                  ramrod_flags);
        o->head_exe_request = FALSE;
        o->saved_ramrod_flags = 0;
        rc = ecore_exe_queue_step(sc, &o->exe_queue, &ramrod_flags);
        if (rc != ECORE_SUCCESS) {
-               PMD_DRV_LOG(ERR,
+               PMD_DRV_LOG(ERR, sc,
                            "execution of pending commands failed with rc %d",
                            rc);
 #ifdef ECORE_STOP_ON_ERROR
@@ -427,7 +429,7 @@ static void __ecore_vlan_mac_h_pend(struct bnx2x_softc *sc __rte_unused,
 {
        o->head_exe_request = TRUE;
        o->saved_ramrod_flags = ramrod_flags;
-       ECORE_MSG("Placing pending execution with ramrod flags %lu",
+       ECORE_MSG(sc, "Placing pending execution with ramrod flags %lu",
                  ramrod_flags);
 }
 
@@ -448,8 +450,8 @@ static void __ecore_vlan_mac_h_write_unlock(struct bnx2x_softc *sc,
         * executed. If so, execute again. [Ad infinitum]
         */
        while (o->head_exe_request) {
-               ECORE_MSG
-                   ("vlan_mac_lock - writer release encountered a pending request");
+               ECORE_MSG(sc,
+                         "vlan_mac_lock - writer release encountered a pending request");
                __ecore_vlan_mac_h_exec_pending(sc, o);
        }
 }
@@ -485,7 +487,8 @@ static int __ecore_vlan_mac_h_read_lock(struct bnx2x_softc *sc __rte_unused,
 {
        /* If we got here, we're holding lock --> no WRITER exists */
        o->head_reader++;
-       ECORE_MSG("vlan_mac_lock - locked reader - number %d", o->head_reader);
+       ECORE_MSG(sc,
+                 "vlan_mac_lock - locked reader - number %d", o->head_reader);
 
        return ECORE_SUCCESS;
 }
@@ -498,7 +501,7 @@ static int __ecore_vlan_mac_h_read_lock(struct bnx2x_softc *sc __rte_unused,
  *
  * @details May sleep. Claims and releases execution queue lock during its run.
  */
-static int ecore_vlan_mac_h_read_lock(struct bnx2x_softc *sc,
+int ecore_vlan_mac_h_read_lock(struct bnx2x_softc *sc,
                                      struct ecore_vlan_mac_obj *o)
 {
        int rc;
@@ -524,24 +527,22 @@ static void __ecore_vlan_mac_h_read_unlock(struct bnx2x_softc *sc,
                                           struct ecore_vlan_mac_obj *o)
 {
        if (!o->head_reader) {
-               PMD_DRV_LOG(ERR,
+               PMD_DRV_LOG(ERR, sc,
                            "Need to release vlan mac reader lock, but lock isn't taken");
 #ifdef ECORE_STOP_ON_ERROR
                ecore_panic();
 #endif
        } else {
                o->head_reader--;
-               PMD_DRV_LOG(INFO,
-                           "vlan_mac_lock - decreased readers to %d",
-                           o->head_reader);
+               ECORE_MSG(sc, "vlan_mac_lock - decreased readers to %d",
+                         o->head_reader);
        }
 
        /* It's possible a new pending execution was added, and that this reader
         * was last - if so we need to execute the command.
         */
        if (!o->head_reader && o->head_exe_request) {
-               PMD_DRV_LOG(INFO,
-                           "vlan_mac_lock - reader release encountered a pending request");
+               ECORE_MSG(sc, "vlan_mac_lock - reader release encountered a pending request");
 
                /* Writer release will do the trick */
                __ecore_vlan_mac_h_write_unlock(sc, o);
@@ -583,10 +584,10 @@ static int ecore_get_n_elements(struct bnx2x_softc *sc,
        uint8_t *next = base;
        int counter = 0, read_lock;
 
-       ECORE_MSG("get_n_elements - taking vlan_mac_lock (reader)");
+       ECORE_MSG(sc, "get_n_elements - taking vlan_mac_lock (reader)");
        read_lock = ecore_vlan_mac_h_read_lock(sc, o);
        if (read_lock != ECORE_SUCCESS)
-               PMD_DRV_LOG(ERR,
+               PMD_DRV_LOG(ERR, sc,
                            "get_n_elements failed to get vlan mac reader lock; Access without lock");
 
        /* traverse list */
@@ -595,15 +596,15 @@ static int ecore_get_n_elements(struct bnx2x_softc *sc,
                if (counter < n) {
                        ECORE_MEMCPY(next, &pos->u, size);
                        counter++;
-                       ECORE_MSG
-                           ("copied element number %d to address %p element was:",
+                           ECORE_MSG
+                           (sc, "copied element number %d to address %p element was:",
                             counter, next);
                        next += stride + size;
                }
        }
 
        if (read_lock == ECORE_SUCCESS) {
-               ECORE_MSG("get_n_elements - releasing vlan_mac_lock (reader)");
+               ECORE_MSG(sc, "get_n_elements - releasing vlan_mac_lock (reader)");
                ecore_vlan_mac_h_read_unlock(sc, o);
        }
 
@@ -617,7 +618,7 @@ static int ecore_check_mac_add(struct bnx2x_softc *sc __rte_unused,
 {
        struct ecore_vlan_mac_registry_elem *pos;
 
-       ECORE_MSG("Checking MAC %02x:%02x:%02x:%02x:%02x:%02x for ADD command",
+       ECORE_MSG(sc, "Checking MAC %02x:%02x:%02x:%02x:%02x:%02x for ADD command",
                  data->mac.mac[0], data->mac.mac[1], data->mac.mac[2],
                  data->mac.mac[3], data->mac.mac[4], data->mac.mac[5]);
 
@@ -646,7 +647,7 @@ static struct ecore_vlan_mac_registry_elem *ecore_check_mac_del(struct bnx2x_sof
 {
        struct ecore_vlan_mac_registry_elem *pos;
 
-       ECORE_MSG("Checking MAC %02x:%02x:%02x:%02x:%02x:%02x for DEL command",
+       ECORE_MSG(sc, "Checking MAC %02x:%02x:%02x:%02x:%02x:%02x for DEL command",
                  data->mac.mac[0], data->mac.mac[1], data->mac.mac[2],
                  data->mac.mac[3], data->mac.mac[4], data->mac.mac[5]);
 
@@ -660,7 +661,7 @@ static struct ecore_vlan_mac_registry_elem *ecore_check_mac_del(struct bnx2x_sof
 }
 
 /* check_move() callback */
-static int ecore_check_move(struct bnx2x_softc *sc,
+static bool ecore_check_move(struct bnx2x_softc *sc,
                            struct ecore_vlan_mac_obj *src_o,
                            struct ecore_vlan_mac_obj *dst_o,
                            union ecore_classification_ramrod_data *data)
@@ -685,7 +686,7 @@ static int ecore_check_move(struct bnx2x_softc *sc,
        return TRUE;
 }
 
-static int ecore_check_move_always_err(__rte_unused struct bnx2x_softc *sc,
+static bool ecore_check_move_always_err(__rte_unused struct bnx2x_softc *sc,
                                       __rte_unused struct ecore_vlan_mac_obj
                                       *src_o, __rte_unused struct ecore_vlan_mac_obj
                                       *dst_o, __rte_unused union
@@ -711,8 +712,8 @@ static uint8_t ecore_vlan_mac_get_rx_tx_flag(struct ecore_vlan_mac_obj
        return rx_tx_flag;
 }
 
-static void ecore_set_mac_in_nig(struct bnx2x_softc *sc,
-                                int add, unsigned char *dev_addr, int index)
+void ecore_set_mac_in_nig(struct bnx2x_softc *sc,
+                                bool add, unsigned char *dev_addr, int index)
 {
        uint32_t wb_data[2];
        uint32_t reg_offset = ECORE_PORT_ID(sc) ? NIG_REG_LLH1_FUNC_MEM :
@@ -724,7 +725,7 @@ static void ecore_set_mac_in_nig(struct bnx2x_softc *sc,
        if (index > ECORE_LLH_CAM_MAX_PF_LINE)
                return;
 
-       ECORE_MSG("Going to %s LLH configuration at entry %d",
+       ECORE_MSG(sc, "Going to %s LLH configuration at entry %d",
                  (add ? "ADD" : "DELETE"), index);
 
        if (add) {
@@ -753,7 +754,7 @@ static void ecore_set_mac_in_nig(struct bnx2x_softc *sc,
  *
  */
 static void ecore_vlan_mac_set_cmd_hdr_e2(struct ecore_vlan_mac_obj *o,
-                                         int add, int opcode,
+                                         bool add, int opcode,
                                          struct eth_classify_cmd_header
                                          *hdr)
 {
@@ -802,7 +803,7 @@ static void ecore_set_one_mac_e2(struct bnx2x_softc *sc,
            (struct eth_classify_rules_ramrod_data *)(raw->rdata);
        int rule_cnt = rule_idx + 1, cmd = elem->cmd_data.vlan_mac.cmd;
        union eth_classify_rule_cmd *rule_entry = &data->rules[rule_idx];
-       int add = (cmd == ECORE_VLAN_MAC_ADD) ? TRUE : FALSE;
+       bool add = (cmd == ECORE_VLAN_MAC_ADD) ? TRUE : FALSE;
        unsigned long *vlan_mac_flags = &elem->cmd_data.vlan_mac.vlan_mac_flags;
        uint8_t *mac = elem->cmd_data.vlan_mac.u.mac.mac;
 
@@ -840,7 +841,7 @@ static void ecore_set_one_mac_e2(struct bnx2x_softc *sc,
        ecore_vlan_mac_set_cmd_hdr_e2(o, add, CLASSIFY_RULE_OPCODE_MAC,
                                      &rule_entry->mac.header);
 
-       ECORE_MSG("About to %s MAC %02x:%02x:%02x:%02x:%02x:%02x for Queue %d",
+       ECORE_MSG(sc, "About to %s MAC %02x:%02x:%02x:%02x:%02x:%02x for Queue %d",
                  (add ? "add" : "delete"), mac[0], mac[1], mac[2], mac[3],
                  mac[4], mac[5], raw->cl_id);
 
@@ -945,7 +946,7 @@ static void ecore_vlan_mac_set_rdata_e1x(struct bnx2x_softc *sc
        ecore_vlan_mac_set_cfg_entry_e1x(o, add, opcode, mac, vlan_id,
                                         cfg_entry);
 
-       ECORE_MSG("%s MAC %02x:%02x:%02x:%02x:%02x:%02x CLID %d CAM offset %d",
+       ECORE_MSG(sc, "%s MAC %02x:%02x:%02x:%02x:%02x:%02x CLID %d CAM offset %d",
                  (add ? "setting" : "clearing"),
                  mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
                  o->raw.cl_id, cam_offset);
@@ -1090,8 +1091,8 @@ static int ecore_validate_vlan_mac_add(struct bnx2x_softc *sc,
        /* Check the registry */
        rc = o->check_add(sc, o, &elem->cmd_data.vlan_mac.u);
        if (rc) {
-               ECORE_MSG
-                   ("ADD command is not allowed considering current registry state.");
+               ECORE_MSG(sc,
+                         "ADD command is not allowed considering current registry state.");
                return rc;
        }
 
@@ -1099,7 +1100,7 @@ static int ecore_validate_vlan_mac_add(struct bnx2x_softc *sc,
         * MAC/VLAN/VLAN-MAC. Return an error if there is.
         */
        if (exeq->get(exeq, elem)) {
-               ECORE_MSG("There is a pending ADD command already");
+               ECORE_MSG(sc, "There is a pending ADD command already");
                return ECORE_EXISTS;
        }
 
@@ -1138,8 +1139,8 @@ static int ecore_validate_vlan_mac_del(struct bnx2x_softc *sc,
         */
        pos = o->check_del(sc, o, &elem->cmd_data.vlan_mac.u);
        if (!pos) {
-               ECORE_MSG
-                   ("DEL command is not allowed considering current registry state");
+               ECORE_MSG(sc,
+                         "DEL command is not allowed considering current registry state");
                return ECORE_EXISTS;
        }
 
@@ -1151,13 +1152,13 @@ static int ecore_validate_vlan_mac_del(struct bnx2x_softc *sc,
        /* Check for MOVE commands */
        query_elem.cmd_data.vlan_mac.cmd = ECORE_VLAN_MAC_MOVE;
        if (exeq->get(exeq, &query_elem)) {
-               PMD_DRV_LOG(ERR, "There is a pending MOVE command already");
+               PMD_DRV_LOG(ERR, sc, "There is a pending MOVE command already");
                return ECORE_INVAL;
        }
 
        /* Check for DEL commands */
        if (exeq->get(exeq, elem)) {
-               ECORE_MSG("There is a pending DEL command already");
+               ECORE_MSG(sc, "There is a pending DEL command already");
                return ECORE_EXISTS;
        }
 
@@ -1165,7 +1166,7 @@ static int ecore_validate_vlan_mac_del(struct bnx2x_softc *sc,
        if (!(ECORE_TEST_BIT(ECORE_DONT_CONSUME_CAM_CREDIT,
                             &elem->cmd_data.vlan_mac.vlan_mac_flags) ||
              o->put_credit(o))) {
-               PMD_DRV_LOG(ERR, "Failed to return a credit");
+               PMD_DRV_LOG(ERR, sc, "Failed to return a credit");
                return ECORE_INVAL;
        }
 
@@ -1198,8 +1199,8 @@ static int ecore_validate_vlan_mac_move(struct bnx2x_softc *sc,
         * state.
         */
        if (!src_o->check_move(sc, src_o, dest_o, &elem->cmd_data.vlan_mac.u)) {
-               ECORE_MSG
-                   ("MOVE command is not allowed considering current registry state");
+               ECORE_MSG(sc,
+                         "MOVE command is not allowed considering current registry state");
                return ECORE_INVAL;
        }
 
@@ -1212,21 +1213,21 @@ static int ecore_validate_vlan_mac_move(struct bnx2x_softc *sc,
        /* Check DEL on source */
        query_elem.cmd_data.vlan_mac.cmd = ECORE_VLAN_MAC_DEL;
        if (src_exeq->get(src_exeq, &query_elem)) {
-               PMD_DRV_LOG(ERR,
+               PMD_DRV_LOG(ERR, sc,
                            "There is a pending DEL command on the source queue already");
                return ECORE_INVAL;
        }
 
        /* Check MOVE on source */
        if (src_exeq->get(src_exeq, elem)) {
-               ECORE_MSG("There is a pending MOVE command already");
+               ECORE_MSG(sc, "There is a pending MOVE command already");
                return ECORE_EXISTS;
        }
 
        /* Check ADD on destination */
        query_elem.cmd_data.vlan_mac.cmd = ECORE_VLAN_MAC_ADD;
        if (dest_exeq->get(dest_exeq, &query_elem)) {
-               PMD_DRV_LOG(ERR,
+               PMD_DRV_LOG(ERR, sc,
                            "There is a pending ADD command on the destination queue already");
                return ECORE_INVAL;
        }
@@ -1331,7 +1332,7 @@ static int __ecore_vlan_mac_execute_step(struct bnx2x_softc *sc,
 
        ECORE_SPIN_LOCK_BH(&o->exe_queue.lock);
 
-       ECORE_MSG("vlan_mac_execute_step - trying to take writer lock");
+       ECORE_MSG(sc, "vlan_mac_execute_step - trying to take writer lock");
        rc = __ecore_vlan_mac_h_write_trylock(sc, o);
 
        if (rc != ECORE_SUCCESS) {
@@ -1428,17 +1429,17 @@ static int ecore_optimize_vlan_mac(struct bnx2x_softc *sc,
                                    &pos->cmd_data.vlan_mac.vlan_mac_flags)) {
                        if ((query.cmd_data.vlan_mac.cmd ==
                             ECORE_VLAN_MAC_ADD) && !o->put_credit(o)) {
-                               PMD_DRV_LOG(ERR,
+                               PMD_DRV_LOG(ERR, sc,
                                            "Failed to return the credit for the optimized ADD command");
                                return ECORE_INVAL;
                        } else if (!o->get_credit(o)) { /* VLAN_MAC_DEL */
-                               PMD_DRV_LOG(ERR,
+                               PMD_DRV_LOG(ERR, sc,
                                            "Failed to recover the credit from the optimized DEL command");
                                return ECORE_INVAL;
                        }
                }
 
-               ECORE_MSG("Optimizing %s command",
+               ECORE_MSG(sc, "Optimizing %s command",
                          (elem->cmd_data.vlan_mac.cmd == ECORE_VLAN_MAC_ADD) ?
                          "ADD" : "DEL");
 
@@ -1488,7 +1489,7 @@ static int ecore_vlan_mac_get_registry_elem(struct bnx2x_softc *sc,
                        return ECORE_INVAL;
                }
 
-               ECORE_MSG("Got cam offset %d", reg_elem->cam_offset);
+               ECORE_MSG(sc, "Got cam offset %d", reg_elem->cam_offset);
 
                /* Set a VLAN-MAC data */
                ECORE_MEMCPY(&reg_elem->u, &elem->cmd_data.vlan_mac.u,
@@ -1697,8 +1698,8 @@ int ecore_config_vlan_mac(struct bnx2x_softc *sc,
                rc = ECORE_PENDING;
 
        if (ECORE_TEST_BIT(RAMROD_DRV_CLR_ONLY, ramrod_flags)) {
-               ECORE_MSG
-                   ("RAMROD_DRV_CLR_ONLY requested: clearing a pending bit.");
+               ECORE_MSG(sc,
+                         "RAMROD_DRV_CLR_ONLY requested: clearing a pending bit.");
                raw->clear_pending(raw);
        }
 
@@ -1777,7 +1778,7 @@ static int ecore_vlan_mac_del_all(struct bnx2x_softc *sc,
                    *vlan_mac_flags) {
                        rc = exeq->remove(sc, exeq->owner, exeq_pos);
                        if (rc) {
-                               PMD_DRV_LOG(ERR, "Failed to remove command");
+                               PMD_DRV_LOG(ERR, sc, "Failed to remove command");
                                ECORE_SPIN_UNLOCK_BH(&exeq->lock);
                                return rc;
                        }
@@ -1802,7 +1803,7 @@ static int ecore_vlan_mac_del_all(struct bnx2x_softc *sc,
        ECORE_CLEAR_BIT_NA(RAMROD_EXEC, &p.ramrod_flags);
        ECORE_CLEAR_BIT_NA(RAMROD_CONT, &p.ramrod_flags);
 
-       ECORE_MSG("vlan_mac_del_all -- taking vlan_mac_lock (reader)");
+       ECORE_MSG(sc, "vlan_mac_del_all -- taking vlan_mac_lock (reader)");
        read_lock = ecore_vlan_mac_h_read_lock(sc, o);
        if (read_lock != ECORE_SUCCESS)
                return read_lock;
@@ -1814,7 +1815,7 @@ static int ecore_vlan_mac_del_all(struct bnx2x_softc *sc,
                        ECORE_MEMCPY(&p.user_req.u, &pos->u, sizeof(pos->u));
                        rc = ecore_config_vlan_mac(sc, &p);
                        if (rc < 0) {
-                               PMD_DRV_LOG(ERR,
+                               PMD_DRV_LOG(ERR, sc,
                                            "Failed to add a new DEL command");
                                ecore_vlan_mac_h_read_unlock(sc, o);
                                return rc;
@@ -1822,7 +1823,7 @@ static int ecore_vlan_mac_del_all(struct bnx2x_softc *sc,
                }
        }
 
-       ECORE_MSG("vlan_mac_del_all -- releasing vlan_mac_lock (reader)");
+       ECORE_MSG(sc, "vlan_mac_del_all -- releasing vlan_mac_lock (reader)");
        ecore_vlan_mac_h_read_unlock(sc, o);
 
        p.ramrod_flags = *ramrod_flags;
@@ -2009,7 +2010,7 @@ static int ecore_set_rx_mode_e1x(struct bnx2x_softc *sc,
            mac_filters->unmatched_unicast | mask :
            mac_filters->unmatched_unicast & ~mask;
 
-       ECORE_MSG("drop_ucast 0x%xdrop_mcast 0x%x accp_ucast 0x%x"
+       ECORE_MSG(sc, "drop_ucast 0x%xdrop_mcast 0x%x accp_ucast 0x%x"
                  "accp_mcast 0x%xaccp_bcast 0x%x",
                  mac_filters->ucast_drop_all, mac_filters->mcast_drop_all,
                  mac_filters->ucast_accept_all, mac_filters->mcast_accept_all,
@@ -2155,8 +2156,8 @@ static int ecore_set_rx_mode_e2(struct bnx2x_softc *sc,
         */
        ecore_rx_mode_set_rdata_hdr_e2(p->cid, &data->header, rule_idx);
 
-       ECORE_MSG
-           ("About to configure %d rules, rx_accept_flags 0x%lx, tx_accept_flags 0x%lx",
+           ECORE_MSG
+           (sc, "About to configure %d rules, rx_accept_flags 0x%lx, tx_accept_flags 0x%lx",
             data->header.rule_cnt, p->rx_accept_flags, p->tx_accept_flags);
 
        /* No need for an explicit memory barrier here as long we would
@@ -2209,7 +2210,7 @@ int ecore_config_rx_mode(struct bnx2x_softc *sc,
                                return rc;
                }
        } else {
-               ECORE_MSG("ERROR: config_rx_mode is NULL");
+               ECORE_MSG(sc, "ERROR: config_rx_mode is NULL");
                return -1;
        }
 
@@ -2290,7 +2291,7 @@ static int ecore_mcast_enqueue_cmd(struct bnx2x_softc *sc __rte_unused,
        if (!new_cmd)
                return ECORE_NOMEM;
 
-       ECORE_MSG("About to enqueue a new %d command. macs_list_len=%d",
+       ECORE_MSG(sc, "About to enqueue a new %d command. macs_list_len=%d",
                  cmd, macs_list_len);
 
        ECORE_LIST_INIT(&new_cmd->data.macs_head);
@@ -2326,7 +2327,7 @@ static int ecore_mcast_enqueue_cmd(struct bnx2x_softc *sc __rte_unused,
 
        default:
                ECORE_FREE(sc, new_cmd, total_sz);
-               PMD_DRV_LOG(ERR, "Unknown command: %d", cmd);
+               PMD_DRV_LOG(ERR, sc, "Unknown command: %d", cmd);
                return ECORE_INVAL;
        }
 
@@ -2438,11 +2439,11 @@ static void ecore_mcast_set_one_rule_e2(struct bnx2x_softc *sc __rte_unused,
                break;
 
        default:
-               PMD_DRV_LOG(ERR, "Unknown command: %d", cmd);
+               PMD_DRV_LOG(ERR, sc, "Unknown command: %d", cmd);
                return;
        }
 
-       ECORE_MSG("%s bin %d",
+       ECORE_MSG(sc, "%s bin %d",
                  ((rx_tx_add_flag & ETH_MULTICAST_RULES_CMD_IS_ADD) ?
                   "Setting" : "Clearing"), bin);
 
@@ -2477,7 +2478,7 @@ static int ecore_mcast_handle_restore_cmd_e2(struct bnx2x_softc *sc,
 
                cnt++;
 
-               ECORE_MSG("About to configure a bin %d", cur_bin);
+               ECORE_MSG(sc, "About to configure a bin %d", cur_bin);
 
                /* Break if we reached the maximum number
                 * of rules.
@@ -2509,8 +2510,8 @@ static void ecore_mcast_hdl_pending_add_e2(struct bnx2x_softc *sc,
 
                cnt++;
 
-               ECORE_MSG
-                   ("About to configure %02x:%02x:%02x:%02x:%02x:%02x mcast MAC",
+                   ECORE_MSG
+                   (sc, "About to configure %02x:%02x:%02x:%02x:%02x:%02x mcast MAC",
                     pmac_pos->mac[0], pmac_pos->mac[1], pmac_pos->mac[2],
                     pmac_pos->mac[3], pmac_pos->mac[4], pmac_pos->mac[5]);
 
@@ -2545,7 +2546,7 @@ static void ecore_mcast_hdl_pending_del_e2(struct bnx2x_softc *sc,
 
                cmd_pos->data.macs_num--;
 
-               ECORE_MSG("Deleting MAC. %d left,cnt is %d",
+               ECORE_MSG(sc, "Deleting MAC. %d left,cnt is %d",
                          cmd_pos->data.macs_num, cnt);
 
                /* Break if we reached the maximum
@@ -2604,7 +2605,8 @@ static int ecore_mcast_handle_pending_cmds_e2(struct bnx2x_softc *sc, struct
                        break;
 
                default:
-                       PMD_DRV_LOG(ERR, "Unknown command: %d", cmd_pos->type);
+                       PMD_DRV_LOG(ERR, sc,
+                                   "Unknown command: %d", cmd_pos->type);
                        return ECORE_INVAL;
                }
 
@@ -2641,8 +2643,8 @@ static void ecore_mcast_hdl_add(struct bnx2x_softc *sc,
 
                cnt++;
 
-               ECORE_MSG
-                   ("About to configure %02x:%02x:%02x:%02x:%02x:%02x mcast MAC",
+                   ECORE_MSG
+                   (sc, "About to configure %02x:%02x:%02x:%02x:%02x:%02x mcast MAC",
                     mlist_pos->mac[0], mlist_pos->mac[1], mlist_pos->mac[2],
                     mlist_pos->mac[3], mlist_pos->mac[4], mlist_pos->mac[5]);
        }
@@ -2662,7 +2664,8 @@ static void ecore_mcast_hdl_del(struct bnx2x_softc *sc,
 
                cnt++;
 
-               ECORE_MSG("Deleting MAC. %d left", p->mcast_list_len - i - 1);
+               ECORE_MSG(sc,
+                         "Deleting MAC. %d left", p->mcast_list_len - i - 1);
        }
 
        *line_idx = cnt;
@@ -2688,7 +2691,7 @@ static int ecore_mcast_handle_current_cmd(struct bnx2x_softc *sc, struct
        struct ecore_mcast_obj *o = p->mcast_obj;
        int cnt = start_cnt;
 
-       ECORE_MSG("p->mcast_list_len=%d", p->mcast_list_len);
+       ECORE_MSG(sc, "p->mcast_list_len=%d", p->mcast_list_len);
 
        switch (cmd) {
        case ECORE_MCAST_CMD_ADD:
@@ -2704,7 +2707,7 @@ static int ecore_mcast_handle_current_cmd(struct bnx2x_softc *sc, struct
                break;
 
        default:
-               PMD_DRV_LOG(ERR, "Unknown command: %d", cmd);
+               PMD_DRV_LOG(ERR, sc, "Unknown command: %d", cmd);
                return ECORE_INVAL;
        }
 
@@ -2749,7 +2752,7 @@ static int ecore_mcast_validate_e2(__rte_unused struct bnx2x_softc *sc,
                break;
 
        default:
-               PMD_DRV_LOG(ERR, "Unknown command: %d", cmd);
+               PMD_DRV_LOG(ERR, sc, "Unknown command: %d", cmd);
                return ECORE_INVAL;
        }
 
@@ -2761,12 +2764,16 @@ static int ecore_mcast_validate_e2(__rte_unused struct bnx2x_softc *sc,
 
 static void ecore_mcast_revert_e2(__rte_unused struct bnx2x_softc *sc,
                                  struct ecore_mcast_ramrod_params *p,
-                                 int old_num_bins)
+                                 int old_num_bins,
+                                 enum ecore_mcast_cmd cmd)
 {
        struct ecore_mcast_obj *o = p->mcast_obj;
 
        o->set_registry_size(o, old_num_bins);
        o->total_pending_num -= p->mcast_list_len;
+
+       if (cmd == ECORE_MCAST_CMD_SET)
+               o->total_pending_num -= o->max_cmd_len;
 }
 
 /**
@@ -2912,7 +2919,8 @@ static int ecore_mcast_validate_e1h(__rte_unused struct bnx2x_softc *sc,
 
 static void ecore_mcast_revert_e1h(__rte_unused struct bnx2x_softc *sc,
                                   __rte_unused struct ecore_mcast_ramrod_params
-                                  *p, __rte_unused int old_num_bins)
+                                  *p, __rte_unused int old_num_bins,
+                                  __rte_unused enum ecore_mcast_cmd cmd)
 {
        /* Do nothing */
 }
@@ -2935,8 +2943,8 @@ static void ecore_mcast_hdl_add_e1h(struct bnx2x_softc *sc __rte_unused,
                bit = ecore_mcast_bin_from_mac(mlist_pos->mac);
                ECORE_57711_SET_MC_FILTER(mc_filter, bit);
 
-               ECORE_MSG
-                   ("About to configure %02x:%02x:%02x:%02x:%02x:%02x mcast MAC, bin %d",
+                   ECORE_MSG
+                   (sc, "About to configure %02x:%02x:%02x:%02x:%02x:%02x mcast MAC, bin %d",
                     mlist_pos->mac[0], mlist_pos->mac[1], mlist_pos->mac[2],
                     mlist_pos->mac[3], mlist_pos->mac[4], mlist_pos->mac[5],
                     bit);
@@ -2956,7 +2964,7 @@ static void ecore_mcast_hdl_restore_e1h(struct bnx2x_softc *sc
        for (bit = ecore_mcast_get_next_bin(o, 0);
             bit >= 0; bit = ecore_mcast_get_next_bin(o, bit + 1)) {
                ECORE_57711_SET_MC_FILTER(mc_filter, bit);
-               ECORE_MSG("About to set bin %d", bit);
+               ECORE_MSG(sc, "About to set bin %d", bit);
        }
 }
 
@@ -2987,7 +2995,7 @@ static int ecore_mcast_setup_e1h(struct bnx2x_softc *sc,
                        break;
 
                case ECORE_MCAST_CMD_DEL:
-                       ECORE_MSG("Invalidating multicast MACs configuration");
+                       ECORE_MSG(sc, "Invalidating multicast MACs configuration");
 
                        /* clear the registry */
                        ECORE_MEMSET(o->registry.aprox_match.vec, 0,
@@ -2999,7 +3007,7 @@ static int ecore_mcast_setup_e1h(struct bnx2x_softc *sc,
                        break;
 
                default:
-                       PMD_DRV_LOG(ERR, "Unknown command: %d", cmd);
+                       PMD_DRV_LOG(ERR, sc, "Unknown command: %d", cmd);
                        return ECORE_INVAL;
                }
 
@@ -3050,8 +3058,8 @@ int ecore_config_mcast(struct bnx2x_softc *sc,
        if ((!p->mcast_list_len) && (!o->check_sched(o)))
                return ECORE_SUCCESS;
 
-       ECORE_MSG
-           ("o->total_pending_num=%d p->mcast_list_len=%d o->max_cmd_len=%d",
+           ECORE_MSG
+           (sc, "o->total_pending_num=%d p->mcast_list_len=%d o->max_cmd_len=%d",
             o->total_pending_num, p->mcast_list_len, o->max_cmd_len);
 
        /* Enqueue the current command to the pending list if we can't complete
@@ -3090,7 +3098,7 @@ error_exit2:
        r->clear_pending(r);
 
 error_exit1:
-       o->revert(sc, p, old_reg_size);
+       o->revert(sc, p, old_reg_size, cmd);
 
        return rc;
 }
@@ -3109,12 +3117,12 @@ static void ecore_mcast_set_sched(struct ecore_mcast_obj *o)
        ECORE_SMP_MB_AFTER_CLEAR_BIT();
 }
 
-static int ecore_mcast_check_sched(struct ecore_mcast_obj *o)
+static bool ecore_mcast_check_sched(struct ecore_mcast_obj *o)
 {
        return ! !ECORE_TEST_BIT(o->sched_state, o->raw.pstate);
 }
 
-static int ecore_mcast_check_pending(struct ecore_mcast_obj *o)
+static bool ecore_mcast_check_pending(struct ecore_mcast_obj *o)
 {
        return o->raw.check_pending(&o->raw) || o->check_sched(o);
 }
@@ -3187,7 +3195,7 @@ void ecore_init_mcast_obj(struct bnx2x_softc *sc,
  * returns TRUE if (v + a) was less than u, and FALSE otherwise.
  *
  */
-static int __atomic_add_ifless(ecore_atomic_t * v, int a, int u)
+static bool __atomic_add_ifless(ecore_atomic_t *v, int a, int u)
 {
        int c, old;
 
@@ -3215,7 +3223,7 @@ static int __atomic_add_ifless(ecore_atomic_t * v, int a, int u)
  * returns TRUE if (v - a) was more or equal than u, and FALSE
  * otherwise.
  */
-static int __atomic_dec_ifmoe(ecore_atomic_t * v, int a, int u)
+static bool __atomic_dec_ifmoe(ecore_atomic_t *v, int a, int u)
 {
        int c, old;
 
@@ -3233,9 +3241,9 @@ static int __atomic_dec_ifmoe(ecore_atomic_t * v, int a, int u)
        return TRUE;
 }
 
-static int ecore_credit_pool_get(struct ecore_credit_pool_obj *o, int cnt)
+static bool ecore_credit_pool_get(struct ecore_credit_pool_obj *o, int cnt)
 {
-       int rc;
+       bool rc;
 
        ECORE_SMP_MB();
        rc = __atomic_dec_ifmoe(&o->credit, cnt, 0);
@@ -3244,9 +3252,9 @@ static int ecore_credit_pool_get(struct ecore_credit_pool_obj *o, int cnt)
        return rc;
 }
 
-static int ecore_credit_pool_put(struct ecore_credit_pool_obj *o, int cnt)
+static bool ecore_credit_pool_put(struct ecore_credit_pool_obj *o, int cnt)
 {
-       int rc;
+       bool rc;
 
        ECORE_SMP_MB();
 
@@ -3268,14 +3276,14 @@ static int ecore_credit_pool_check(struct ecore_credit_pool_obj *o)
        return cur_credit;
 }
 
-static int ecore_credit_pool_always_TRUE(__rte_unused struct
+static bool ecore_credit_pool_always_TRUE(__rte_unused struct
                                         ecore_credit_pool_obj *o,
                                         __rte_unused int cnt)
 {
        return TRUE;
 }
 
-static int ecore_credit_pool_get_entry(struct ecore_credit_pool_obj *o,
+static bool ecore_credit_pool_get_entry(struct ecore_credit_pool_obj *o,
                                       int *offset)
 {
        int idx, vec, i;
@@ -3304,7 +3312,7 @@ static int ecore_credit_pool_get_entry(struct ecore_credit_pool_obj *o,
        return FALSE;
 }
 
-static int ecore_credit_pool_put_entry(struct ecore_credit_pool_obj *o,
+static bool ecore_credit_pool_put_entry(struct ecore_credit_pool_obj *o,
                                       int offset)
 {
        if (offset < o->base_pool_offset)
@@ -3321,14 +3329,14 @@ static int ecore_credit_pool_put_entry(struct ecore_credit_pool_obj *o,
        return TRUE;
 }
 
-static int ecore_credit_pool_put_entry_always_TRUE(__rte_unused struct
+static bool ecore_credit_pool_put_entry_always_TRUE(__rte_unused struct
                                                   ecore_credit_pool_obj *o,
                                                   __rte_unused int offset)
 {
        return TRUE;
 }
 
-static int ecore_credit_pool_get_entry_always_TRUE(__rte_unused struct
+static bool ecore_credit_pool_get_entry_always_TRUE(__rte_unused struct
                                                   ecore_credit_pool_obj *o,
                                                   __rte_unused int *offset)
 {
@@ -3347,7 +3355,7 @@ static int ecore_credit_pool_get_entry_always_TRUE(__rte_unused struct
  * If credit is negative pool operations will always succeed (unlimited pool).
  *
  */
-static void ecore_init_credit_pool(struct ecore_credit_pool_obj *p,
+void ecore_init_credit_pool(struct ecore_credit_pool_obj *p,
                                   int base, int credit)
 {
        /* Zero the object first */
@@ -3480,7 +3488,7 @@ static int ecore_setup_rss(struct bnx2x_softc *sc,
 
        ECORE_MEMSET(data, 0, sizeof(*data));
 
-       ECORE_MSG("Configuring RSS");
+       ECORE_MSG(sc, "Configuring RSS");
 
        /* Set an echo field */
        data->echo = ECORE_CPU_TO_LE32((r->cid & ECORE_SWCID_MASK) |
@@ -3494,7 +3502,7 @@ static int ecore_setup_rss(struct bnx2x_softc *sc,
 
        data->rss_mode = rss_mode;
 
-       ECORE_MSG("rss_mode=%d", rss_mode);
+       ECORE_MSG(sc, "rss_mode=%d", rss_mode);
 
        /* RSS capabilities */
        if (ECORE_TEST_BIT(ECORE_RSS_IPV4, &p->rss_flags))
@@ -3521,20 +3529,13 @@ static int ecore_setup_rss(struct bnx2x_softc *sc,
                data->capabilities |=
                    ETH_RSS_UPDATE_RAMROD_DATA_IPV6_UDP_CAPABILITY;
 
-       if (ECORE_TEST_BIT(ECORE_RSS_TUNNELING, &p->rss_flags)) {
-               data->udp_4tuple_dst_port_mask =
-                   ECORE_CPU_TO_LE16(p->tunnel_mask);
-               data->udp_4tuple_dst_port_value =
-                   ECORE_CPU_TO_LE16(p->tunnel_value);
-       }
-
        /* Hashing mask */
        data->rss_result_mask = p->rss_result_mask;
 
        /* RSS engine ID */
        data->rss_engine_id = o->engine_id;
 
-       ECORE_MSG("rss_engine_id=%d", data->rss_engine_id);
+       ECORE_MSG(sc, "rss_engine_id=%d", data->rss_engine_id);
 
        /* Indirection table */
        ECORE_MEMCPY(data->indirection_table, p->ind_table,
@@ -3592,11 +3593,13 @@ int ecore_config_rss(struct bnx2x_softc *sc, struct ecore_config_rss_params *p)
        return rc;
 }
 
-void ecore_init_rss_config_obj(struct ecore_rss_config_obj *rss_obj,
+void ecore_init_rss_config_obj(struct bnx2x_softc *sc __rte_unused,
+                              struct ecore_rss_config_obj *rss_obj,
                               uint8_t cl_id, uint32_t cid, uint8_t func_id,
-                              uint8_t engine_id, void *rdata,
-                              ecore_dma_addr_t rdata_mapping, int state,
-                              unsigned long *pstate, ecore_obj_type type)
+                              uint8_t engine_id,
+                              void *rdata, ecore_dma_addr_t rdata_mapping,
+                              int state, unsigned long *pstate,
+                              ecore_obj_type type)
 {
        ecore_init_raw_obj(&rss_obj->raw, cl_id, cid, func_id, rdata,
                           rdata_mapping, state, pstate, type);
@@ -3629,15 +3632,15 @@ int ecore_queue_state_change(struct bnx2x_softc *sc,
        /* Check that the requested transition is legal */
        rc = o->check_transition(sc, o, params);
        if (rc) {
-               PMD_DRV_LOG(ERR, "check transition returned an error. rc %d",
+               PMD_DRV_LOG(ERR, sc, "check transition returned an error. rc %d",
                            rc);
                return ECORE_INVAL;
        }
 
        /* Set "pending" bit */
-       ECORE_MSG("pending bit was=%lx", o->pending);
+       ECORE_MSG(sc, "pending bit was=%lx", o->pending);
        pending_bit = o->set_pending(o, params);
-       ECORE_MSG("pending bit now=%lx", o->pending);
+       ECORE_MSG(sc, "pending bit now=%lx", o->pending);
 
        /* Don't send a command if only driver cleanup was requested */
        if (ECORE_TEST_BIT(RAMROD_DRV_CLR_ONLY, &params->ramrod_flags))
@@ -3704,7 +3707,7 @@ static int ecore_queue_comp_cmd(struct bnx2x_softc *sc __rte_unused,
        unsigned long cur_pending = o->pending;
 
        if (!ECORE_TEST_AND_CLEAR_BIT(cmd, &cur_pending)) {
-               PMD_DRV_LOG(ERR,
+               PMD_DRV_LOG(ERR, sc,
                            "Bad MC reply %d for queue %d in state %d pending 0x%lx, next_state %d",
                            cmd, o->cids[ECORE_PRIMARY_CID_INDEX], o->state,
                            cur_pending, o->next_state);
@@ -3715,15 +3718,15 @@ static int ecore_queue_comp_cmd(struct bnx2x_softc *sc __rte_unused,
                /* >= because tx only must always be smaller than cos since the
                 * primary connection supports COS 0
                 */
-               PMD_DRV_LOG(ERR,
+               PMD_DRV_LOG(ERR, sc,
                            "illegal value for next tx_only: %d. max cos was %d",
                            o->next_tx_only, o->max_cos);
 
-       ECORE_MSG("Completing command %d for queue %d, setting state to %d",
+       ECORE_MSG(sc, "Completing command %d for queue %d, setting state to %d",
                  cmd, o->cids[ECORE_PRIMARY_CID_INDEX], o->next_state);
 
        if (o->next_tx_only)    /* print num tx-only if any exist */
-               ECORE_MSG("primary cid %d: num tx-only cons %d",
+               ECORE_MSG(sc, "primary cid %d: num tx-only cons %d",
                          o->cids[ECORE_PRIMARY_CID_INDEX], o->next_tx_only);
 
        o->state = o->next_state;
@@ -3784,7 +3787,7 @@ static void ecore_q_fill_init_general_data(struct bnx2x_softc *sc __rte_unused,
            ECORE_TEST_BIT(ECORE_Q_FLG_FCOE, flags) ?
            LLFC_TRAFFIC_TYPE_FCOE : LLFC_TRAFFIC_TYPE_NW;
 
-       ECORE_MSG("flags: active %d, cos %d, stats en %d",
+       ECORE_MSG(sc, "flags: active %d, cos %d, stats en %d",
                  gen_data->activate_flg, gen_data->cos,
                  gen_data->statistics_en_flg);
 }
@@ -3925,7 +3928,7 @@ static void ecore_q_fill_setup_tx_only(struct bnx2x_softc *sc, struct ecore_queu
        ecore_q_fill_init_tx_data(&cmd_params->params.tx_only.txq_params,
                                  &data->tx, &cmd_params->params.tx_only.flags);
 
-       ECORE_MSG("cid %d, tx bd page lo %x hi %x",
+       ECORE_MSG(sc, "cid %d, tx bd page lo %x hi %x",
                  cmd_params->q_obj->cids[0],
                  data->tx.tx_bd_page_base.lo, data->tx.tx_bd_page_base.hi);
 }
@@ -3975,9 +3978,9 @@ static int ecore_q_init(struct bnx2x_softc *sc,
 
        /* Set CDU context validation values */
        for (cos = 0; cos < o->max_cos; cos++) {
-               ECORE_MSG("setting context validation. cid %d, cos %d",
+               ECORE_MSG(sc, "setting context validation. cid %d, cos %d",
                          o->cids[cos], cos);
-               ECORE_MSG("context pointer %p", init->cxts[cos]);
+               ECORE_MSG(sc, "context pointer %p", init->cxts[cos]);
                ECORE_SET_CTX_VALIDATION(sc, init->cxts[cos], o->cids[cos]);
        }
 
@@ -4061,15 +4064,15 @@ static int ecore_q_send_setup_tx_only(struct bnx2x_softc *sc, struct ecore_queue
 
        if (ECORE_TEST_BIT(ECORE_Q_TYPE_FWD, &o->type))
                ramrod = RAMROD_CMD_ID_ETH_FORWARD_SETUP;
-       ECORE_MSG("sending forward tx-only ramrod");
+       ECORE_MSG(sc, "sending forward tx-only ramrod");
 
        if (cid_index >= o->max_cos) {
-               PMD_DRV_LOG(ERR, "queue[%d]: cid_index (%d) is out of range",
+               PMD_DRV_LOG(ERR, sc, "queue[%d]: cid_index (%d) is out of range",
                            o->cl_id, cid_index);
                return ECORE_INVAL;
        }
 
-       ECORE_MSG("parameters received: cos: %d sp-id: %d",
+       ECORE_MSG(sc, "parameters received: cos: %d sp-id: %d",
                  tx_only_params->gen_params.cos,
                  tx_only_params->gen_params.spcl_id);
 
@@ -4079,8 +4082,8 @@ static int ecore_q_send_setup_tx_only(struct bnx2x_softc *sc, struct ecore_queue
        /* Fill the ramrod data */
        ecore_q_fill_setup_tx_only(sc, params, rdata);
 
-       ECORE_MSG
-           ("sending tx-only ramrod: cid %d, client-id %d, sp-client id %d, cos %d",
+           ECORE_MSG
+           (sc, "sending tx-only ramrod: cid %d, client-id %d, sp-client id %d, cos %d",
             o->cids[cid_index], rdata->general.client_id,
             rdata->general.sp_client_id, rdata->general.cos);
 
@@ -4175,7 +4178,7 @@ static int ecore_q_send_update(struct bnx2x_softc *sc,
        uint8_t cid_index = update_params->cid_index;
 
        if (cid_index >= o->max_cos) {
-               PMD_DRV_LOG(ERR, "queue[%d]: cid_index (%d) is out of range",
+               PMD_DRV_LOG(ERR, sc, "queue[%d]: cid_index (%d) is out of range",
                            o->cl_id, cid_index);
                return ECORE_INVAL;
        }
@@ -4269,7 +4272,7 @@ static int ecore_q_send_cfc_del(struct bnx2x_softc *sc,
        uint8_t cid_idx = params->params.cfc_del.cid_index;
 
        if (cid_idx >= o->max_cos) {
-               PMD_DRV_LOG(ERR, "queue[%d]: cid_index (%d) is out of range",
+               PMD_DRV_LOG(ERR, sc, "queue[%d]: cid_index (%d) is out of range",
                            o->cl_id, cid_idx);
                return ECORE_INVAL;
        }
@@ -4285,7 +4288,7 @@ static int ecore_q_send_terminate(struct bnx2x_softc *sc, struct ecore_queue_sta
        uint8_t cid_index = params->params.terminate.cid_index;
 
        if (cid_index >= o->max_cos) {
-               PMD_DRV_LOG(ERR, "queue[%d]: cid_index (%d) is out of range",
+               PMD_DRV_LOG(ERR, sc, "queue[%d]: cid_index (%d) is out of range",
                            o->cl_id, cid_index);
                return ECORE_INVAL;
        }
@@ -4329,7 +4332,7 @@ static int ecore_queue_send_cmd_cmn(struct bnx2x_softc *sc, struct ecore_queue_s
        case ECORE_Q_CMD_EMPTY:
                return ecore_q_send_empty(sc, params);
        default:
-               PMD_DRV_LOG(ERR, "Unknown command: %d", params->cmd);
+               PMD_DRV_LOG(ERR, sc, "Unknown command: %d", params->cmd);
                return ECORE_INVAL;
        }
 }
@@ -4352,7 +4355,7 @@ static int ecore_queue_send_cmd_e1x(struct bnx2x_softc *sc,
        case ECORE_Q_CMD_EMPTY:
                return ecore_queue_send_cmd_cmn(sc, params);
        default:
-               PMD_DRV_LOG(ERR, "Unknown command: %d", params->cmd);
+               PMD_DRV_LOG(ERR, sc, "Unknown command: %d", params->cmd);
                return ECORE_INVAL;
        }
 }
@@ -4375,7 +4378,7 @@ static int ecore_queue_send_cmd_e2(struct bnx2x_softc *sc,
        case ECORE_Q_CMD_EMPTY:
                return ecore_queue_send_cmd_cmn(sc, params);
        default:
-               PMD_DRV_LOG(ERR, "Unknown command: %d", params->cmd);
+               PMD_DRV_LOG(ERR, sc, "Unknown command: %d", params->cmd);
                return ECORE_INVAL;
        }
 }
@@ -4418,7 +4421,7 @@ static int ecore_queue_chk_transition(struct bnx2x_softc *sc __rte_unused,
         * the previous one.
         */
        if (o->pending) {
-               PMD_DRV_LOG(ERR, "Blocking transition since pending was %lx",
+               PMD_DRV_LOG(ERR, sc, "Blocking transition since pending was %lx",
                            o->pending);
                return ECORE_BUSY;
        }
@@ -4545,19 +4548,19 @@ static int ecore_queue_chk_transition(struct bnx2x_softc *sc __rte_unused,
 
                break;
        default:
-               PMD_DRV_LOG(ERR, "Illegal state: %d", state);
+               PMD_DRV_LOG(ERR, sc, "Illegal state: %d", state);
        }
 
        /* Transition is assured */
        if (next_state != ECORE_Q_STATE_MAX) {
-               ECORE_MSG("Good state transition: %d(%d)->%d",
+               ECORE_MSG(sc, "Good state transition: %d(%d)->%d",
                          state, cmd, next_state);
                o->next_state = next_state;
                o->next_tx_only = next_tx_only;
                return ECORE_SUCCESS;
        }
 
-       ECORE_MSG("Bad state transition request: %d %d", state, cmd);
+       ECORE_MSG(sc, "Bad state transition request: %d %d", state, cmd);
 
        return ECORE_INVAL;
 }
@@ -4608,18 +4611,18 @@ static int ecore_queue_chk_fwd_transition(struct bnx2x_softc *sc __rte_unused,
 
                break;
        default:
-               PMD_DRV_LOG(ERR, "Illegal state: %d", state);
+               PMD_DRV_LOG(ERR, sc, "Illegal state: %d", state);
        }
 
        /* Transition is assured */
        if (next_state != ECORE_Q_STATE_MAX) {
-               ECORE_MSG("Good state transition: %d(%d)->%d",
+               ECORE_MSG(sc, "Good state transition: %d(%d)->%d",
                          state, cmd, next_state);
                o->next_state = next_state;
                return ECORE_SUCCESS;
        }
 
-       ECORE_MSG("Bad state transition request: %d %d", state, cmd);
+       ECORE_MSG(sc, "Bad state transition request: %d %d", state, cmd);
        return ECORE_INVAL;
 }
 
@@ -4699,14 +4702,14 @@ ecore_func_state_change_comp(struct bnx2x_softc *sc __rte_unused,
        unsigned long cur_pending = o->pending;
 
        if (!ECORE_TEST_AND_CLEAR_BIT(cmd, &cur_pending)) {
-               PMD_DRV_LOG(ERR,
+               PMD_DRV_LOG(ERR, sc,
                            "Bad MC reply %d for func %d in state %d pending 0x%lx, next_state %d",
                            cmd, ECORE_FUNC_ID(sc), o->state, cur_pending,
                            o->next_state);
                return ECORE_INVAL;
        }
 
-       ECORE_MSG("Completing command %d for func %d, setting state to %d",
+       ECORE_MSG(sc, "Completing command %d for func %d, setting state to %d",
                  cmd, ECORE_FUNC_ID(sc), o->next_state);
 
        o->state = o->next_state;
@@ -4829,18 +4832,19 @@ static int ecore_func_chk_transition(struct bnx2x_softc *sc __rte_unused,
 
                break;
        default:
-               PMD_DRV_LOG(ERR, "Unknown state: %d", state);
+               PMD_DRV_LOG(ERR, sc, "Unknown state: %d", state);
        }
 
        /* Transition is assured */
        if (next_state != ECORE_F_STATE_MAX) {
-               ECORE_MSG("Good function state transition: %d(%d)->%d",
+               ECORE_MSG(sc, "Good function state transition: %d(%d)->%d",
                          state, cmd, next_state);
                o->next_state = next_state;
                return ECORE_SUCCESS;
        }
 
-       ECORE_MSG("Bad function state transition request: %d %d", state, cmd);
+       ECORE_MSG(sc,
+                 "Bad function state transition request: %d %d", state, cmd);
 
        return ECORE_INVAL;
 }
@@ -4930,13 +4934,13 @@ static int ecore_func_hw_init(struct bnx2x_softc *sc,
        const struct ecore_func_sp_drv_ops *drv = o->drv;
        int rc = 0;
 
-       ECORE_MSG("function %d  load_code %x",
+       ECORE_MSG(sc, "function %d  load_code %x",
                  ECORE_ABS_FUNC_ID(sc), load_code);
 
        /* Prepare FW */
        rc = drv->init_fw(sc);
        if (rc) {
-               PMD_DRV_LOG(ERR, "Error loading firmware");
+               PMD_DRV_LOG(ERR, sc, "Error loading firmware");
                goto init_err;
        }
 
@@ -4967,7 +4971,7 @@ static int ecore_func_hw_init(struct bnx2x_softc *sc,
 
                break;
        default:
-               PMD_DRV_LOG(ERR, "Unknown load_code (0x%x) from MCP",
+               PMD_DRV_LOG(ERR, sc, "Unknown load_code (0x%x) from MCP",
                            load_code);
                rc = ECORE_INVAL;
        }
@@ -5043,7 +5047,7 @@ static int ecore_func_hw_reset(struct bnx2x_softc *sc,
        struct ecore_func_sp_obj *o = params->f_obj;
        const struct ecore_func_sp_drv_ops *drv = o->drv;
 
-       ECORE_MSG("function %d  reset_phase %x", ECORE_ABS_FUNC_ID(sc),
+       ECORE_MSG(sc, "function %d  reset_phase %x", ECORE_ABS_FUNC_ID(sc),
                  reset_phase);
 
        switch (reset_phase) {
@@ -5057,7 +5061,7 @@ static int ecore_func_hw_reset(struct bnx2x_softc *sc,
                ecore_func_reset_func(sc, drv);
                break;
        default:
-               PMD_DRV_LOG(ERR, "Unknown reset_phase (0x%x) from MCP",
+               PMD_DRV_LOG(ERR, sc, "Unknown reset_phase (0x%x) from MCP",
                            reset_phase);
                break;
        }
@@ -5084,8 +5088,6 @@ static int ecore_func_send_start(struct bnx2x_softc *sc,
        rdata->sd_vlan_tag = ECORE_CPU_TO_LE16(start_params->sd_vlan_tag);
        rdata->path_id = ECORE_PATH_ID(sc);
        rdata->network_cos_mode = start_params->network_cos_mode;
-       rdata->gre_tunnel_mode = start_params->gre_tunnel_mode;
-       rdata->gre_tunnel_rss = start_params->gre_tunnel_rss;
 
        /*
         *  No need for an explicit memory barrier here as long we would
@@ -5112,8 +5114,14 @@ static int ecore_func_send_switch_update(struct bnx2x_softc *sc, struct ecore_fu
        ECORE_MEMSET(rdata, 0, sizeof(*rdata));
 
        /* Fill the ramrod data with provided parameters */
-       rdata->tx_switch_suspend_change_flg = 1;
-       rdata->tx_switch_suspend = switch_update_params->suspend;
+       if (ECORE_TEST_BIT(ECORE_F_UPDATE_TX_SWITCH_SUSPEND_CHNG,
+                          &switch_update_params->changes)) {
+               rdata->tx_switch_suspend_change_flg = 1;
+               rdata->tx_switch_suspend =
+                       ECORE_TEST_BIT(ECORE_F_UPDATE_TX_SWITCH_SUSPEND,
+                                      &switch_update_params->changes);
+       }
+
        rdata->echo = SWITCH_UPDATE;
 
        return ecore_sp_post(sc, RAMROD_CMD_ID_COMMON_FUNCTION_UPDATE, 0,
@@ -5148,7 +5156,7 @@ static int ecore_func_send_afex_update(struct bnx2x_softc *sc, struct ecore_func
         *  read and we will have to put a full memory barrier there
         *  (inside ecore_sp_post()).
         */
-       ECORE_MSG("afex: sending func_update vif_id 0x%x dvlan 0x%x prio 0x%x",
+       ECORE_MSG(sc, "afex: sending func_update vif_id 0x%x dvlan 0x%x prio 0x%x",
                  rdata->vif_id,
                  rdata->afex_default_vlan, rdata->allowed_priorities);
 
@@ -5186,8 +5194,8 @@ inline int ecore_func_send_afex_viflists(struct bnx2x_softc *sc,
         *  (inside ecore_sp_post()).
         */
 
-       ECORE_MSG
-           ("afex: ramrod lists, cmd 0x%x index 0x%x func_bit_map 0x%x func_to_clr 0x%x",
+           ECORE_MSG
+           (sc, "afex: ramrod lists, cmd 0x%x index 0x%x func_bit_map 0x%x func_to_clr 0x%x",
             rdata->afex_vif_list_command, rdata->vif_list_index,
             rdata->func_bit_map, rdata->func_to_clear);
 
@@ -5225,7 +5233,7 @@ static int ecore_func_send_tx_start(struct bnx2x_softc *sc, struct ecore_func_st
 
        rdata->dcb_enabled = tx_start_params->dcb_enabled;
        rdata->dcb_version = tx_start_params->dcb_version;
-       rdata->dont_add_pri_0 = tx_start_params->dont_add_pri_0;
+       rdata->dont_add_pri_0_en = tx_start_params->dont_add_pri_0_en;
 
        for (i = 0; i < ARRAY_SIZE(rdata->traffic_type_to_priority_cos); i++)
                rdata->traffic_type_to_priority_cos[i] =
@@ -5258,7 +5266,7 @@ static int ecore_func_send_cmd(struct bnx2x_softc *sc,
        case ECORE_F_CMD_SWITCH_UPDATE:
                return ecore_func_send_switch_update(sc, params);
        default:
-               PMD_DRV_LOG(ERR, "Unknown command: %d", params->cmd);
+               PMD_DRV_LOG(ERR, sc, "Unknown command: %d", params->cmd);
                return ECORE_INVAL;
        }
 }
@@ -5319,7 +5327,7 @@ int ecore_func_state_change(struct bnx2x_softc *sc,
                }
                if (rc == ECORE_BUSY) {
                        ECORE_MUTEX_UNLOCK(&o->one_pending_mutex);
-                       PMD_DRV_LOG(ERR,
+                       PMD_DRV_LOG(ERR, sc,
                                    "timeout waiting for previous ramrod completion");
                        return rc;
                }