netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Tariq Toukan <tariqt@mellanox.com>
Cc: netdev@vger.kernel.org, John Fastabend <john.fastabend@gmail.com>,
	Eran Ben Elisha <eranbe@mellanox.com>,
	brouer@redhat.com
Subject: Re: [PATCH net-next 6/7] samples/bpf: xdp_redirect load XDP dummy prog on TX device
Date: Thu, 31 Aug 2017 12:15:36 +0200	[thread overview]
Message-ID: <20170831121536.14c8e0eb@redhat.com> (raw)
In-Reply-To: <be534824-72d9-5f58-70bd-45cca0877330@mellanox.com>

On Thu, 31 Aug 2017 13:08:22 +0300
Tariq Toukan <tariqt@mellanox.com> wrote:

> Hi Jesper,
> 
> On 29/08/2017 5:38 PM, Jesper Dangaard Brouer wrote:
> >   
> > +/* Redirect require an XDP bpf_prog loaded on the TX device */
> > +SEC("xdp_redirect_dummy")
> > +int xdp_redirect_dummy(struct xdp_md *ctx)
> > +{
> > +	return XDP_PASS;
> > +}
> > +  
> 
> I get a compilation error related to this:
> 
> $ make samples/bpf/
> 
> ...
> LLVM ERROR: 'xdp_redirect_dummy' label emitted multiple times to 
> assembly file
> make[1]: *** [samples/bpf/xdp_redirect_kern.o] Error 1
> make: *** [samples/bpf/] Error 2
> 
> 
> It can be fixed by the following patch.
> I can submit it in a separate mail if you want to.

Ups! - yes please submit an official fix-patch for this!

Below fix looks good to me...

> diff --git a/samples/bpf/xdp_redirect_kern.c 
> b/samples/bpf/xdp_redirect_kern.c
> index 1c90288d0203..8abb151e385f 100644
> --- a/samples/bpf/xdp_redirect_kern.c
> +++ b/samples/bpf/xdp_redirect_kern.c
> @@ -82,7 +82,7 @@ int xdp_redirect_prog(struct xdp_md *ctx)
> 
>   /* Redirect require an XDP bpf_prog loaded on the TX device */
>   SEC("xdp_redirect_dummy")
> -int xdp_redirect_dummy(struct xdp_md *ctx)
> +int xdp_redirect_dummy_prog(struct xdp_md *ctx)
>   {
>          return XDP_PASS;
>   }
> diff --git a/samples/bpf/xdp_redirect_map_kern.c 
> b/samples/bpf/xdp_redirect_map_kern.c
> index 79795d41ad0d..740a529ba84f 100644
> --- a/samples/bpf/xdp_redirect_map_kern.c
> +++ b/samples/bpf/xdp_redirect_map_kern.c
> @@ -84,7 +84,7 @@ int xdp_redirect_map_prog(struct xdp_md *ctx)
> 
>   /* Redirect require an XDP bpf_prog loaded on the TX device */
>   SEC("xdp_redirect_dummy")
> -int xdp_redirect_dummy(struct xdp_md *ctx)
> +int xdp_redirect_dummy_prog(struct xdp_md *ctx)
>   {
>          return XDP_PASS;
>   }

Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

  reply	other threads:[~2017-08-31 10:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29 14:37 [PATCH net-next 0/7] XDP redirect tracepoints Jesper Dangaard Brouer
2017-08-29 14:37 ` [PATCH net-next 1/7] xdp: remove redundant argument to trace_xdp_redirect Jesper Dangaard Brouer
2017-08-29 14:37 ` [PATCH net-next 2/7] xdp: tracepoint xdp_redirect also need a map argument Jesper Dangaard Brouer
2017-08-29 14:37 ` [PATCH net-next 3/7] xdp: make xdp tracepoints report bpf prog id instead of prog_tag Jesper Dangaard Brouer
2017-08-29 14:37 ` [PATCH net-next 4/7] xdp: separate xdp_redirect tracepoint in error case Jesper Dangaard Brouer
2017-08-29 17:02   ` Alexei Starovoitov
2017-08-29 14:38 ` [PATCH net-next 5/7] xdp: separate xdp_redirect tracepoint in map case Jesper Dangaard Brouer
2017-08-29 14:38 ` [PATCH net-next 6/7] samples/bpf: xdp_redirect load XDP dummy prog on TX device Jesper Dangaard Brouer
2017-08-31 10:08   ` Tariq Toukan
2017-08-31 10:15     ` Jesper Dangaard Brouer [this message]
2017-08-29 14:38 ` [PATCH net-next 7/7] samples/bpf: xdp_monitor tool based on tracepoints Jesper Dangaard Brouer
2017-08-29 17:05   ` Alexei Starovoitov
2017-08-29 17:24     ` Daniel Borkmann
2017-08-29 17:51 ` [PATCH net-next 0/7] XDP redirect tracepoints David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170831121536.14c8e0eb@redhat.com \
    --to=brouer@redhat.com \
    --cc=eranbe@mellanox.com \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).