lkml.org 
[lkml]   [2020]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC patch 07/19] bpf: Provide BPF_PROG_RUN_PIN_ON_CPU() macro
Date
Mathieu Desnoyers <mathieu.desnoyers@efficios.com> writes:

> On 14-Feb-2020 02:39:24 PM, Thomas Gleixner wrote:
> [...]
>> +#define BPF_PROG_RUN_PIN_ON_CPU(prog, ctx) ({ \
>> + u32 ret; \
>> + migrate_disable(); \
>> + ret = __BPF_PROG_RUN(prog, ctx, bpf_dispatcher_nopfunc); \
>> + migrate_enable(); \
>> + ret; })
>
> Does it really have to be a statement expression with a local variable ?
>
> If so, we should consider renaming "ret" to "__ret" to minimize the
> chances of a caller issuing BPF_PROG_RUN_PIN_ON_CPU with "ret" as
> prog or ctx argument, which would lead to unexpected results.

Indeed. That really can be an inline.

Thanks,

tglx

\
 
 \ /
  Last update: 2020-02-14 20:37    [W:2.637 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site