[PATCH net-next] XDP router for veth

STALE3131d

4 messages, 2 authors, 2018-03-27 · open the first message on its own page

[PATCH net-next] XDP router for veth

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/

Re: [PATCH net-next] XDP router for veth

From: David Miller <davem@davemloft.net>
Date: 2018-03-26 14:21:14

From: "Md. Islam" <redacted>
Date: Fri, 23 Mar 2018 02:43:16 -0400
quoted hunk
+#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.

Re: [PATCH net-next] XDP router for veth

From: Md. Islam <hidden>
Date: 2018-03-27 01:01:29

On Mon, Mar 26, 2018 at 10:21 AM, David Miller [off-list ref] wrote:
From: "Md. Islam" <redacted>
Date: Fri, 23 Mar 2018 02:43:16 -0400
quoted
+#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.

Re: [PATCH net-next] XDP router for veth

From: Md. Islam <hidden>
Date: 2018-03-27 01:03:15

On Mon, Mar 26, 2018 at 9:01 PM, Md. Islam [off-list ref] wrote:
On Mon, Mar 26, 2018 at 10:21 AM, David Miller [off-list ref] wrote:
quoted
From: "Md. Islam" <redacted>
Date: Fri, 23 Mar 2018 02:43:16 -0400
quoted
+#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.
Sorry, the RTT improved from .055 ms to .035 ms.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help