net/bnxt: fix big endian build
[dpdk.git] / drivers / net / bnxt / bnxt_ethdev.c
index 858e65d..da0de21 100644 (file)
@@ -30,7 +30,7 @@
 
 #define DRV_MODULE_NAME                "bnxt"
 static const char bnxt_version[] =
-       "Broadcom NetXtreme driver " DRV_MODULE_NAME "\n";
+       "Broadcom NetXtreme driver " DRV_MODULE_NAME;
 int bnxt_logtype_driver;
 
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
@@ -2649,7 +2649,7 @@ static int bnxt_map_regs(struct bnxt *bp, uint32_t *reg_arr, int count,
                        return -ERANGE;
        }
        win_off = BNXT_GRCPF_REG_WINDOW_BASE_OUT + (reg_win - 1) * 4;
-       rte_cpu_to_le_32(rte_write32(reg_base, (uint8_t *)bp->bar0 + win_off));
+       rte_write32(reg_base, (uint8_t *)bp->bar0 + win_off);
        return 0;
 }
 
@@ -2680,10 +2680,10 @@ static int bnxt_map_ptp_regs(struct bnxt *bp)
 
 static void bnxt_unmap_ptp_regs(struct bnxt *bp)
 {
-       rte_cpu_to_le_32(rte_write32(0, (uint8_t *)bp->bar0 +
-                        BNXT_GRCPF_REG_WINDOW_BASE_OUT + 16));
-       rte_cpu_to_le_32(rte_write32(0, (uint8_t *)bp->bar0 +
-                        BNXT_GRCPF_REG_WINDOW_BASE_OUT + 20));
+       rte_write32(0, (uint8_t *)bp->bar0 +
+                        BNXT_GRCPF_REG_WINDOW_BASE_OUT + 16);
+       rte_write32(0, (uint8_t *)bp->bar0 +
+                        BNXT_GRCPF_REG_WINDOW_BASE_OUT + 20);
 }
 
 static uint64_t bnxt_cc_read(struct bnxt *bp)
@@ -2733,8 +2733,8 @@ static int bnxt_get_rx_ts(struct bnxt *bp, uint64_t *ts)
                return -EAGAIN;
 
        port_id = pf->port_id;
-       rte_cpu_to_le_32(rte_write32(1 << port_id, (uint8_t *)bp->bar0 +
-              ptp->rx_mapped_regs[BNXT_PTP_RX_FIFO_ADV]));
+       rte_write32(1 << port_id, (uint8_t *)bp->bar0 +
+              ptp->rx_mapped_regs[BNXT_PTP_RX_FIFO_ADV]);
 
        fifo = rte_le_to_cpu_32(rte_read32((uint8_t *)bp->bar0 +
                                   ptp->rx_mapped_regs[BNXT_PTP_RX_FIFO]));
@@ -3242,10 +3242,8 @@ skip_init:
                memset(mz->addr, 0, mz->len);
                mz_phys_addr = mz->iova;
                if ((unsigned long)mz->addr == mz_phys_addr) {
-                       PMD_DRV_LOG(WARNING,
-                               "Memzone physical address same as virtual.\n");
-                       PMD_DRV_LOG(WARNING,
-                               "Using rte_mem_virt2iova()\n");
+                       PMD_DRV_LOG(INFO,
+                               "Memzone physical address same as virtual using rte_mem_virt2iova()\n");
                        mz_phys_addr = rte_mem_virt2iova(mz->addr);
                        if (mz_phys_addr == 0) {
                                PMD_DRV_LOG(ERR,
@@ -3501,10 +3499,6 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev)
        bnxt_disable_int(bp);
        bnxt_free_int(bp);
        bnxt_free_mem(bp);
-       if (eth_dev->data->mac_addrs != NULL) {
-               rte_free(eth_dev->data->mac_addrs);
-               eth_dev->data->mac_addrs = NULL;
-       }
        if (bp->grp_info != NULL) {
                rte_free(bp->grp_info);
                bp->grp_info = NULL;
@@ -3542,13 +3536,17 @@ static int bnxt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 static int bnxt_pci_remove(struct rte_pci_device *pci_dev)
 {
-       return rte_eth_dev_pci_generic_remove(pci_dev, bnxt_dev_uninit);
+       if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+               return rte_eth_dev_pci_generic_remove(pci_dev,
+                               bnxt_dev_uninit);
+       else
+               return rte_eth_dev_pci_generic_remove(pci_dev, NULL);
 }
 
 static struct rte_pci_driver bnxt_rte_pmd = {
        .id_table = bnxt_pci_id_map,
        .drv_flags = RTE_PCI_DRV_NEED_MAPPING |
-               RTE_PCI_DRV_INTR_LSC,
+               RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_IOVA_AS_VA,
        .probe = bnxt_pci_probe,
        .remove = bnxt_pci_remove,
 };
@@ -3571,7 +3569,7 @@ RTE_INIT(bnxt_init_log)
 {
        bnxt_logtype_driver = rte_log_register("pmd.net.bnxt.driver");
        if (bnxt_logtype_driver >= 0)
-               rte_log_set_level(bnxt_logtype_driver, RTE_LOG_INFO);
+               rte_log_set_level(bnxt_logtype_driver, RTE_LOG_NOTICE);
 }
 
 RTE_PMD_REGISTER_PCI(net_bnxt, bnxt_rte_pmd);