eal/bsd: fix config creation

Message ID 493e71dafcaac5b4a9388e3139a2b7fec465b06d.1562942880.git.anatoly.burakov@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series eal/bsd: fix config creation |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation fail apply issues

Commit Message

Anatoly Burakov July 12, 2019, 2:48 p.m. UTC
  The config create function did not store the mem config address in
the shared memconfig structure, so the secondary processes couldn't
map it at the requred address.

Fixes: b149a7064261 ("eal/freebsd: add config reattach in secondary process")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/freebsd/eal/eal.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Bruce Richardson July 12, 2019, 2:56 p.m. UTC | #1
On Fri, Jul 12, 2019 at 03:48:08PM +0100, Anatoly Burakov wrote:
> The config create function did not store the mem config address in
> the shared memconfig structure, so the secondary processes couldn't
> map it at the requred address.
> 
> Fixes: b149a7064261 ("eal/freebsd: add config reattach in secondary process")
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Thomas Monjalon July 14, 2019, 1:30 p.m. UTC | #2
12/07/2019 16:56, Bruce Richardson:
> On Fri, Jul 12, 2019 at 03:48:08PM +0100, Anatoly Burakov wrote:
> > The config create function did not store the mem config address in
> > the shared memconfig structure, so the secondary processes couldn't
> > map it at the requred address.
> > 
> > Fixes: b149a7064261 ("eal/freebsd: add config reattach in secondary process")
> > 
> > Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> > ---
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_eal/freebsd/eal/eal.c b/lib/librte_eal/freebsd/eal/eal.c
index 13ca1202c..d53f0fe69 100644
--- a/lib/librte_eal/freebsd/eal/eal.c
+++ b/lib/librte_eal/freebsd/eal/eal.c
@@ -266,6 +266,11 @@  rte_eal_config_create(void)
 	memcpy(rte_mem_cfg_addr, &early_mem_config, sizeof(early_mem_config));
 	rte_config.mem_config = rte_mem_cfg_addr;
 
+	/* store address of the config in the config itself so that secondary
+	 * processes could later map the config into this exact location
+	 */
+	rte_config.mem_config->mem_cfg_addr = (uintptr_t) rte_mem_cfg_addr;
+
 	return 0;
 }