LCOV - code coverage report
Current view: top level - drivers/net/bnxt - bnxt_cpr.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 0 187 0.0 %
Date: 2024-04-01 19:00:53 Functions: 0 11 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 108 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  * Copyright(c) 2014-2023 Broadcom
       3                 :            :  * All rights reserved.
       4                 :            :  */
       5                 :            : 
       6                 :            : #include <rte_malloc.h>
       7                 :            : #include <rte_alarm.h>
       8                 :            : #include <rte_cycles.h>
       9                 :            : 
      10                 :            : #include "bnxt.h"
      11                 :            : #include "bnxt_hwrm.h"
      12                 :            : #include "bnxt_ring.h"
      13                 :            : #include "hsi_struct_def_dpdk.h"
      14                 :            : 
      15                 :          0 : void bnxt_wait_for_device_shutdown(struct bnxt *bp)
      16                 :            : {
      17                 :            :         uint32_t val, timeout;
      18                 :            : 
      19                 :            :         /* if HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERR_RECOVER_RELOAD is set
      20                 :            :          * in HWRM_FUNC_QCAPS command, wait for FW_STATUS to set
      21                 :            :          * the SHUTDOWN bit in health register
      22                 :            :          */
      23         [ #  # ]:          0 :         if (!(bp->recovery_info &&
      24         [ #  # ]:          0 :               (bp->fw_cap & BNXT_FW_CAP_ERR_RECOVER_RELOAD)))
      25                 :            :                 return;
      26                 :            : 
      27                 :            :         /* Driver has to wait for fw_reset_max_msecs or shutdown bit which comes
      28                 :            :          * first for FW to collect crash dump.
      29                 :            :          */
      30                 :          0 :         timeout = bp->fw_reset_max_msecs;
      31                 :            : 
      32                 :            :         /* Driver has to poll for shutdown bit in fw_status register
      33                 :            :          *
      34                 :            :          * 1. in case of hot fw upgrade, this bit will be set after all
      35                 :            :          *    function drivers unregistered with fw.
      36                 :            :          * 2. in case of fw initiated error recovery, this bit will be
      37                 :            :          *    set after fw has collected the core dump
      38                 :            :          */
      39                 :            :         do {
      40                 :          0 :                 val = bnxt_read_fw_status_reg(bp, BNXT_FW_STATUS_REG);
      41         [ #  # ]:          0 :                 if (val & BNXT_FW_STATUS_SHUTDOWN)
      42                 :            :                         return;
      43                 :            : 
      44                 :            :                 rte_delay_ms(100);
      45                 :          0 :                 timeout -= 100;
      46         [ #  # ]:          0 :         } while (timeout);
      47                 :            : }
      48                 :            : 
      49                 :            : static void
      50                 :          0 : bnxt_process_default_vnic_change(struct bnxt *bp,
      51                 :            :                                  struct hwrm_async_event_cmpl *async_cmp)
      52                 :            : {
      53                 :            :         uint16_t vnic_state, vf_fid, vf_id;
      54                 :            :         struct bnxt_representor *vf_rep_bp;
      55                 :            :         struct rte_eth_dev *eth_dev;
      56                 :            :         bool vfr_found = false;
      57                 :            :         uint32_t event_data;
      58                 :            : 
      59   [ #  #  #  # ]:          0 :         if (!BNXT_TRUFLOW_EN(bp))
      60                 :            :                 return;
      61                 :            : 
      62                 :          0 :         PMD_DRV_LOG(INFO, "Default vnic change async event received\n");
      63                 :          0 :         event_data = rte_le_to_cpu_32(async_cmp->event_data1);
      64                 :            : 
      65                 :          0 :         vnic_state = (event_data & BNXT_DEFAULT_VNIC_STATE_MASK) >>
      66                 :            :                         BNXT_DEFAULT_VNIC_STATE_SFT;
      67         [ #  # ]:          0 :         if (vnic_state != BNXT_DEFAULT_VNIC_ALLOC)
      68                 :            :                 return;
      69                 :            : 
      70         [ #  # ]:          0 :         if (!bp->rep_info)
      71                 :            :                 return;
      72                 :            : 
      73                 :          0 :         vf_fid = (event_data & BNXT_DEFAULT_VNIC_CHANGE_VF_ID_MASK) >>
      74                 :            :                         BNXT_DEFAULT_VNIC_CHANGE_VF_ID_SFT;
      75                 :          0 :         PMD_DRV_LOG(INFO, "async event received vf_id 0x%x\n", vf_fid);
      76                 :            : 
      77   [ #  #  #  # ]:          0 :         for (vf_id = 0; vf_id < BNXT_MAX_VF_REPS(bp); vf_id++) {
      78                 :          0 :                 eth_dev = bp->rep_info[vf_id].vfr_eth_dev;
      79         [ #  # ]:          0 :                 if (!eth_dev)
      80                 :          0 :                         continue;
      81                 :          0 :                 vf_rep_bp = eth_dev->data->dev_private;
      82         [ #  # ]:          0 :                 if (vf_rep_bp &&
      83         [ #  # ]:          0 :                     vf_rep_bp->fw_fid == vf_fid) {
      84                 :            :                         vfr_found = true;
      85                 :            :                         break;
      86                 :            :                 }
      87                 :            :         }
      88         [ #  # ]:          0 :         if (!vfr_found)
      89                 :            :                 return;
      90                 :            : 
      91                 :          0 :         bnxt_rep_dev_start_op(eth_dev);
      92                 :            : }
      93                 :            : 
      94                 :          0 : static void bnxt_handle_event_error_report(struct bnxt *bp,
      95                 :            :                                            uint32_t data1,
      96                 :            :                                            uint32_t data2)
      97                 :            : {
      98      [ #  #  # ]:          0 :         switch (BNXT_EVENT_ERROR_REPORT_TYPE(data1)) {
      99                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_PAUSE_STORM:
     100                 :          0 :                 PMD_DRV_LOG(WARNING, "Port:%d Pause Storm detected!\n",
     101                 :            :                             bp->eth_dev->data->port_id);
     102                 :          0 :                 break;
     103                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED:
     104                 :          0 :                 PMD_DRV_LOG(WARNING, "Port:%d Speed change not supported with dual rate transceivers on this board",
     105                 :            :                             bp->eth_dev->data->port_id);
     106                 :          0 :                 break;
     107                 :          0 :         default:
     108                 :          0 :                 PMD_DRV_LOG(INFO, "FW reported unknown error type data1 %d"
     109                 :            :                             " data2: %d\n", data1, data2);
     110                 :          0 :                 break;
     111                 :            :         }
     112                 :          0 : }
     113                 :            : 
     114                 :          0 : void bnxt_handle_vf_cfg_change(void *arg)
     115                 :            : {
     116                 :            :         struct bnxt *bp = arg;
     117                 :          0 :         struct rte_eth_dev *eth_dev = bp->eth_dev;
     118                 :            :         int rc;
     119                 :            : 
     120                 :            :         /* Free and recreate filters with default VLAN */
     121         [ #  # ]:          0 :         if (eth_dev->data->dev_started) {
     122                 :          0 :                 rc = bnxt_dev_stop_op(eth_dev);
     123         [ #  # ]:          0 :                 if (rc != 0) {
     124                 :          0 :                         PMD_DRV_LOG(ERR, "Failed to stop Port:%u\n", eth_dev->data->port_id);
     125                 :          0 :                         return;
     126                 :            :                 }
     127                 :            : 
     128                 :          0 :                 rc = bnxt_dev_start_op(eth_dev);
     129         [ #  # ]:          0 :                 if (rc != 0)
     130                 :          0 :                         PMD_DRV_LOG(ERR, "Failed to start Port:%u\n", eth_dev->data->port_id);
     131                 :            :         }
     132                 :            : }
     133                 :            : 
     134                 :            : static void
     135                 :          0 : bnxt_process_vf_flr(struct bnxt *bp, uint32_t data1)
     136                 :            : {
     137                 :            :         uint16_t pfid, vfid;
     138                 :            : 
     139   [ #  #  #  # ]:          0 :         if (!BNXT_TRUFLOW_EN(bp))
     140                 :            :                 return;
     141                 :            : 
     142                 :          0 :         pfid = (data1 & HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_MASK) >>
     143                 :            :                 HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_PF_ID_SFT;
     144                 :            :         vfid = (data1 & HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK) >>
     145                 :            :                 HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT;
     146                 :            : 
     147                 :          0 :         PMD_DRV_LOG(INFO, "VF FLR async event received pfid: %u, vfid: %u\n",
     148                 :            :                     pfid, vfid);
     149                 :            : }
     150                 :            : 
     151                 :            : /*
     152                 :            :  * Async event handling
     153                 :            :  */
     154                 :          0 : void bnxt_handle_async_event(struct bnxt *bp,
     155                 :            :                              struct cmpl_base *cmp)
     156                 :            : {
     157                 :            :         struct hwrm_async_event_cmpl *async_cmp =
     158                 :            :                                 (struct hwrm_async_event_cmpl *)cmp;
     159                 :          0 :         uint16_t event_id = rte_le_to_cpu_16(async_cmp->event_id);
     160                 :          0 :         uint16_t port_id = bp->eth_dev->data->port_id;
     161                 :            :         struct bnxt_error_recovery_info *info;
     162                 :            :         uint32_t event_data;
     163                 :            :         uint32_t data1, data2;
     164                 :            :         uint32_t status;
     165                 :            : 
     166                 :          0 :         data1 = rte_le_to_cpu_32(async_cmp->event_data1);
     167                 :          0 :         data2 = rte_le_to_cpu_32(async_cmp->event_data2);
     168                 :            : 
     169   [ #  #  #  #  :          0 :         switch (event_id) {
          #  #  #  #  #  
                #  #  # ]
     170                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE:
     171                 :            :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE:
     172                 :            :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE:
     173                 :            :                 /* FALLTHROUGH */
     174                 :          0 :                 bnxt_link_update_op(bp->eth_dev, 0);
     175                 :          0 :                 rte_eth_dev_callback_process(bp->eth_dev,
     176                 :            :                         RTE_ETH_EVENT_INTR_LSC, NULL);
     177                 :          0 :                 break;
     178                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD:
     179                 :          0 :                 PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n");
     180                 :          0 :                 break;
     181                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE:
     182                 :          0 :                 PMD_DRV_LOG(INFO, "Port %u: VF config change async event\n", port_id);
     183                 :          0 :                 PMD_DRV_LOG(INFO, "event: data1 %#x data2 %#x\n", data1, data2);
     184                 :          0 :                 bnxt_hwrm_func_qcfg(bp, NULL);
     185         [ #  # ]:          0 :                 if (BNXT_VF(bp))
     186                 :          0 :                         rte_eal_alarm_set(1, bnxt_handle_vf_cfg_change, (void *)bp);
     187                 :            :                 break;
     188                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED:
     189                 :          0 :                 PMD_DRV_LOG(INFO, "Port conn async event\n");
     190                 :          0 :                 break;
     191                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY:
     192                 :            :                 /*
     193                 :            :                  * Avoid any rx/tx packet processing during firmware reset
     194                 :            :                  * operation.
     195                 :            :                  */
     196                 :          0 :                 bnxt_stop_rxtx(bp->eth_dev);
     197                 :            : 
     198                 :            :                 /* Ignore reset notify async events when stopping the port */
     199         [ #  # ]:          0 :                 if (!bp->eth_dev->data->dev_started) {
     200                 :          0 :                         bp->flags |= BNXT_FLAG_FATAL_ERROR;
     201                 :          0 :                         return;
     202                 :            :                 }
     203                 :            : 
     204                 :          0 :                 rte_eth_dev_callback_process(bp->eth_dev,
     205                 :            :                                              RTE_ETH_EVENT_ERR_RECOVERING,
     206                 :            :                                              NULL);
     207                 :            : 
     208                 :          0 :                 pthread_mutex_lock(&bp->err_recovery_lock);
     209                 :            :                 event_data = data1;
     210                 :            :                 /* timestamp_lo/hi values are in units of 100ms */
     211         [ #  # ]:          0 :                 bp->fw_reset_max_msecs = async_cmp->timestamp_hi ?
     212                 :            :                         rte_le_to_cpu_16(async_cmp->timestamp_hi) * 100 :
     213                 :            :                         BNXT_MAX_FW_RESET_TIMEOUT;
     214         [ #  # ]:          0 :                 bp->fw_reset_min_msecs = async_cmp->timestamp_lo ?
     215                 :            :                         async_cmp->timestamp_lo * 100 :
     216                 :            :                         BNXT_MIN_FW_READY_TIMEOUT;
     217         [ #  # ]:          0 :                 if ((event_data & EVENT_DATA1_REASON_CODE_MASK) ==
     218                 :            :                     EVENT_DATA1_REASON_CODE_FW_EXCEPTION_FATAL) {
     219                 :          0 :                         PMD_DRV_LOG(INFO,
     220                 :            :                                     "Port %u: Firmware fatal reset event received\n",
     221                 :            :                                     port_id);
     222                 :          0 :                         bp->flags |= BNXT_FLAG_FATAL_ERROR;
     223                 :            :                 } else {
     224                 :          0 :                         PMD_DRV_LOG(INFO,
     225                 :            :                                     "Port %u: Firmware non-fatal reset event received\n",
     226                 :            :                                     port_id);
     227                 :            :                 }
     228                 :            : 
     229                 :          0 :                 bp->flags |= BNXT_FLAG_FW_RESET;
     230                 :          0 :                 pthread_mutex_unlock(&bp->err_recovery_lock);
     231                 :          0 :                 rte_eal_alarm_set(US_PER_MS, bnxt_dev_reset_and_resume,
     232                 :            :                                   (void *)bp);
     233                 :          0 :                 break;
     234                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY:
     235                 :          0 :                 info = bp->recovery_info;
     236                 :            : 
     237         [ #  # ]:          0 :                 if (!info)
     238                 :            :                         return;
     239                 :            : 
     240                 :            :                 event_data = data1 & EVENT_DATA1_FLAGS_MASK;
     241                 :            : 
     242         [ #  # ]:          0 :                 if (event_data & EVENT_DATA1_FLAGS_RECOVERY_ENABLED) {
     243                 :          0 :                         info->flags |= BNXT_FLAG_RECOVERY_ENABLED;
     244                 :            :                 } else {
     245                 :          0 :                         info->flags &= ~BNXT_FLAG_RECOVERY_ENABLED;
     246                 :          0 :                         PMD_DRV_LOG(INFO, "Driver recovery watchdog is disabled\n");
     247                 :          0 :                         return;
     248                 :            :                 }
     249                 :            : 
     250         [ #  # ]:          0 :                 if (event_data & EVENT_DATA1_FLAGS_MASTER_FUNC)
     251                 :          0 :                         info->flags |= BNXT_FLAG_PRIMARY_FUNC;
     252                 :            :                 else
     253                 :          0 :                         info->flags &= ~BNXT_FLAG_PRIMARY_FUNC;
     254                 :            : 
     255                 :          0 :                 status = bnxt_read_fw_status_reg(bp, BNXT_FW_STATUS_REG);
     256   [ #  #  #  # ]:          0 :                 PMD_DRV_LOG(INFO,
     257                 :            :                             "Port: %u Driver recovery watchdog, role: %s, FW status: 0x%x (%s)\n",
     258                 :            :                             port_id, bnxt_is_primary_func(bp) ? "primary" : "backup", status,
     259                 :            :                             (status == BNXT_FW_STATUS_HEALTHY) ? "healthy" : "unhealthy");
     260                 :            : 
     261         [ #  # ]:          0 :                 if (bp->flags & BNXT_FLAG_FW_HEALTH_CHECK_SCHEDULED)
     262                 :            :                         return;
     263                 :            : 
     264                 :          0 :                 info->last_heart_beat =
     265                 :          0 :                         bnxt_read_fw_status_reg(bp, BNXT_FW_HEARTBEAT_CNT_REG);
     266                 :          0 :                 info->last_reset_counter =
     267                 :          0 :                         bnxt_read_fw_status_reg(bp, BNXT_FW_RECOVERY_CNT_REG);
     268                 :            : 
     269                 :          0 :                 bnxt_schedule_fw_health_check(bp);
     270                 :          0 :                 break;
     271                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION:
     272                 :          0 :                 PMD_DRV_LOG(INFO, "Port: %u DNC event: data1 %#x data2 %#x\n",
     273                 :            :                             port_id, data1, data2);
     274                 :          0 :                 break;
     275                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE:
     276                 :          0 :                 bnxt_process_default_vnic_change(bp, async_cmp);
     277                 :          0 :                 break;
     278                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ECHO_REQUEST:
     279                 :          0 :                 PMD_DRV_LOG(INFO,
     280                 :            :                             "Port %u: Received fw echo request: data1 %#x data2 %#x\n",
     281                 :            :                             port_id, data1, data2);
     282         [ #  # ]:          0 :                 if (bp->recovery_info)
     283                 :          0 :                         bnxt_hwrm_fw_echo_reply(bp, data1, data2);
     284                 :            :                 break;
     285                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_REPORT:
     286                 :          0 :                 bnxt_handle_event_error_report(bp, data1, data2);
     287                 :          0 :                 break;
     288                 :          0 :         case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR:
     289                 :          0 :                 bnxt_process_vf_flr(bp, data1);
     290                 :          0 :                 break;
     291                 :          0 :         default:
     292                 :          0 :                 PMD_DRV_LOG(DEBUG, "handle_async_event id = 0x%x\n", event_id);
     293                 :          0 :                 break;
     294                 :            :         }
     295                 :            : }
     296                 :            : 
     297                 :          0 : void bnxt_handle_fwd_req(struct bnxt *bp, struct cmpl_base *cmpl)
     298                 :            : {
     299                 :            :         struct hwrm_exec_fwd_resp_input *fwreq;
     300                 :            :         struct hwrm_fwd_req_cmpl *fwd_cmpl = (struct hwrm_fwd_req_cmpl *)cmpl;
     301                 :            :         struct input *fwd_cmd;
     302                 :            :         uint16_t fw_vf_id;
     303                 :            :         uint16_t vf_id;
     304                 :            :         uint16_t req_len;
     305                 :            :         int rc;
     306                 :            : 
     307         [ #  # ]:          0 :         if (bp->pf->active_vfs <= 0) {
     308                 :          0 :                 PMD_DRV_LOG(ERR, "Forwarded VF with no active VFs\n");
     309                 :          0 :                 return;
     310                 :            :         }
     311                 :            : 
     312                 :            :         /* Qualify the fwd request */
     313                 :          0 :         fw_vf_id = rte_le_to_cpu_16(fwd_cmpl->source_id);
     314                 :          0 :         vf_id = fw_vf_id - bp->pf->first_vf_id;
     315                 :            : 
     316                 :          0 :         req_len = (rte_le_to_cpu_16(fwd_cmpl->req_len_type) &
     317                 :            :                    HWRM_FWD_REQ_CMPL_REQ_LEN_MASK) >>
     318                 :            :                 HWRM_FWD_REQ_CMPL_REQ_LEN_SFT;
     319                 :            :         if (req_len > sizeof(fwreq->encap_request))
     320                 :            :                 req_len = sizeof(fwreq->encap_request);
     321                 :            : 
     322                 :            :         /* Locate VF's forwarded command */
     323                 :          0 :         fwd_cmd = (struct input *)bp->pf->vf_info[vf_id].req_buf;
     324                 :            : 
     325         [ #  # ]:          0 :         if (fw_vf_id < bp->pf->first_vf_id ||
     326         [ #  # ]:          0 :             fw_vf_id >= bp->pf->first_vf_id + bp->pf->active_vfs) {
     327                 :          0 :                 PMD_DRV_LOG(ERR,
     328                 :            :                 "FWD req's source_id 0x%x out of range 0x%x - 0x%x (%d %d)\n",
     329                 :            :                         fw_vf_id, bp->pf->first_vf_id,
     330                 :            :                         (bp->pf->first_vf_id) + bp->pf->active_vfs - 1,
     331                 :            :                         bp->pf->first_vf_id, bp->pf->active_vfs);
     332                 :          0 :                 goto reject;
     333                 :            :         }
     334                 :            : 
     335         [ #  # ]:          0 :         if (bnxt_rcv_msg_from_vf(bp, vf_id, fwd_cmd)) {
     336                 :            :                 /*
     337                 :            :                  * In older firmware versions, the MAC had to be all zeros for
     338                 :            :                  * the VF to set it's MAC via hwrm_func_vf_cfg. Set to all
     339                 :            :                  * zeros if it's being configured and has been ok'd by caller.
     340                 :            :                  */
     341         [ #  # ]:          0 :                 if (fwd_cmd->req_type == HWRM_FUNC_VF_CFG) {
     342                 :            :                         struct hwrm_func_vf_cfg_input *vfc = (void *)fwd_cmd;
     343                 :            : 
     344         [ #  # ]:          0 :                         if (vfc->enables &
     345                 :            :                             HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR) {
     346                 :          0 :                                 bnxt_hwrm_func_vf_mac(bp, vf_id,
     347                 :            :                                 (const uint8_t *)"\x00\x00\x00\x00\x00");
     348                 :            :                         }
     349                 :            :                 }
     350                 :            : 
     351         [ #  # ]:          0 :                 if (fwd_cmd->req_type == HWRM_CFA_L2_SET_RX_MASK) {
     352                 :            :                         struct hwrm_cfa_l2_set_rx_mask_input *srm =
     353                 :            :                                                         (void *)fwd_cmd;
     354                 :            : 
     355                 :          0 :                         srm->vlan_tag_tbl_addr = rte_cpu_to_le_64(0);
     356                 :          0 :                         srm->num_vlan_tags = rte_cpu_to_le_32(0);
     357                 :          0 :                         srm->mask &= ~rte_cpu_to_le_32(
     358                 :            :                                 HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLANONLY |
     359                 :            :                             HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN |
     360                 :            :                             HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ANYVLAN_NONVLAN);
     361                 :            :                 }
     362                 :            : 
     363                 :            :                 /* Forward */
     364                 :          0 :                 rc = bnxt_hwrm_exec_fwd_resp(bp, fw_vf_id, fwd_cmd, req_len);
     365         [ #  # ]:          0 :                 if (rc) {
     366                 :          0 :                         PMD_DRV_LOG(ERR,
     367                 :            :                                 "Failed to send FWD req VF 0x%x, type 0x%x.\n",
     368                 :            :                                 fw_vf_id - bp->pf->first_vf_id,
     369                 :            :                                 rte_le_to_cpu_16(fwd_cmd->req_type));
     370                 :            :                 }
     371                 :          0 :                 return;
     372                 :            :         }
     373                 :            : 
     374                 :          0 : reject:
     375                 :          0 :         rc = bnxt_hwrm_reject_fwd_resp(bp, fw_vf_id, fwd_cmd, req_len);
     376         [ #  # ]:          0 :         if (rc) {
     377                 :          0 :                 PMD_DRV_LOG(ERR,
     378                 :            :                         "Failed to send REJECT req VF 0x%x, type 0x%x.\n",
     379                 :            :                         fw_vf_id - bp->pf->first_vf_id,
     380                 :            :                         rte_le_to_cpu_16(fwd_cmd->req_type));
     381                 :            :         }
     382                 :            : 
     383                 :            :         return;
     384                 :            : }
     385                 :            : 
     386                 :          0 : int bnxt_event_hwrm_resp_handler(struct bnxt *bp, struct cmpl_base *cmp)
     387                 :            : {
     388                 :            :         bool evt = 0;
     389                 :            : 
     390         [ #  # ]:          0 :         if (bp == NULL || cmp == NULL) {
     391                 :          0 :                 PMD_DRV_LOG(ERR, "invalid NULL argument\n");
     392                 :          0 :                 return evt;
     393                 :            :         }
     394                 :            : 
     395         [ #  # ]:          0 :         if (unlikely(is_bnxt_in_error(bp)))
     396                 :            :                 return 0;
     397                 :            : 
     398      [ #  #  # ]:          0 :         switch (CMP_TYPE(cmp)) {
     399                 :          0 :         case CMPL_BASE_TYPE_HWRM_ASYNC_EVENT:
     400                 :            :                 /* Handle any async event */
     401                 :          0 :                 bnxt_handle_async_event(bp, cmp);
     402                 :            :                 evt = 1;
     403                 :          0 :                 break;
     404                 :          0 :         case CMPL_BASE_TYPE_HWRM_FWD_REQ:
     405                 :            :                 /* Handle HWRM forwarded responses */
     406                 :          0 :                 bnxt_handle_fwd_req(bp, cmp);
     407                 :            :                 evt = 1;
     408                 :          0 :                 break;
     409                 :          0 :         default:
     410                 :            :                 /* Ignore any other events */
     411                 :          0 :                 PMD_DRV_LOG(DEBUG, "Ignoring %02x completion\n", CMP_TYPE(cmp));
     412                 :          0 :                 break;
     413                 :            :         }
     414                 :            : 
     415                 :          0 :         return evt;
     416                 :            : }
     417                 :            : 
     418                 :          0 : bool bnxt_is_primary_func(struct bnxt *bp)
     419                 :            : {
     420         [ #  # ]:          0 :         if (bp->recovery_info->flags & BNXT_FLAG_PRIMARY_FUNC)
     421                 :          0 :                 return true;
     422                 :            : 
     423                 :            :         return false;
     424                 :            : }
     425                 :            : 
     426                 :          0 : bool bnxt_is_recovery_enabled(struct bnxt *bp)
     427                 :            : {
     428                 :            :         struct bnxt_error_recovery_info *info;
     429                 :            : 
     430                 :          0 :         info = bp->recovery_info;
     431   [ #  #  #  # ]:          0 :         if (info && (info->flags & BNXT_FLAG_RECOVERY_ENABLED))
     432                 :          0 :                 return true;
     433                 :            : 
     434                 :            :         return false;
     435                 :            : }
     436                 :            : 
     437                 :          0 : void bnxt_stop_rxtx(struct rte_eth_dev *eth_dev)
     438                 :            : {
     439                 :          0 :         eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
     440                 :          0 :         eth_dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
     441                 :            : 
     442                 :          0 :         rte_eth_fp_ops[eth_dev->data->port_id].rx_pkt_burst =
     443                 :            :                 eth_dev->rx_pkt_burst;
     444                 :          0 :         rte_eth_fp_ops[eth_dev->data->port_id].tx_pkt_burst =
     445                 :            :                 eth_dev->tx_pkt_burst;
     446                 :            :         rte_mb();
     447                 :            : 
     448                 :            :         /* Allow time for threads to exit the real burst functions. */
     449                 :            :         rte_delay_ms(100);
     450                 :          0 : }

Generated by: LCOV version 1.14