From: Gagandeep Singh Date: Fri, 12 Apr 2019 12:28:53 +0000 (+0000) Subject: net/enetc: support physical addressing mode X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fa45fda8278171fb77e2cc56561294afa1e90c49;p=dpdk.git net/enetc: support physical addressing mode Support added for physical addressing mode and change driver flags to don't care. Signed-off-by: Gagandeep Singh --- diff --git a/doc/guides/rel_notes/release_19_05.rst b/doc/guides/rel_notes/release_19_05.rst index b0928a6d9e..0645e3220c 100644 --- a/doc/guides/rel_notes/release_19_05.rst +++ b/doc/guides/rel_notes/release_19_05.rst @@ -142,6 +142,12 @@ New Features * Added support for VXLAN-GPE packet. * Added support for VXLAN-GPE classification. +* **Updated the ENETC driver.** + + New features: + + * Added physical addressing mode support + * **Updated the QuickAssist Technology PMD.** Added support for AES-XTS with 128 and 256 bit AES keys. diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c index 023fe7517c..7a9a97deb5 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ #include @@ -334,14 +334,15 @@ static void enetc_setup_txbdr(struct enetc_hw *hw, struct enetc_bdr *tx_ring) { int idx = tx_ring->index; - uintptr_t base_addr; uint32_t tbmr; + phys_addr_t bd_address; - base_addr = (uintptr_t)tx_ring->bd_base; + bd_address = (phys_addr_t) + rte_mem_virt2iova((const void *)tx_ring->bd_base); enetc_txbdr_wr(hw, idx, ENETC_TBBAR0, - lower_32_bits((uint64_t)base_addr)); + lower_32_bits((uint64_t)bd_address)); enetc_txbdr_wr(hw, idx, ENETC_TBBAR1, - upper_32_bits((uint64_t)base_addr)); + upper_32_bits((uint64_t)bd_address)); enetc_txbdr_wr(hw, idx, ENETC_TBLENR, ENETC_RTBLENR_LEN(tx_ring->bd_count)); @@ -478,14 +479,15 @@ enetc_setup_rxbdr(struct enetc_hw *hw, struct enetc_bdr *rx_ring, struct rte_mempool *mb_pool) { int idx = rx_ring->index; - uintptr_t base_addr; uint16_t buf_size; + phys_addr_t bd_address; - base_addr = (uintptr_t)rx_ring->bd_base; + bd_address = (phys_addr_t) + rte_mem_virt2iova((const void *)rx_ring->bd_base); enetc_rxbdr_wr(hw, idx, ENETC_RBBAR0, - lower_32_bits((uint64_t)base_addr)); + lower_32_bits((uint64_t)bd_address)); enetc_rxbdr_wr(hw, idx, ENETC_RBBAR1, - upper_32_bits((uint64_t)base_addr)); + upper_32_bits((uint64_t)bd_address)); enetc_rxbdr_wr(hw, idx, ENETC_RBLENR, ENETC_RTBLENR_LEN(rx_ring->bd_count)); @@ -612,7 +614,7 @@ enetc_pci_remove(struct rte_pci_device *pci_dev) static struct rte_pci_driver rte_enetc_pmd = { .id_table = pci_id_enetc_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_IOVA_AS_VA, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING, .probe = enetc_pci_probe, .remove = enetc_pci_remove, }; diff --git a/drivers/net/enetc/enetc_rxtx.c b/drivers/net/enetc/enetc_rxtx.c index 631e2430d7..a31a387250 100644 --- a/drivers/net/enetc/enetc_rxtx.c +++ b/drivers/net/enetc/enetc_rxtx.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ #include @@ -64,7 +64,7 @@ enetc_xmit_pkts(void *tx_queue, txbd->buf_len = txbd->frm_len; txbd->flags = rte_cpu_to_le_16(ENETC_TXBD_FLAGS_F); txbd->addr = (uint64_t)(uintptr_t) - rte_cpu_to_le_64((size_t)tx_swbd->buffer_addr->buf_addr + + rte_cpu_to_le_64((size_t)tx_swbd->buffer_addr->buf_iova + tx_swbd->buffer_addr->data_off); i++; start++; @@ -91,7 +91,7 @@ enetc_refill_rx_ring(struct enetc_bdr *rx_ring, const int buff_cnt) rx_swbd->buffer_addr = rte_cpu_to_le_64(rte_mbuf_raw_alloc(rx_ring->mb_pool)); rxbd->w.addr = (uint64_t)(uintptr_t) - rx_swbd->buffer_addr->buf_addr + + rx_swbd->buffer_addr->buf_iova + rx_swbd->buffer_addr->data_off; /* clear 'R" as well */ rxbd->r.lstatus = 0;