net/ice/base: remove VSI info from previous aggregator
[dpdk.git] / drivers / net / bnxt / bnxt_ethdev.c
index 96d2bef..c9536f7 100644 (file)
@@ -686,6 +686,38 @@ static int bnxt_update_phy_setting(struct bnxt *bp)
        return rc;
 }
 
+static void bnxt_free_prev_ring_stats(struct bnxt *bp)
+{
+       rte_free(bp->prev_rx_ring_stats);
+       rte_free(bp->prev_tx_ring_stats);
+
+       bp->prev_rx_ring_stats = NULL;
+       bp->prev_tx_ring_stats = NULL;
+}
+
+static int bnxt_alloc_prev_ring_stats(struct bnxt *bp)
+{
+       bp->prev_rx_ring_stats =  rte_zmalloc("bnxt_prev_rx_ring_stats",
+                                             sizeof(struct bnxt_ring_stats) *
+                                             bp->rx_cp_nr_rings,
+                                             0);
+       if (bp->prev_rx_ring_stats == NULL)
+               return -ENOMEM;
+
+       bp->prev_tx_ring_stats = rte_zmalloc("bnxt_prev_tx_ring_stats",
+                                            sizeof(struct bnxt_ring_stats) *
+                                            bp->tx_cp_nr_rings,
+                                            0);
+       if (bp->prev_tx_ring_stats == NULL)
+               goto error;
+
+       return 0;
+
+error:
+       bnxt_free_prev_ring_stats(bp);
+       return -ENOMEM;
+}
+
 static int bnxt_start_nic(struct bnxt *bp)
 {
        struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(bp->eth_dev);
@@ -948,7 +980,6 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 
        dev_info->speed_capa = bnxt_get_speed_capabilities(bp);
 
-       /* *INDENT-OFF* */
        dev_info->default_rxconf = (struct rte_eth_rxconf) {
                .rx_thresh = {
                        .pthresh = 8,
@@ -984,8 +1015,6 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
                                    BNXT_SWITCH_PORT_ID_TRUSTED_VF;
        }
 
-       /* *INDENT-ON* */
-
        /*
         * TODO: default_rxconf, default_txconf, rx_desc_lim, and tx_desc_lim
         *       need further investigation.
@@ -1476,6 +1505,7 @@ static int bnxt_dev_stop(struct rte_eth_dev *eth_dev)
        bnxt_shutdown_nic(bp);
        bnxt_hwrm_if_change(bp, false);
 
+       bnxt_free_prev_ring_stats(bp);
        rte_free(bp->mark_table);
        bp->mark_table = NULL;
 
@@ -1547,6 +1577,10 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
        if (rc)
                goto error;
 
+       rc = bnxt_alloc_prev_ring_stats(bp);
+       if (rc)
+               goto error;
+
        eth_dev->data->dev_started = 1;
 
        bnxt_link_update_op(eth_dev, 1);
@@ -5754,7 +5788,8 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
                goto error_free;
 
        PMD_DRV_LOG(INFO,
-                   DRV_MODULE_NAME "found at mem %" PRIX64 ", node addr %pM\n",
+                   "Found %s device at mem %" PRIX64 ", node addr %pM\n",
+                   DRV_MODULE_NAME,
                    pci_dev->mem_resource[0].phys_addr,
                    pci_dev->mem_resource[0].addr);