[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200624153723.GA342397@localhost.localdomain>
Date: Wed, 24 Jun 2020 17:37:23 +0200
From: Lorenzo Bianconi <lorenzo@...nel.org>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc: Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Alexei Starovoitov <ast@...nel.org>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Daniel Borkmann <daniel@...earbox.net>,
Toke Høiland-Jørgensen <toke@...hat.com>,
lorenzo.bianconi@...hat.com, David Ahern <dsahern@...nel.org>
Subject: Re: [PATCH v3 bpf-next 9/9] selftest: add tests for XDP programs in
CPUMAP entries
> On Tue, Jun 23, 2020 at 2:40 PM Lorenzo Bianconi <lorenzo@...nel.org> wrote:
> >
> > Similar to what have been done for DEVMAP, introduce tests to verify
[...]
> > +SEC("xdp_cpumap/dummy_cm")
> > +int xdp_dummy_cm(struct xdp_md *ctx)
> > +{
> > + char fmt[] = "devmap redirect: dev %u len %u\n";
> > + void *data_end = (void *)(long)ctx->data_end;
> > + void *data = (void *)(long)ctx->data;
> > + unsigned int len = data_end - data;
> > +
> > + ingress_ifindex = ctx->ingress_ifindex;
>
> Have you checked the generated BPF assembly to verify
> ctx->ingress_ifindex is actually read? ingress_ifindex variable is
> declared static, so I'm guessing Clang just optimized it away. If you
> want to be sure this actually gets executed, make ingress_ifindex
> global var.
ack, thx for the review. I will fix it in v4.
Regards,
Lorenzo
>
> > +
> > + return XDP_PASS;
> > +}
> > +
> > +char _license[] SEC("license") = "GPL";
> > --
> > 2.26.2
> >
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists