[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAG48ez0s9HC8eJhS-T2+SwrD_X7FQJmD9Br72zcnnMVFTwhVwQ@mail.gmail.com>
Date: Tue, 26 Mar 2019 19:26:59 +0100
From: Jann Horn <jannh@...gle.com>
To: Jiong Wang <jiong.wang@...ronome.com>
Cc: Alexei Starovoitov <alexei.starovoitov@...il.com>,
Daniel Borkmann <daniel@...earbox.net>, bpf@...r.kernel.org,
Network Development <netdev@...r.kernel.org>,
oss-drivers@...ronome.com
Subject: Re: [PATCH/RFC bpf-next 02/16] bpf: refactor propagate_live implementation
On Tue, Mar 26, 2019 at 7:07 PM Jiong Wang <jiong.wang@...ronome.com> wrote:
> Some code inside current implementation of "propagate_liveness" is a little
> bit verbose.
>
> This patch refactor them so the code looks more simple and more clear.
>
> The redundant usage of "vparent->frame[vstate->curframe]" is removed as we
> are here. It is safe to do this because "state_equal" has guaranteed that
> vstate->curframe must be equal with vparent->curframe.
[...]
> @@ -6050,6 +6050,22 @@ static bool states_equal(struct bpf_verifier_env *env,
> return true;
> }
>
> +static int propagate_liveness_reg(struct bpf_verifier_env *env,
> + struct bpf_reg_state *reg,
> + struct bpf_reg_state *parent_reg, u8 flag)
This function takes four arguments...
[...]
> @@ -6071,16 +6088,13 @@ static int propagate_liveness(struct bpf_verifier_env *env,
[...]
> + err = propagate_liveness_reg(env, ®s[i], &parent_regs[i]);
.. but both here...
[...]
> @@ -6089,11 +6103,13 @@ static int propagate_liveness(struct bpf_verifier_env *env,
[...]
> + err = propagate_liveness_reg(env, reg, parent_reg);
... and here you only pass in three arguments? Does this compile?
Powered by blists - more mailing lists