All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Anmol Panda <anmol07.visitor@cse.iitd.ac.in>
Cc: Xdp <xdp-newbies@vger.kernel.org>, brouer@redhat.com
Subject: Re: Packet forwarding in XDP
Date: Sun, 12 Nov 2017 13:00:24 +0100	[thread overview]
Message-ID: <20171112130024.3e18d0b2@redhat.com> (raw)
In-Reply-To: <bb1feffe7bf1e420b484e3963526748d@cse.iitd.ac.in>

On Sun, 12 Nov 2017 14:27:25 +0530
Anmol Panda <anmol07.visitor@cse.iitd.ac.in> wrote:

> Dear all,
>      We are trying to write a program that receives a packet from a 
> client and is supposed to return the packet to the source. We tried to 
> swap the source and dest and send it using the XDP_TX action. But it 
> doesn't work.
> 
>     We have compiled a new kernel and bound the NIC to xdp successfully. 
> After binding, the system stops responding to ping and other packet 
> generating scripts (like sendip). We are using kernel  4.13.12 (Ubuntu 
> 17.10) from the main linux kernel tree and binding with Intel I217-LM 
> NIC. This NIC is using e1000e driver. Can xdp / eBPF be used for this 
> NIC? Moreover, do we need to patch the driver for additional support?

Not all drivers have "native' XDP support. See slide 11 of [1]

[1] http://people.netfilter.org/hawk/presentations/driving-IT2017/driving-IT-2017_XDP_eBPF_technology_Jesper_Brouer.pdf

There is something called "Generic" XDP (v4.12) for ease of
development. It allow you to attach an XDP program any net_device. I
call it --skb-mode in my sample programs. See [2]

[2] https://prototype-kernel.readthedocs.io/en/latest/blogposts/xdp25_eval_generic_xdp_tx.html

>      Our aim is to benchmark various forwarding applications (L2 , L3, 
> etc.) run using xdp. Please point to some code samples to achieve this. 
> We will be truly grateful.

Kernel have directory: samples/bpf/

I maintain some more example programs here:
 https://github.com/netoptimizer/prototype-kernel/tree/master/kernel/samples/bpf


Do notice that e1000e is only 1Gbit/s (which is very slow).  The normal
Linux kernel can handle 1Gbit/s without any issues... I hope you are
planning to use something faster, else it does not make sense to use XDP.

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

  reply	other threads:[~2017-11-12 12:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-12  8:57 Packet forwarding in XDP Anmol Panda
2017-11-12 12:00 ` Jesper Dangaard Brouer [this message]
2017-11-14  6:30   ` Anmol Panda
2017-11-14  6:33   ` Anmol Panda
2017-11-14  6:37     ` David Miller
2017-11-14  6:57       ` Anmol Panda
2017-11-14  7:08         ` Anmol Panda
2017-11-14 12:11         ` Daniel Borkmann
2017-11-15  5:55           ` Anmol Panda
2017-11-17 15:15             ` Daniel Borkmann

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=20171112130024.3e18d0b2@redhat.com \
    --to=brouer@redhat.com \
    --cc=anmol07.visitor@cse.iitd.ac.in \
    --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.