[v2] tracepoint: fix compilation with C++
Checks
Commit Message
trace_mem is declared as 'void *' which triggers following error:
'...invalid conversion from ‘void*’ to ‘__rte_trace_header*’
[-fpermissive]...'
Fix this by adding proper typecast to 'struct __rte_trace_header *'.
Signed-off-by: Pawel Wodkowski <pawelwod@gmail.com>
Fixes: ebaee6409702 ("trace: simplify trace point headers")
Cc: david.marchand@redhat.com
---
lib/librte_eal/include/rte_trace_point.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hello Pawel,
Few suggestions:
1. use 'trace' instead of 'tracepoint' in subject line. i.e. "trace: fix compilation with C++"
1. Update change history.
2. Add Fixes tag.
3. Superseed the previous version of this fix.
Reference: http://patches.dpdk.org/patch/66396/
Rest Looks okay. Please submit next version with above update.
Regards
Sunil Kumar Kori
>-----Original Message-----
>From: Pawel Wodkowski <pawelwod@gmail.com>
>Sent: Tuesday, August 11, 2020 2:06 AM
>To: dev@dpdk.org
>Cc: Pawel Wodkowski <pawelwod@gmail.com>;
>david.marchand@redhat.com; Jerin Jacob Kollanukkaran
><jerinj@marvell.com>; Sunil Kumar Kori <skori@marvell.com>
>Subject: [EXT] [PATCH v2] tracepoint: fix compilation with C++
>
>External Email
>
>----------------------------------------------------------------------
>trace_mem is declared as 'void *' which triggers following error:
>'...invalid conversion from ‘void*’ to ‘__rte_trace_header*’
>[-fpermissive]...'
>
>Fix this by adding proper typecast to 'struct __rte_trace_header *'.
>
>Signed-off-by: Pawel Wodkowski <pawelwod@gmail.com>
>Fixes: ebaee6409702 ("trace: simplify trace point headers")
>Cc: david.marchand@redhat.com
>---
> lib/librte_eal/include/rte_trace_point.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/lib/librte_eal/include/rte_trace_point.h
>b/lib/librte_eal/include/rte_trace_point.h
>index b45171275..875de195a 100644
>--- a/lib/librte_eal/include/rte_trace_point.h
>+++ b/lib/librte_eal/include/rte_trace_point.h
>@@ -300,13 +300,13 @@ RTE_DECLARE_PER_LCORE(void *, trace_mem);
>static __rte_always_inline void * __rte_trace_mem_get(uint64_t in) {
>- struct __rte_trace_header *trace = RTE_PER_LCORE(trace_mem);
>+ struct __rte_trace_header *trace = (struct __rte_trace_header
>+*)RTE_PER_LCORE(trace_mem);
> const uint16_t sz = in & __RTE_TRACE_FIELD_SIZE_MASK;
>
> /* Trace memory is not initialized for this thread */
> if (unlikely(trace == NULL)) {
> __rte_trace_mem_per_thread_alloc();
>- trace = RTE_PER_LCORE(trace_mem);
>+ trace = (struct __rte_trace_header *)
>RTE_PER_LCORE(trace_mem);
> if (unlikely(trace == NULL))
> return NULL;
> }
>--
>2.17.1
Hi Sunil,
I finished porting app to DPDK 20.05 and I'm afraid that I can't
do anything more here as I don't have proper development
environment anymore nor the time for setting it up again. If you
find this change useful please take over it. Otherwise there will
be long time before I can send next version. Also, as DPDK is
deprecating Makefile build system, 20.05 might be last version
we are using.
Anyway, thanks for guidelines and wish you best.
Paweł
On 11.08.2020 11:29, Sunil Kumar Kori wrote:
> Hello Pawel,
>
> Few suggestions:
> 1. use 'trace' instead of 'tracepoint' in subject line. i.e. "trace: fix compilation with C++"
> 1. Update change history.
> 2. Add Fixes tag.
> 3. Superseed the previous version of this fix.
>
> Reference: http://patches.dpdk.org/patch/66396/
> Rest Looks okay. Please submit next version with above update.
>
> Regards
> Sunil Kumar Kori
>
>> -----Original Message-----
>> From: Pawel Wodkowski <pawelwod@gmail.com>
>> Sent: Tuesday, August 11, 2020 2:06 AM
>> To: dev@dpdk.org
>> Cc: Pawel Wodkowski <pawelwod@gmail.com>;
>> david.marchand@redhat.com; Jerin Jacob Kollanukkaran
>> <jerinj@marvell.com>; Sunil Kumar Kori <skori@marvell.com>
>> Subject: [EXT] [PATCH v2] tracepoint: fix compilation with C++
>>
>> External Email
>>
>> ----------------------------------------------------------------------
>> trace_mem is declared as 'void *' which triggers following error:
>> '...invalid conversion from ‘void*’ to ‘__rte_trace_header*’
>> [-fpermissive]...'
>>
>> Fix this by adding proper typecast to 'struct __rte_trace_header *'.
>>
>> Signed-off-by: Pawel Wodkowski <pawelwod@gmail.com>
>> Fixes: ebaee6409702 ("trace: simplify trace point headers")
>> Cc: david.marchand@redhat.com
>> ---
>> lib/librte_eal/include/rte_trace_point.h | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/librte_eal/include/rte_trace_point.h
>> b/lib/librte_eal/include/rte_trace_point.h
>> index b45171275..875de195a 100644
>> --- a/lib/librte_eal/include/rte_trace_point.h
>> +++ b/lib/librte_eal/include/rte_trace_point.h
>> @@ -300,13 +300,13 @@ RTE_DECLARE_PER_LCORE(void *, trace_mem);
>> static __rte_always_inline void * __rte_trace_mem_get(uint64_t in) {
>> - struct __rte_trace_header *trace = RTE_PER_LCORE(trace_mem);
>> + struct __rte_trace_header *trace = (struct __rte_trace_header
>> +*)RTE_PER_LCORE(trace_mem);
>> const uint16_t sz = in & __RTE_TRACE_FIELD_SIZE_MASK;
>>
>> /* Trace memory is not initialized for this thread */
>> if (unlikely(trace == NULL)) {
>> __rte_trace_mem_per_thread_alloc();
>> - trace = RTE_PER_LCORE(trace_mem);
>> + trace = (struct __rte_trace_header *)
>> RTE_PER_LCORE(trace_mem);
>> if (unlikely(trace == NULL))
>> return NULL;
>> }
>> --
>> 2.17.1
Hello Pawel,
No problem. I will take care of this and send next version with updated information.
Regards
Sunil Kumar Kori
>-----Original Message-----
>From: Pawel Wodkowski <pawelwod@gmail.com>
>Sent: Tuesday, August 11, 2020 7:04 PM
>To: Sunil Kumar Kori <skori@marvell.com>; dev@dpdk.org
>Cc: david.marchand@redhat.com; Jerin Jacob Kollanukkaran
><jerinj@marvell.com>
>Subject: Re: [EXT] [PATCH v2] tracepoint: fix compilation with C++
>
>Hi Sunil,
>
>I finished porting app to DPDK 20.05 and I'm afraid that I can't do anything
>more here as I don't have proper development environment anymore nor the
>time for setting it up again. If you find this change useful please take over it.
>Otherwise there will be long time before I can send next version. Also, as
>DPDK is deprecating Makefile build system, 20.05 might be last version we are
>using.
>
>Anyway, thanks for guidelines and wish you best.
>
>Paweł
>
>On 11.08.2020 11:29, Sunil Kumar Kori wrote:
>> Hello Pawel,
>>
>> Few suggestions:
>> 1. use 'trace' instead of 'tracepoint' in subject line. i.e. "trace: fix compilation
>with C++"
>> 1. Update change history.
>> 2. Add Fixes tag.
>> 3. Superseed the previous version of this fix.
>>
>> Reference:
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__patches.dpdk.org_p
>>
>atch_66396_&d=DwIDaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=dXeXaAMkP5COg
>n1zxHMyaF
>>
>1_d9IIuq6vHQO6NrIPjaE&m=jmriYGtutfDqnB0UfW9ali2yisBvQVKQXWkNkDGx
>vgE&s=
>> teGvP5nM7eaYsOm69KvpblaGF5ct--schiCF74Mab_k&e=
>> Rest Looks okay. Please submit next version with above update.
>>
>> Regards
>> Sunil Kumar Kori
>>
>>> -----Original Message-----
>>> From: Pawel Wodkowski <pawelwod@gmail.com>
>>> Sent: Tuesday, August 11, 2020 2:06 AM
>>> To: dev@dpdk.org
>>> Cc: Pawel Wodkowski <pawelwod@gmail.com>;
>david.marchand@redhat.com;
>>> Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Sunil Kumar Kori
>>> <skori@marvell.com>
>>> Subject: [EXT] [PATCH v2] tracepoint: fix compilation with C++
>>>
>>> External Email
>>>
>>> ---------------------------------------------------------------------
>>> - trace_mem is declared as 'void *' which triggers following error:
>>> '...invalid conversion from ‘void*’ to ‘__rte_trace_header*’
>>> [-fpermissive]...'
>>>
>>> Fix this by adding proper typecast to 'struct __rte_trace_header *'.
>>>
>>> Signed-off-by: Pawel Wodkowski <pawelwod@gmail.com>
>>> Fixes: ebaee6409702 ("trace: simplify trace point headers")
>>> Cc: david.marchand@redhat.com
>>> ---
>>> lib/librte_eal/include/rte_trace_point.h | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/lib/librte_eal/include/rte_trace_point.h
>>> b/lib/librte_eal/include/rte_trace_point.h
>>> index b45171275..875de195a 100644
>>> --- a/lib/librte_eal/include/rte_trace_point.h
>>> +++ b/lib/librte_eal/include/rte_trace_point.h
>>> @@ -300,13 +300,13 @@ RTE_DECLARE_PER_LCORE(void *, trace_mem);
>>> static __rte_always_inline void * __rte_trace_mem_get(uint64_t in) {
>>> - struct __rte_trace_header *trace = RTE_PER_LCORE(trace_mem);
>>> + struct __rte_trace_header *trace = (struct __rte_trace_header
>>> +*)RTE_PER_LCORE(trace_mem);
>>> const uint16_t sz = in & __RTE_TRACE_FIELD_SIZE_MASK;
>>>
>>> /* Trace memory is not initialized for this thread */
>>> if (unlikely(trace == NULL)) {
>>> __rte_trace_mem_per_thread_alloc();
>>> - trace = RTE_PER_LCORE(trace_mem);
>>> + trace = (struct __rte_trace_header *)
>>> RTE_PER_LCORE(trace_mem);
>>> if (unlikely(trace == NULL))
>>> return NULL;
>>> }
>>> --
>>> 2.17.1
@@ -300,13 +300,13 @@ RTE_DECLARE_PER_LCORE(void *, trace_mem);
static __rte_always_inline void *
__rte_trace_mem_get(uint64_t in)
{
- struct __rte_trace_header *trace = RTE_PER_LCORE(trace_mem);
+ struct __rte_trace_header *trace = (struct __rte_trace_header *)RTE_PER_LCORE(trace_mem);
const uint16_t sz = in & __RTE_TRACE_FIELD_SIZE_MASK;
/* Trace memory is not initialized for this thread */
if (unlikely(trace == NULL)) {
__rte_trace_mem_per_thread_alloc();
- trace = RTE_PER_LCORE(trace_mem);
+ trace = (struct __rte_trace_header *) RTE_PER_LCORE(trace_mem);
if (unlikely(trace == NULL))
return NULL;
}