[dpdk-dev] [PATCH v2] mem: fix freeing of memzone used by ivshmem

2016-04-29 Thread Thomas Monjalon
2016-04-21 12:21, Sergio Gonzalez Monroy:
> On 15/04/2016 09:29, Mauricio Vasquez B wrote:
> > although previous implementation returned an error when trying to release a
> > memzone assigned to an ivshmem device, it stills freed it.
> >
> > Fixes: cd10c42eb5bc ("mem: fix ivshmem freeing")
> >
> > Signed-off-by: Mauricio Vasquez B  > studenti.polito.it>
> > ---
> > v2:
> > solved compilation problem when ivshmem is disabled
> >   lib/librte_eal/common/eal_common_memzone.c | 10 +++---
> >   1 file changed, 7 insertions(+), 3 deletions(-)
> 
> This time I have waited to see the test-report (which I should have done 
> for the v1).
> 
> Acked-by: Sergio Gonzalez Monroy 

Applied, thanks


[dpdk-dev] [PATCH v2] mem: fix freeing of memzone used by ivshmem

2016-04-21 Thread Sergio Gonzalez Monroy
On 15/04/2016 09:29, Mauricio Vasquez B wrote:
> although previous implementation returned an error when trying to release a
> memzone assigned to an ivshmem device, it stills freed it.
>
> Fixes: cd10c42eb5bc ("mem: fix ivshmem freeing")
>
> Signed-off-by: Mauricio Vasquez B  studenti.polito.it>
> ---
> v2:
> solved compilation problem when ivshmem is disabled
>   lib/librte_eal/common/eal_common_memzone.c | 10 +++---
>   1 file changed, 7 insertions(+), 3 deletions(-)

This time I have waited to see the test-report (which I should have done 
for the v1).

Acked-by: Sergio Gonzalez Monroy 


[dpdk-dev] [PATCH v2] mem: fix freeing of memzone used by ivshmem

2016-04-15 Thread Mauricio Vasquez B
although previous implementation returned an error when trying to release a
memzone assigned to an ivshmem device, it stills freed it.

Fixes: cd10c42eb5bc ("mem: fix ivshmem freeing")

Signed-off-by: Mauricio Vasquez B 
---
v2: 
solved compilation problem when ivshmem is disabled
 lib/librte_eal/common/eal_common_memzone.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_memzone.c 
b/lib/librte_eal/common/eal_common_memzone.c
index 711c845..a8f804c 100644
--- a/lib/librte_eal/common/eal_common_memzone.c
+++ b/lib/librte_eal/common/eal_common_memzone.c
@@ -321,15 +321,19 @@ rte_memzone_free(const struct rte_memzone *mz)
idx = ((uintptr_t)mz - (uintptr_t)mcfg->memzone);
idx = idx / sizeof(struct rte_memzone);

-   addr = mcfg->memzone[idx].addr;
 #ifdef RTE_LIBRTE_IVSHMEM
/*
 * If ioremap_addr is set, it's an IVSHMEM memzone and we cannot
 * free it.
 */
-   if (mcfg->memzone[idx].ioremap_addr != 0)
-   ret = -EINVAL;
+   if (mcfg->memzone[idx].ioremap_addr != 0) {
+   rte_rwlock_write_unlock(>mlock);
+   return -EINVAL;
+   }
 #endif
+
+   addr = mcfg->memzone[idx].addr;
+
if (addr == NULL)
ret = -EINVAL;
else if (mcfg->memzone_cnt == 0) {
-- 
1.9.1