DPDK patches and discussions
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org, Stephen Hemminger <shemming@brocade.com>
Subject: Re: [dpdk-dev] [PATCH 1/4] xen: allow choosing dom0 support at runtime
Date: Sat, 14 Feb 2015 14:25:07 -0500	[thread overview]
Message-ID: <20150214192507.GA15594@neilslaptop.think-freely.org> (raw)
In-Reply-To: <1423937208-2063-1-git-send-email-shemming@brocade.com>

On Sat, Feb 14, 2015 at 01:06:45PM -0500, Stephen Hemminger wrote:
> The previous code would only allow building library and application
> so that it ran on Xen DOM0 or not on DOM0. This changes that to
> a runtime flag.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  lib/librte_eal/common/include/rte_memory.h |  4 +++
>  lib/librte_eal/linuxapp/eal/eal_memory.c   |  7 ++++
>  lib/librte_ether/rte_ethdev.c              | 22 ++++++++++++
>  lib/librte_ether/rte_ethdev.h              | 23 ++++++++++++
>  lib/librte_mempool/rte_mempool.c           | 26 +++++++-------
>  lib/librte_pmd_e1000/em_rxtx.c             | 30 +++-------------
>  lib/librte_pmd_e1000/igb_rxtx.c            | 52 +++++++++------------------
>  lib/librte_pmd_ixgbe/ixgbe_rxtx.c          | 58 +++++++++---------------------
>  8 files changed, 108 insertions(+), 114 deletions(-)
> 
> diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
> index 7f8103f..ab6c1ff 100644
> --- a/lib/librte_eal/common/include/rte_memory.h
> +++ b/lib/librte_eal/common/include/rte_memory.h
> @@ -176,6 +176,10 @@ 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);
> +
>  /**
>   * Return the physical address of elt, which is an element of the pool mp.
>   *
> diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
> index a67a1b0..4afda2a 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_memory.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
> @@ -98,6 +98,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
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index ea3a1fb..457e0bc 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -2825,6 +2825,27 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
>  	}
>  	rte_spinlock_unlock(&rte_eth_dev_cb_lock);
>  }
> +
> +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;
> +
> +	return rte_memzone_reserve_bounded(z_name, size,
> +					   socket_id, 0, align, RTE_PGSIZE_2M);
> +}
> +
>  #ifdef RTE_NIC_BYPASS
>  int rte_eth_dev_bypass_init(uint8_t port_id)
>  {
> @@ -3003,6 +3024,7 @@ rte_eth_dev_bypass_wd_reset(uint8_t port_id)
>  	(*dev->dev_ops->bypass_wd_reset)(dev);
>  	return 0;
>  }
> +
Nit: I think you meant to remove that space.

>  #endif
>  
>  int
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 1200c1c..747acb5 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -3664,6 +3664,29 @@ int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_ty
>  int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type,
>  			enum rte_filter_op filter_op, void *arg);
>  
> +/**
> + * 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);
I think this is an exported funciton right?  It needs to be added to the version
map.

neil

  parent reply	other threads:[~2015-02-14 19:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-14 18:06 Stephen Hemminger
2015-02-14 18:06 ` [dpdk-dev] [PATCH 2/4] xen: add phys-addr command line argument Stephen Hemminger
2015-02-14 18:06 ` [dpdk-dev] [PATCH 3/4] xen: add uio driver Stephen Hemminger
2015-02-14 18:06 ` [dpdk-dev] [PATCH 4/4] xen: net-front poll mode driver Stephen Hemminger
2015-02-14 19:31   ` Neil Horman
2015-02-14 19:25 ` Neil Horman [this message]
2015-02-15  4:07 [dpdk-dev] [PATCH 1/4] xen: allow choosing dom0 support at runtime Liu, Jijiang
2015-02-15 14:27 ` Stephen Hemminger
2015-02-26  6:53   ` Liu, Jijiang
2015-02-26  7:05     ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150214192507.GA15594@neilslaptop.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=dev@dpdk.org \
    --cc=shemming@brocade.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).