net/bnxt: fix Rx configuration
[dpdk.git] / drivers / net / bnxt / bnxt_ethdev.c
index cf3bd77..181de42 100644 (file)
@@ -971,16 +971,10 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
        dev_info->min_rx_bufsize = 1;
        dev_info->max_rx_pktlen = BNXT_MAX_PKT_LEN;
 
-       dev_info->rx_offload_capa = BNXT_DEV_RX_OFFLOAD_SUPPORT;
-       if (bp->flags & BNXT_FLAG_PTP_SUPPORTED)
-               dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
-       if (bp->vnic_cap_flags & BNXT_VNIC_CAP_VLAN_RX_STRIP)
-               dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_VLAN_STRIP;
+       dev_info->rx_offload_capa = bnxt_get_rx_port_offloads(bp);
        dev_info->tx_queue_offload_capa = RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
-       dev_info->tx_offload_capa = BNXT_DEV_TX_OFFLOAD_SUPPORT |
+       dev_info->tx_offload_capa = bnxt_get_tx_port_offloads(bp) |
                                    dev_info->tx_queue_offload_capa;
-       if (bp->fw_cap & BNXT_FW_CAP_VLAN_TX_INSERT)
-               dev_info->tx_offload_capa |= RTE_ETH_TX_OFFLOAD_VLAN_INSERT;
        dev_info->flow_type_rss_offloads = BNXT_ETH_RSS_SUPPORT;
 
        dev_info->speed_capa = bnxt_get_speed_capabilities(bp);
@@ -1530,7 +1524,7 @@ static int bnxt_dev_stop(struct rte_eth_dev *eth_dev)
 }
 
 /* Unload the driver, release resources */
-static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
+int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 {
        struct bnxt *bp = eth_dev->data->dev_private;
 
@@ -1546,7 +1540,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
        return bnxt_dev_stop(eth_dev);
 }
 
-static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
+int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 {
        struct bnxt *bp = eth_dev->data->dev_private;
        uint64_t rx_offloads = eth_dev->data->dev_conf.rxmode.offloads;
@@ -1678,6 +1672,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
        rte_eal_alarm_cancel(bnxt_dev_reset_and_resume, (void *)bp);
        rte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp);
        bnxt_cancel_fc_thread(bp);
+       rte_eal_alarm_cancel(bnxt_handle_vf_cfg_change, (void *)bp);
 
        if (eth_dev->data->dev_started)
                ret = bnxt_dev_stop(eth_dev);
@@ -2130,8 +2125,6 @@ static int bnxt_rss_hash_update_op(struct rte_eth_dev *eth_dev,
                        return -EINVAL;
        }
 
-       bp->flags |= BNXT_FLAG_UPDATE_HASH;
-
        /* Update the default RSS VNIC(s) */
        vnic = BNXT_GET_DEFAULT_VNIC(bp);
        vnic->hash_type = bnxt_rte_to_hwrm_hash_types(rss_conf->rss_hf);
@@ -5886,8 +5879,7 @@ static void bnxt_free_ctx_mem_buf(struct bnxt_ctx_mem_buf_info *ctx)
        if (!ctx)
                return;
 
-       if (ctx->va)
-               rte_free(ctx->va);
+       rte_free(ctx->va);
 
        ctx->va = NULL;
        ctx->dma = RTE_BAD_IOVA;
@@ -6359,4 +6351,4 @@ bool is_bnxt_supported(struct rte_eth_dev *dev)
 RTE_LOG_REGISTER_SUFFIX(bnxt_logtype_driver, driver, NOTICE);
 RTE_PMD_REGISTER_PCI(net_bnxt, bnxt_rte_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_bnxt, bnxt_pci_id_map);
-
+RTE_PMD_REGISTER_KMOD_DEP(net_bnxt, "* igb_uio | uio_pci_generic | vfio-pci");