@@ -761,8 +761,7 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs,
*/
if (irq_vector < 0) {
if (set_tx_am_data(p_nthw_dbs, index, (uint64_t)avail_struct_phys_addr,
- TX_AM_ENABLE, host_id, 0,
- irq_vector >= 0 ? 1 : 0) != 0) {
+ TX_AM_ENABLE, host_id, 0, 0) != 0) {
return NULL;
}
}
@@ -1010,20 +1010,18 @@ int nt4ga_agx_link_100g_ports_init(struct adapter_info_s *p_adapter_info, nthw_f
nthw_rpf_set_ts_at_eof(p_nthw_agx->p_rpf, true);
- if (res == 0) {
- p_adapter_info->nt4ga_link.speed_capa = NT_LINK_SPEED_100G;
- p_adapter_info->nt4ga_link.variables_initialized = true;
- }
+
+ p_adapter_info->nt4ga_link.speed_capa = NT_LINK_SPEED_100G;
+ p_adapter_info->nt4ga_link.variables_initialized = true;
}
/*
* Create state-machine thread
*/
- if (res == 0) {
- if (!monitor_task_is_running[adapter_no]) {
- res = rte_thread_create(&monitor_tasks[adapter_no], NULL,
- nt4ga_agx_link_100g_mon, p_adapter_info);
- }
+
+ if (!monitor_task_is_running[adapter_no]) {
+ res = rte_thread_create(&monitor_tasks[adapter_no], NULL,
+ nt4ga_agx_link_100g_mon, p_adapter_info);
}
return res;
@@ -123,8 +123,7 @@ static int nim_read_write_data_lin(nim_i2c_ctx_p ctx, bool m_page_addressing, ui
* Find out how much can be read from the current block in case of
* single byte access
*/
- if (multi_byte == 1)
- max_seq_cnt = block_size - (lin_addr % block_size);
+ max_seq_cnt = block_size - (lin_addr % block_size);
if (m_page_addressing) {
if (lin_addr >= 128) { /* Only page setup above this address */
@@ -104,11 +104,6 @@ static int nthw_fpga_rst9563_setup(nthw_fpga_t *p_fpga, struct nthw_fpga_rst_nt2
nthw_register_get_field(p_curr_reg, RST9563_STAT_TS_MMCM_LOCKED);
p->mp_fld_stat_tsm_ref_mmcm_locked = NULL; /* Field not present on 9563 */
- if (!p->mp_fld_stat_tsm_ref_mmcm_locked) {
- NT_LOG(DBG, NTHW, "%s: No RST9563_STAT_TSM_REF_MMCM_LOCKED found",
- p_adapter_id_str);
- }
-
nthw_register_update(p_curr_reg);
/* STICKY register field pointers */
@@ -126,11 +121,6 @@ static int nthw_fpga_rst9563_setup(nthw_fpga_t *p_fpga, struct nthw_fpga_rst_nt2
p->mp_fld_sticky_pci_sys_mmcm_unlocked = NULL; /* Field not present on 9563 */
p->mp_fld_sticky_tsm_ref_mmcm_unlocked = NULL; /* Field not present on 9563 */
- if (!p->mp_fld_sticky_tsm_ref_mmcm_unlocked) {
- NT_LOG(DBG, NTHW, "%s: No RST9563_STICKY_TSM_REF_MMCM_UNLOCKED found",
- p_adapter_id_str);
- }
-
nthw_register_update(p_curr_reg);
/* POWER register field pointers */
@@ -184,8 +184,7 @@ static int nthw_fpga_nt400dxx_init(struct fpga_info_s *p_fpga_info)
/* reset specific */
switch (p_fpga_info->n_fpga_prod_id) {
case 9574:
- if (rst9574_ops)
- res = rst9574_ops->nthw_fpga_rst9574_init(p_fpga_info, &rst);
+ res = rst9574_ops->nthw_fpga_rst9574_init(p_fpga_info, &rst);
if (res) {
NT_LOG(ERR, NTHW,
@@ -806,7 +806,7 @@ static uint32_t nthw_phy_tile_cpi_request(nthw_phy_tile_t *p, uint8_t intf_no, u
nt_os_wait_usec(10000);
- for (int i = 20; i > 0; i--) {
+ for (int i = 20; i >= 0; i--) {
data = nthw_phy_tile_read_xcvr(p, intf_no, lane, phy_addr + lane_offset);
value =
@@ -132,8 +132,7 @@ int nthw_sdc_get_states(nthw_sdc_t *p, uint64_t *pn_result_mask)
if (val != 0)
n_err_cnt++;
- if (pn_result_mask)
- *pn_result_mask = n_mask;
+ *pn_result_mask = n_mask;
return n_err_cnt; /* 0 = all ok */
}
@@ -89,8 +89,7 @@ int nthw_tsm_get_ts(nthw_tsm_t *p, uint64_t *p_ts)
val = ((((uint64_t)n_ts_hi) << 32UL) | n_ts_lo);
- if (p_ts)
- *p_ts = val;
+ *p_ts = val;
return 0;
}
@@ -108,8 +107,7 @@ int nthw_tsm_get_time(nthw_tsm_t *p, uint64_t *p_time)
val = ((((uint64_t)n_time_hi) << 32UL) | n_time_lo);
- if (p_time)
- *p_time = val;
+ *p_time = val;
return 0;
}
@@ -829,8 +829,7 @@ struct flow_nic_dev *nthw_flow_api_create(uint8_t adapter_no,
err_exit:
- if (ndev)
- nthw_flow_api_done(ndev);
+ nthw_flow_api_done(ndev);
NT_LOG(DBG, FILTER, "ERR: %s", __func__);
return NULL;
@@ -834,9 +834,6 @@ int hw_mod_flm_stat_get(struct flow_api_backend_s *be, enum hw_flm_e field, uint
break;
default: {
- if (_VER_ < 18)
- return UNSUP_FIELD;
-
switch (field) {
case HW_FLM_STAT_STA_DONE:
*value = be->flm.v25.sta_done->cnt;
@@ -4267,8 +4267,6 @@ int flow_destroy_locked_profile_inline(struct flow_eth_dev *dev,
RTE_ASSERT(dev);
RTE_ASSERT(fh);
- int err = 0;
-
nthw_flow_nic_set_error(ERR_SUCCESS, error);
/* take flow out of ndev list - may not have been put there yet */
@@ -4318,11 +4316,6 @@ int flow_destroy_locked_profile_inline(struct flow_eth_dev *dev,
fh->fd = NULL;
}
- if (err) {
- NT_LOG(ERR, FILTER, "FAILED removing flow: %p", fh);
- nthw_flow_nic_set_error(ERR_REMOVE_FLOW_FAILED, error);
- }
-
free(fh);
fh = NULL;
@@ -4330,7 +4323,7 @@ int flow_destroy_locked_profile_inline(struct flow_eth_dev *dev,
dev->ndev->be.iface->set_debug_mode(dev->ndev->be.be_dev, FLOW_BACKEND_DEBUG_MODE_NONE);
#endif
- return err;
+ return 0;
}
int flow_destroy_profile_inline(struct flow_eth_dev *dev, struct flow_handle *flow,
@@ -517,13 +517,6 @@ int nthw_rac_rab_read32_dma(nthw_rac_t *p, nthw_rab_bus_id_t bus_id, uint32_t ad
return -1;
}
- if ((word_cnt + 3) > RAB_DMA_BUF_CNT) {
- NT_LOG(ERR, NTHW,
- "%s: Failed rab dma read length check - bus: %d addr: 0x%08X wordcount: %d",
- p_adapter_id_str, bus_id, address, word_cnt);
- return -1;
- }
-
if (p->m_in_free < 3) {
/*
* No more memory available.
@@ -1375,7 +1375,6 @@ eth_dev_set_link_up(struct rte_eth_dev *eth_dev)
return 0;
RTE_ASSERT(port >= 0 && port < NUM_ADAPTER_PORTS_MAX);
- RTE_ASSERT(port == internals->n_intf_no);
port_ops->set_adm_state(p_adapter_info, port, true);
@@ -1401,7 +1400,6 @@ eth_dev_set_link_down(struct rte_eth_dev *eth_dev)
return 0;
RTE_ASSERT(port >= 0 && port < NUM_ADAPTER_PORTS_MAX);
- RTE_ASSERT(port == internals->n_intf_no);
port_ops->set_link_status(p_adapter_info, port, false);
@@ -2201,25 +2199,23 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)
NT_LOG(DBG, NTNIC, "Meter module is not initialized");
/* Initialize the queue system */
- if (err == 0) {
- sg_ops = get_sg_ops();
-
- if (sg_ops != NULL) {
- err = sg_ops->nthw_virt_queue_init(fpga_info);
+ sg_ops = get_sg_ops();
- if (err != 0) {
- NT_LOG(ERR, NTNIC,
- "%s: Cannot initialize scatter-gather queues",
- p_nt_drv->adapter_info.mp_adapter_id_str);
+ if (sg_ops != NULL) {
+ err = sg_ops->nthw_virt_queue_init(fpga_info);
- } else {
- NT_LOG(DBG, NTNIC, "%s: Initialized scatter-gather queues",
- p_nt_drv->adapter_info.mp_adapter_id_str);
- }
+ if (err != 0) {
+ NT_LOG(ERR, NTNIC,
+ "%s: Cannot initialize scatter-gather queues",
+ p_nt_drv->adapter_info.mp_adapter_id_str);
} else {
- NT_LOG_DBGX(DBG, NTNIC, "SG module is not initialized");
+ NT_LOG(DBG, NTNIC, "%s: Initialized scatter-gather queues",
+ p_nt_drv->adapter_info.mp_adapter_id_str);
}
+
+ } else {
+ NT_LOG_DBGX(DBG, NTNIC, "SG module is not initialized");
}
/* Start ctrl, monitor, stat thread only for primary process. */