From: Md. Islam <hidden> Date: 2018-03-23 06:43:17
Hi
This patch implements IPv4 forwarding on xdp_buff. Currently it only
works with VETH. It forwards packets as soon as a veth receives a
packet. Currently VETH uses slow path for packet forwarding which
requires packet to go through upper layers. However this patch
forwards the packet as soon as it is received by L2.
The patch accomplishes following:
1. xdp_buff support is added to VETH. This will allow us to implement
XDP forwarding logic without having physical NIC.
2. Ipv4 forwarding is implemented for xdp_buff. So router fast path is
completely implemented in kernel (unlike eBPF)
I tested my implementation in Mininet [1]. Mininet is based on veth. I
tested the patch for following topologies.
h1 -----s1-------h2
h h
\ /
\ /
h -----s1-------------s2-------h
/ \
/ \
h h
I generated packets using iperf and a custom video streaming
application. IPv4 forwarding seems to be working properly. I'm also
getting higher throughput and lower latency than current veth. For
instance, on my machine, the throughput of iperf improved from
53.8Gb/s to around 56Gb/s. Median RTT improved from around .055 ms to
around .045 ms.
1. http://mininet.org/
The patch has been generated with kernel 4.15.0+. Please let me know
any question or suggestions.
Many thanks
Tamim
PhD Candidate,
Kent State University
http://web.cs.kent.edu/~mislam4/
+#ifdef CONFIG_XDP_ROUTER+ //if IP forwarding is enabled on the receiver, create xdp_buff+ //from skb and call xdp_router_forward()
Never use C++ comments, only use C style.
+ if(is_forwarding_enabled(rcv)){
There must be a space between 'if' and the openning parenthesis. You need
to also have a space before the openning curly braces.
In fact this entire patch is full of coding style issues, please run your
changes through checkpatch.pl before resubmitting.
+#ifdef CONFIG_XDP_ROUTER+ //if IP forwarding is enabled on the receiver, create xdp_buff+ //from skb and call xdp_router_forward()
Never use C++ comments, only use C style.
quoted
+ if(is_forwarding_enabled(rcv)){
There must be a space between 'if' and the openning parenthesis. You need
to also have a space before the openning curly braces.
In fact this entire patch is full of coding style issues, please run your
changes through checkpatch.pl before resubmitting.
Thanks David for the suggestions! I fixed all the formating errors. I
also modified the forwarding logic. Now the iperf throughput improved
from
53.8Gb/s to around 60Gb/s and the median RTT improved from .055 ms to
.35 ms. The patch is attached.
+#ifdef CONFIG_XDP_ROUTER+ //if IP forwarding is enabled on the receiver, create xdp_buff+ //from skb and call xdp_router_forward()
Never use C++ comments, only use C style.
quoted
+ if(is_forwarding_enabled(rcv)){
There must be a space between 'if' and the openning parenthesis. You need
to also have a space before the openning curly braces.
In fact this entire patch is full of coding style issues, please run your
changes through checkpatch.pl before resubmitting.
Thanks David for the suggestions! I fixed all the formating errors. I
also modified the forwarding logic. Now the iperf throughput improved
from
53.8Gb/s to around 60Gb/s and the median RTT improved from .055 ms to
.35 ms. The patch is attached.