Xen DOM0 runtime support
cover Xen DOM0 runtime support
It should be possible to build a single application or library that will work both in Xen and non-Xen environment. Any special case handling should be done at runtime.
Stephen Hemminger (6):
xen: allow determining DOM0 at runtime
ethdev: add common function for reserving DMA regions
e1000: use rte_eth_dma_zone_reserve
ixgbe: use rte_eth_dma_zone_reserve
i40e: use rte_eth_dma_zone_reserve
fm10k: use rte_eth_dma_zone_reserve
drivers/net/e1000/em_rxtx.c | 38 ++--------- drivers/net/e1000/igb_rxtx.c | 41 ++---------- drivers/net/fm10k/fm10k_ethdev.c | 47 ++------------ drivers/net/i40e/i40e_ethdev.c | 9 --- drivers/net/i40e/i40e_fdir.c | 5 +- drivers/net/i40e/i40e_rxtx.c | 94 ++++++---------------------- drivers/net/ixgbe/ixgbe_rxtx.c | 47 ++------------ lib/librte_eal/common/include/rte_memory.h | 30 ++++++++- lib/librte_eal/linuxapp/eal/eal_memory.c | 7 +++ lib/librte_eal/linuxapp/eal/eal_xen_memory.c | 2 +- lib/librte_ether/rte_ethdev.c | 24 +++++++ lib/librte_ether/rte_ethdev.h | 23 +++++++ lib/librte_mempool/rte_mempool.c | 48 +++++++++----- lib/librte_mempool/rte_mempool.h | 3 +- 14 files changed, 160 insertions(+), 258 deletions(-)
Signature · 1 line
2.1.4
PATCH 1/6 xen: allow determining DOM0 at runtime
Add memory infrastructure for runtime Xen DOM0 support.
--- lib/librte_eal/common/include/rte_memory.h | 30 ++++++++++++++++- lib/librte_eal/linuxapp/eal/eal_memory.c | 7 ++++ lib/librte_eal/linuxapp/eal/eal_xen_memory.c | 2 +- lib/librte_mempool/rte_mempool.c | 48 ++++++++++++++++++++-------- lib/librte_mempool/rte_mempool.h | 3 +- 5 files changed, 72 insertions(+), 18 deletions(-)
lib/librte_eal/common/include/rte_memory.h +29 -1
@@ -52,6 +52,8 @@extern "C" {#endif +#include <rte_common.h> +enum rte_page_sizes {RTE_PGSIZE_4K =1ULL <<12 ,RTE_PGSIZE_64K =1ULL <<16 ,
@@ -180,6 +182,13 @@ unsigned rte_memory_get_nchannel(void);unsigned rte_memory_get_nrank (void );#ifdef RTE_LIBRTE_XEN_DOM0 + +/**< Internal use only - should DOM0 memory mapping be used */ +extern int is_xen_dom0_supported (void ); + +/**< Internal use only - phys to virt mapping for xen */ +phys_addr_t rte_xen_mem_phy2mch (uint32_t ,const phys_addr_t ); +/** * Return the physical address of elt, which is an element of the pool mp. *
@@ -191,7 +200,14 @@ unsigned rte_memory_get_nrank(void);* @return * The physical address or error. */ -phys_addr_t rte_mem_phy2mch (uint32_t memseg_id,const phys_addr_t phy_addr); +static inline phys_addr_t +rte_mem_phy2mch (uint32_t memseg_id,const phys_addr_t phy_addr) +{ +if (is_xen_dom0_supported ()) +return rte_xen_mem_phy2mch (memseg_id, phy_addr); +else +return phy_addr; +}/** * Memory init for supporting application running on Xen domain0.
@@ -214,7 +230,19 @@ int rte_xen_dom0_memory_init(void);* negative: error */ int rte_xen_dom0_memory_attach (void ); +#else +static inline int is_xen_dom0_supported (void ) +{ +return 0 ; +} + +static inline phys_addr_t +rte_mem_phy2mch(uint32_t memseg_id __rte_unused, const phys_addr_t phy_addr) +{ +return phy_addr; +}#endif + #ifdef __cplusplus }#endif
lib/librte_eal/linuxapp/eal/eal_memory.c +7 -0
@@ -97,6 +97,13 @@#include "eal_filesystem.h" #include "eal_hugepages.h" +#ifdef RTE_LIBRTE_XEN_DOM0 +int is_xen_dom0_supported (void ) +{ +return internal_config.xen_dom0_support; +} +#endif +/** * @file * Huge page mapping under linux
lib/librte_eal/linuxapp/eal/eal_xen_memory.c +1 -1
@@ -156,7 +156,7 @@ get_xen_memory_size(void)* Based on physical address to caculate MFN in Xen Dom0. */ phys_addr_t -rte_mem_phy2mch (uint32_t memseg_id,const phys_addr_t phy_addr) +rte_xen_mem_phy2mch (uint32_t memseg_id,const phys_addr_t phy_addr) {int mfn_id;uint64_t mfn, mfn_offset;
lib/librte_mempool/rte_mempool.c +34 -14
60 lines not on this page · raw message
lib/librte_mempool/rte_mempool.h +1 -2
@@ -640,7 +640,6 @@ rte_mempool_xmem_create(const char *name, unsigned n, unsigned elt_size, int socket_id, unsigned flags, void *vaddr, const phys_addr_t paddr[], uint32_t pg_num, uint32_t pg_shift); -#ifdef RTE_LIBRTE_XEN_DOM0 /** * Create a new mempool named *name* in memory on Xen Dom0. *
@@ -728,7 +727,7 @@ rte_dom0_mempool_create(const char *name, unsigned n, unsigned elt_size, rte_mempool_ctor_t *mp_init, void *mp_init_arg, rte_mempool_obj_ctor_t *obj_init, void *obj_init_arg, int socket_id, unsigned flags); -#endif +/** * Dump the status of the mempool to the console.
Signature · 1 line
2.1.4
Re: [PATCH 1/6] xen: allow determining DOM0 at runtime
2015-09-28 17:44, Stephen Hemminger:
Quoted 10 lines
Add memory infrastructure for runtime Xen DOM0 support.
Signed-off-by Stephen Hemminger <[email protected]>--- lib/librte_eal/common/include/rte_memory.h | 30 ++++++++++++++++- lib/librte_eal/linuxapp/eal/eal_memory.c | 7 ++++ lib/librte_eal/linuxapp/eal/eal_xen_memory.c | 2 +- lib/librte_mempool/rte_mempool.c | 48 ++++++++++++++++++++-------- lib/librte_mempool/rte_mempool.h | 3 +- 5 files changed, 72 insertions(+), 18 deletions(-)
Sergio, Olivier, any comment?
PATCH 2/6 ethdev: add common function for reserving DMA regions
In reply to Stephen HemmingerThe code to create aligned DMA regions was copy-n-pasted throughout all the drivers. Since this code has to change now create a common function that just does the right thing for Xen at runtime.
--- lib/librte_ether/rte_ethdev.c | 24 ++++++++++++++++++++++++ lib/librte_ether/rte_ethdev.h | 23 +++++++++++++++++++++++ 2 files changed, 47 insertions(+)
lib/librte_ether/rte_ethdev.c +24 -0
@@ -3066,6 +3066,30 @@ rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data)return 0 ; } + +const struct rte_memzone * +rte_eth_dma_zone_reserve (const struct rte_eth_dev *dev,const char *ring_name, +uint16_t queue_id,size_t size,unsigned align, +int socket_id) +{ +char z_name[RTE_MEMZONE_NAMESIZE ]; +const struct rte_memzone *mz; + +snprintf (z_name,sizeof (z_name),"%s_%s_%d_%d" , + dev->driver->pci_drv.name, ring_name, + dev->data->port_id, queue_id); + + mz =rte_memzone_lookup (z_name); +if (mz) +return mz; + +if (is_xen_dom0_supported ()) +return rte_memzone_reserve_bounded (z_name, size, socket_id, +0 , align,RTE_PGSIZE_2M ); +else +return rte_memzone_reserve_aligned (z_name, size, socket_id, +0 , align); +} int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id,
lib/librte_ether/rte_ethdev.h +23 -0
@@ -3978,6 +3978,29 @@ extern int rte_eth_timesync_read_rx_timestamp(uint8_t port_id,extern int rte_eth_timesync_read_tx_timestamp (uint8_t port_id,struct timespec *timestamp); +/** +* Create memzone for HW rings. +* malloc can't be used as the physical address is needed. +* If the memzone is already created, then this function returns a ptr +* to the old one. +* +* @param eth_dev +* The *eth_dev* pointer is the address of the *rte_eth_dev* structure +* @param name +* The name of the memory zone +* @param queue_id +* The index of the queue to add to name +* @param size +* The sizeof of the memory area +* @param align +* Alignment for resulting memzone. Must be a power of 2. +* @param socket_id +* The *socket_id* argument is the socket identifier in case of NUMA. +*/ +const struct rte_memzone * +rte_eth_dma_zone_reserve (const struct rte_eth_dev *eth_dev,const char *name, +uint16_t queue_id,size_t size, +unsigned align,int socket_id); #ifdef __cplusplus }#endif
Signature · 1 line
2.1.4
PATCH 3/6 e1000: use rte_eth_dma_zone_reserve
In reply to Stephen HemmingerUse common code to handle Xen support at runtime.
--- drivers/net/e1000/em_rxtx.c | 38 ++++---------------------------------- drivers/net/e1000/igb_rxtx.c | 41 ++++++----------------------------------- 2 files changed, 10 insertions(+), 69 deletions(-)
drivers/net/e1000/em_rxtx.c +4 -34
@@ -1104,28 +1104,6 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,#define EM_MAX_BUF_SIZE 16384#define EM_RCTL_FLXBUF_STEP 1024 -static const struct rte_memzone * -ring_dma_zone_reserve (struct rte_eth_dev *dev,const char *ring_name, -uint16_t queue_id,uint32_t ring_size,int socket_id) -{ -const struct rte_memzone *mz; -char z_name[RTE_MEMZONE_NAMESIZE ]; - -snprintf (z_name,sizeof (z_name),"%s_%s_%d_%d" , - dev->driver->pci_drv.name, ring_name, dev->data->port_id, - queue_id); - -if ((mz =rte_memzone_lookup (z_name)) !=0 ) -return (mz); - -#ifdef RTE_LIBRTE_XEN_DOM0 -return rte_memzone_reserve_bounded (z_name, ring_size, - socket_id,0 ,RTE_CACHE_LINE_SIZE ,RTE_PGSIZE_2M ); -#else -return rte_memzone_reserve (z_name, ring_size, socket_id,0 ); -#endif -} -static void em_tx_queue_release_mbufs (struct em_tx_queue *txq) {
@@ -1273,8 +1251,8 @@ eth_em_tx_queue_setup(struct rte_eth_dev *dev,* resizing in later calls to the queue setup function. */ tsize =sizeof (txq->tx_ring[0 ]) *EM_MAX_RING_DESC ; -if ((tz =ring_dma_zone_reserve (dev,"tx_ring" , queue_idx, tsize, - socket_id)) ==NULL ) +if ((tz =rte_eth_dma_zone_reserve (dev,"tx_ring" , queue_idx, tsize, +RTE_CACHE_LINE_SIZE , socket_id)) ==NULL )return (-ENOMEM );/* Allocate the tx queue data structure. */
@@ -1300,11 +1278,7 @@ eth_em_tx_queue_setup(struct rte_eth_dev *dev, txq->port_id = dev->data->port_id; txq->tdt_reg_addr =E1000_PCI_REG_ADDR (hw,E1000_TDT (queue_idx)); -#ifndef RTE_LIBRTE_XEN_DOM0 - txq->tx_ring_phys_addr = (uint64_t ) tz->phys_addr; -#else txq->tx_ring_phys_addr =rte_mem_phy2mch (tz->memseg_id, tz->phys_addr); -#endif txq->tx_ring = (struct e1000_data_desc *) tz->addr; PMD_INIT_LOG(DEBUG, "sw_ring=%p hw_ring=%p dma_addr=0x%"PRIx64,
@@ -1400,8 +1374,8 @@ eth_em_rx_queue_setup(struct rte_eth_dev *dev,/* Allocate RX ring for max possible mumber of hardware descriptors. */ rsize =sizeof (rxq->rx_ring[0 ]) *EM_MAX_RING_DESC ; -if ((rz =ring_dma_zone_reserve (dev,"rx_ring" , queue_idx, rsize, - socket_id)) ==NULL ) +if ((rz =rte_eth_dma_zone_reserve (dev,"rx_ring" , queue_idx, rsize, +RTE_CACHE_LINE_SIZE , socket_id)) ==NULL )return (-ENOMEM );/* Allocate the RX queue data structure. */
@@ -1430,11 +1404,7 @@ eth_em_rx_queue_setup(struct rte_eth_dev *dev, rxq->rdt_reg_addr =E1000_PCI_REG_ADDR (hw,E1000_RDT (queue_idx)); rxq->rdh_reg_addr =E1000_PCI_REG_ADDR (hw,E1000_RDH (queue_idx)); -#ifndef RTE_LIBRTE_XEN_DOM0 - rxq->rx_ring_phys_addr = (uint64_t ) rz->phys_addr; -#else rxq->rx_ring_phys_addr =rte_mem_phy2mch (rz->memseg_id, rz->phys_addr); -#endif rxq->rx_ring = (struct e1000_rx_desc *) rz->addr; PMD_INIT_LOG(DEBUG, "sw_ring=%p hw_ring=%p dma_addr=0x%"PRIx64,
drivers/net/e1000/igb_rxtx.c +6 -35
73 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH 4/6 ixgbe: use rte_eth_dma_zone_reserve
In reply to Stephen HemmingerAdapt DMA memory for Xen at runtime.
--- drivers/net/ixgbe/ixgbe_rxtx.c | 47 ++++++------------------------------------ 1 file changed, 6 insertions(+), 41 deletions(-)
drivers/net/ixgbe/ixgbe_rxtx.c +6 -41
@@ -1839,35 +1839,6 @@ ixgbe_recv_pkts_lro_bulk_alloc(void *rx_queue, struct rte_mbuf **rx_pkts,#define IXGBE_MIN_RING_DESC 32#define IXGBE_MAX_RING_DESC 4096 -/* -* Create memzone for HW rings. malloc can't be used as the physical address is -* needed. If the memzone is already created, then this function returns a ptr -* to the old one. -*/ -static const struct rte_memzone * __attribute__((cold)) -ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name, - uint16_t queue_id, uint32_t ring_size, int socket_id) -{ -char z_name[RTE_MEMZONE_NAMESIZE ]; -const struct rte_memzone *mz; - -snprintf (z_name,sizeof (z_name),"%s_%s_%d_%d" , - dev->driver->pci_drv.name, ring_name, - dev->data->port_id, queue_id); - - mz =rte_memzone_lookup (z_name); -if (mz) -return mz; - -#ifdef RTE_LIBRTE_XEN_DOM0 -return rte_memzone_reserve_bounded (z_name, ring_size, - socket_id,0 ,IXGBE_ALIGN ,RTE_PGSIZE_2M ); -#else -return rte_memzone_reserve_aligned (z_name, ring_size, - socket_id,0 ,IXGBE_ALIGN ); -#endif -} -static void __attribute__((cold))ixgbe_tx_queue_release_mbufs (struct ixgbe_tx_queue *txq) {
@@ -2102,9 +2073,9 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,* handle the maximum ring size is allocated in order to allow for * resizing in later calls to the queue setup function. */ - tz =ring_dma_zone_reserve (dev,"tx_ring" , queue_idx, + tz =rte_eth_dma_zone_reserve (dev,"tx_ring" , queue_idx,sizeof (union ixgbe_adv_tx_desc ) *IXGBE_MAX_RING_DESC , - socket_id); +IXGBE_ALIGN , socket_id);if (tz ==NULL ) {ixgbe_tx_queue_release (txq);return (-ENOMEM );
@@ -2134,11 +2105,8 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, txq->tdt_reg_addr =IXGBE_PCI_REG_ADDR (hw,IXGBE_VFTDT (queue_idx)); else txq->tdt_reg_addr = IXGBE_PCI_REG_ADDR(hw, IXGBE_TDT(txq->reg_idx)); -#ifndef RTE_LIBRTE_XEN_DOM0 - txq->tx_ring_phys_addr = (uint64_t ) tz->phys_addr; -#else + txq->tx_ring_phys_addr =rte_mem_phy2mch (tz->memseg_id, tz->phys_addr); -#endif txq->tx_ring = (union ixgbe_adv_tx_desc *) tz->addr;/* Allocate software ring */
@@ -2408,8 +2376,8 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,* handle the maximum ring size is allocated in order to allow for * resizing in later calls to the queue setup function. */ - rz =ring_dma_zone_reserve (dev,"rx_ring" , queue_idx, -RX_RING_SZ , socket_id); + rz =rte_eth_dma_zone_reserve (dev,"rx_ring" , queue_idx, +RX_RING_SZ ,IXGBE_ALIGN , socket_id);if (rz ==NULL ) {ixgbe_rx_queue_release (rxq);return (-ENOMEM );
@@ -2438,11 +2406,8 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, rxq->rdh_reg_addr =IXGBE_PCI_REG_ADDR (hw,IXGBE_RDH (rxq->reg_idx)); } -#ifndef RTE_LIBRTE_XEN_DOM0 - rxq->rx_ring_phys_addr = (uint64_t ) rz->phys_addr; -#else + rxq->rx_ring_phys_addr =rte_mem_phy2mch (rz->memseg_id, rz->phys_addr); -#endif rxq->rx_ring = (union ixgbe_adv_rx_desc *) rz->addr;/*
Signature · 1 line
2.1.4
PATCH 5/6 i40e: use rte_eth_dma_zone_reserve
In reply to Stephen HemmingerHandle Xen support at runtime.
--- drivers/net/i40e/i40e_ethdev.c | 9 ---- drivers/net/i40e/i40e_fdir.c | 5 +-- drivers/net/i40e/i40e_rxtx.c | 94 ++++++++---------------------------------- 3 files changed, 19 insertions(+), 89 deletions(-)
drivers/net/i40e/i40e_ethdev.c +0 -9
@@ -2098,24 +2098,15 @@ i40e_allocate_dma_mem_d(__attribute__((unused)) struct i40e_hw *hw, id++;snprintf (z_name,sizeof (z_name),"i40e_dma_%" PRIu64, id); -#ifdef RTE_LIBRTE_XEN_DOM0 mz =rte_memzone_reserve_bounded (z_name, size,SOCKET_ID_ANY ,0 , alignment,RTE_PGSIZE_2M ); -#else - mz =rte_memzone_reserve_aligned (z_name, size,SOCKET_ID_ANY ,0 , - alignment); -#endif if (!mz)return I40E_ERR_NO_MEMORY ; mem->id = id; mem->size = size; mem->va = mz->addr; -#ifdef RTE_LIBRTE_XEN_DOM0 mem->pa =rte_mem_phy2mch (mz->memseg_id, mz->phys_addr); -#else - mem->pa = mz->phys_addr; -#endif return I40E_SUCCESS ; }
drivers/net/i40e/i40e_fdir.c +1 -4
@@ -275,11 +275,8 @@ i40e_fdir_setup(struct i40e_pf *pf) goto fail_mem; } pf->fdir.prg_pkt = mz->addr; -#ifdef RTE_LIBRTE_XEN_DOM0 pf->fdir.dma_addr =rte_mem_phy2mch (mz->memseg_id, mz->phys_addr); -#else - pf->fdir.dma_addr = (uint64_t )mz->phys_addr; -#endif + pf->fdir.match_counter_index =I40E_COUNTER_INDEX_FDIR (hw->pf_id);PMD_DRV_LOG (INFO ,"FDIR setup successfully, with programming queue %u." , vsi->base_queue);
drivers/net/i40e/i40e_rxtx.c +18 -76
166 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH 6/6 fm10k: use rte_eth_dma_zone_reserve
In reply to Stephen HemmingerAdapt to Xen at runtime.
--- drivers/net/fm10k/fm10k_ethdev.c | 47 +++++----------------------------------- 1 file changed, 6 insertions(+), 41 deletions(-)
drivers/net/fm10k/fm10k_ethdev.c +6 -41
@@ -1144,34 +1144,6 @@ check_nb_desc(uint16_t min, uint16_t max, uint16_t mult, uint16_t request)return 0 ; } -/* -* Create a memzone for hardware descriptor rings. Malloc cannot be used since -* the physical address is required. If the memzone is already created, then -* this function returns a pointer to the existing memzone. -*/ -static inline const struct rte_memzone * -allocate_hw_ring (const char *driver_name,const char *ring_name, -uint8_t port_id,uint16_t queue_id,int socket_id, -uint32_t size,uint32_t align) -{ -char name[RTE_MEMZONE_NAMESIZE ]; -const struct rte_memzone *mz; - -snprintf (name,sizeof (name),"%s_%s_%d_%d_%d" , - driver_name, ring_name, port_id, queue_id, socket_id); - -/* return the memzone if it already exists */ - mz =rte_memzone_lookup (name); -if (mz) -return mz; - -#ifdef RTE_LIBRTE_XEN_DOM0 -return rte_memzone_reserve_bounded (name, size, socket_id,0 , align, -RTE_PGSIZE_2M ); -#else -return rte_memzone_reserve_aligned (name, size, socket_id,0 , align); -#endif -}static inline int check_thresh (uint16_t min,uint16_t max,uint16_t div,uint16_t request)
@@ -1317,9 +1289,9 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,* enough to hold the maximum ring size is requested to allow for * resizing in later calls to the queue setup function. */ - mz =allocate_hw_ring (dev->driver->pci_drv.name,"rx_ring" , - dev->data->port_id, queue_id, socket_id, -FM10K_MAX_RX_RING_SZ ,FM10K_ALIGN_RX_DESC ); + mz =rte_eth_dma_zone_reserve (dev,"rx_ring" , queue_id, +FM10K_MAX_RX_RING_SZ ,FM10K_ALIGN_RX_DESC , + socket_id);if (mz ==NULL ) {PMD_INIT_LOG (ERR ,"Cannot allocate hardware ring" );rte_free (q->sw_ring);
@@ -1327,11 +1299,8 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,return (-ENOMEM ); } q->hw_ring = mz->addr; -#ifdef RTE_LIBRTE_XEN_DOM0 q->hw_ring_phys_addr =rte_mem_phy2mch (mz->memseg_id, mz->phys_addr); -#else q->hw_ring_phys_addr = mz->phys_addr; -#endif dev->data->rx_queues[queue_id] = q;return 0 ;
@@ -1467,9 +1436,9 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,* enough to hold the maximum ring size is requested to allow for * resizing in later calls to the queue setup function. */ - mz =allocate_hw_ring (dev->driver->pci_drv.name,"tx_ring" , - dev->data->port_id, queue_id, socket_id, -FM10K_MAX_TX_RING_SZ ,FM10K_ALIGN_TX_DESC ); + mz =rte_eth_dma_zone_reserve (dev,"tx_ring" , queue_id, +FM10K_MAX_TX_RING_SZ ,FM10K_ALIGN_TX_DESC , + socket_id);if (mz ==NULL ) {PMD_INIT_LOG (ERR ,"Cannot allocate hardware ring" );rte_free (q->sw_ring);
@@ -1477,11 +1446,7 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,return (-ENOMEM ); } q->hw_ring = mz->addr; -#ifdef RTE_LIBRTE_XEN_DOM0 q->hw_ring_phys_addr =rte_mem_phy2mch (mz->memseg_id, mz->phys_addr); -#else - q->hw_ring_phys_addr = mz->phys_addr; -#endif /* * allocate memory for the RS bit tracker. Enough slots to hold the
Signature · 1 line
2.1.4
Re: [PATCH 6/6] fm10k: use rte_eth_dma_zone_reserve
Quoted 26 lines · Stephen Hemminger
Adapt to Xen at runtime.
Signed-off-by Stephen Hemminger <[email protected]>--- drivers/net/fm10k/fm10k_ethdev.c | 47 +++++----------------------------------- 1 file changed, 6 insertions(+), 41 deletions(-)drivers/net/fm10k/fm10k_ethdev.c +0
-3@@ -1327,11 +1299,8 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev,uint16_t queue_id, return (-ENOMEM); } q->hw_ring = mz->addr; -#ifdef RTE_LIBRTE_XEN_DOM0 q->hw_ring_phys_addr =rte_mem_phy2mch (mz->memseg_id, mz->phys_addr); -#else q->hw_ring_phys_addr = mz->phys_addr; -#endif
Quoted 3 lines
dev->data->rx_queues[queue_id] = q;
return 0;"else" part has been forgotten.
Signature · 1 line
David Marchand
Re: [PATCH 6/6] fm10k: use rte_eth_dma_zone_reserve
2015-10-04 20:44, David Marchand:
Quoted 11 lines
On Tue, Sep 29, 2015 at 2:44 AM, Stephen Hemminger <
drivers/net/fm10k/fm10k_ethdev.c fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, · line 1334
Quoted 8 lines
drivers/net/fm10k/fm10k_ethdev.c +0
-1-#ifdef RTE_LIBRTE_XEN_DOM0 q->hw_ring_phys_addr = rte_mem_phy2mch(mz->memseg_id,
mz->phys_addr);drivers/net/fm10k/fm10k_ethdev.c +0
-2-#else q->hw_ring_phys_addr = mz->phys_addr; -#endif "else" part has been forgotten.
I could fix it before applying but it would be saner to have a v2. patchwork status: change requested
Quoted 35 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Stephen Hemminger
Sent: Monday, September 28, 2015 5:45 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH 0/6] Xen DOM0 runtime supportIt should be possible to build a single application or library that will work both in Xen and non-Xen environment. Any special case handling should be done at runtime.
Stephen Hemminger (6):
xen: allow determining DOM0 at runtime
ethdev: add common function for reserving DMA regions
e1000: userte_eth_dma_zone_reserve
ixgbe: userte_eth_dma_zone_reserve
i40e: userte_eth_dma_zone_reserve
fm10k: userte_eth_dma_zone_reservedrivers/net/e1000/em_rxtx.c | 38 ++--------- drivers/net/e1000/igb_rxtx.c | 41 ++---------- drivers/net/fm10k/fm10k_ethdev.c | 47 ++------------ drivers/net/i40e/i40e_ethdev.c | 9 --- drivers/net/i40e/i40e_fdir.c | 5 +- drivers/net/i40e/i40e_rxtx.c | 94 ++++++---------------------- drivers/net/ixgbe/ixgbe_rxtx.c | 47 ++------------ lib/librte_eal/common/include/rte_memory.h | 30 ++++++++- lib/librte_eal/linuxapp/eal/eal_memory.c | 7 +++ lib/librte_eal/linuxapp/eal/eal_xen_memory.c | 2 +- lib/librte_ether/rte_ethdev.c | 24 +++++++ lib/librte_ether/rte_ethdev.h | 23 +++++++ lib/librte_mempool/rte_mempool.c | 48 +++++++++----- lib/librte_mempool/rte_mempool.h | 3 +- 14 files changed, 160 insertions(+), 258 deletions(-)
Quoted 2 lines
--
2.1.4
This patch set looks good.
Hello Stephen,
Quoted 4 lines · Stephen Hemminger
It should be possible to build a single application or library that will work both in Xen and non-Xen environment. Any special case handling should be done at runtime.
This patchset looks good, but can you go a step further and completely remove the RTE_LIBRTE_XEN_DOM0 build option ?
This requires some more work (igb_uio, app/test), but I think this is worth it all the more so as you are looking into it at the moment.
Thanks.
Signature · 1 line
David Marchand
Quoted 10 lines · On Wed, 30 Sep 2015 10:14:09 +0200 David Marchand <[email protected]>…
Hello Stephen,
Quoted 4 lines · Stephen Hemminger
It should be possible to build a single application or library that will work both in Xen and non-Xen environment. Any special case handling should be done at runtime.
Quoted 4 lines
This patchset looks good, but can you go a step further and completely remove the
RTE_LIBRTE_XEN_DOM0build option ?
This requires some more work (igb_uio, app/test), but I think this is worth it all the more so as you are looking into it at the moment.
I was thinking that for people on embedded systems having the build option (which stubs out support) was a good thing.
2015-09-30 10:30, Stephen Hemminger:
Quoted 8 lines
Quoted 6 lines · On Wed, 30 Sep 2015 10:14:09 +0200 David Marchand <[email protected]>…
Quoted 3 lines · Stephen Hemminger
It should be possible to build a single application or library that will work both in Xen and non-Xen environment. Any special case handling should be done at runtime.
Quoted 7 lines
Quoted 4 lines
This patchset looks good, but can you go a step further and completely remove the
RTE_LIBRTE_XEN_DOM0build option ?
This requires some more work (igb_uio, app/test), but I think this is worth it all the more so as you are looking into it at the moment.I was thinking that for people on embedded systems having the build option (which stubs out support) was a good thing.
No we must remove the config options.
It is not in a hot path so there is no reason to disable this support. Please respin.
Quoted 14 lines · On Wed, 21 Oct 2015 16:40:08 +0200 Thomas Monjalon <[email protected]>…
2015-09-30 10:30, Stephen Hemminger:
Quoted 13 lines
Quoted 10 lines · On Wed, 30 Sep 2015 10:14:09 +0200 David Marchand <[email protected]>…
Quoted 3 lines · Stephen Hemminger
It should be possible to build a single application or library that will work both in Xen and non-Xen environment. Any special case handling should be done at runtime.
This patchset looks good, but can you go a step further and completely remove the
RTE_LIBRTE_XEN_DOM0build option ?
This requires some more work (igb_uio, app/test), but I think this is worth it all the more so as you are looking into it at the moment.
Quoted 6 lines
Quoted 2 lines
I was thinking that for people on embedded systems having the build option (which stubs out support) was a good thing.
No we must remove the config options.
It is not in a hot path so there is no reason to disable this support. Please respin.
I looked into this, But Xen dom0 is a driver as well, and DPDK as is makes all the drivers optional. Also, we don't use Xen dom0 directly (only the net-front driver), and therefore do not have the infrastructure to test that driver.