All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Ilya Goslhtein <ilejn@yandex.ru>, xdp-newbies@vger.kernel.org
Subject: Re: bidirectional: => AF_XDP , <= XDP_REDIRECT
Date: Tue, 10 Sep 2019 15:21:46 +0100	[thread overview]
Message-ID: <87imq0ut8l.fsf@toke.dk> (raw)
In-Reply-To: <d52b5b48-06cf-42dc-180d-896601cf3efb@yandex.ru>

Ilya Goslhtein <ilejn@yandex.ru> writes:

> Hello,
>
> I am trying to use a network interface to
> (1) send packets via AF_XDP
> (2) receive packets and redirect to another interface via xdp_redirect_map
>
> Basically, I am making xdpbridge https://github.com/ilejn/xdpbridge.
>   bidirectional. My goal is to process packets in one direction in 
> kernelspace (xdp_redirect_map) and to pass packets in opposite direction 
> via userspace (recieve via AF_XDP then send via AF_XDP, rings are not 
> shared, so I perform memcpy).
>
> For test purposes I ran two applications: my xdpbridge and 
> xdp_redirect_map bpf sample.
>
> It does not work. Only few packets are received, then the thing stops. 
> Redirecting works until xdpbridge does 'bind' against the interface.

This is because the AF_XDP application loads another XDP program on the
interface that redirects the traffic into the socket. It is possible to
write an XDP program that can do both (i.e., for each packet, decide
whether to redirect it into the AF_XDP socket, or to another interface),
but obviously none of the example programs know how to do this, so they
end up stepping on each other's toes...

-Toke

  reply	other threads:[~2019-09-10 14:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10 14:01 bidirectional: => AF_XDP , <= XDP_REDIRECT Ilya Goslhtein
2019-09-10 14:21 ` Toke Høiland-Jørgensen [this message]
2019-09-10 14:32   ` Ilya Goslhtein
2019-09-10 14:38     ` Toke Høiland-Jørgensen
2019-10-30 15:44       ` Ilya Goslhtein
2019-10-30 16:39         ` Jesper Dangaard Brouer
2019-10-30 16:59           ` Ilya Goslhtein

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=87imq0ut8l.fsf@toke.dk \
    --to=toke@redhat.com \
    --cc=ilejn@yandex.ru \
    --cc=xdp-newbies@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.