Skip to content

ip6_gre: add erspan native tunnel for ipv6

William Tu netdev 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 1 replyIn review
  2. v43 patches 2 repliesSuperseded
  3. v33 patches 1 replySuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v2 posting 2/23 patches3 repliesSuperseded
v2 posting 1/21 patch0 repliesSuperseded
v13 patches2 repliesSuperseded

Changes in v5 from the cover letter

- add cover-letter description

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ip_gre: Refector the erpsan tunnel code.include/net/erspan.h net/ipv4/ip_gre.c+56 -490 replies
2/3ip6_gre: Refactor ip6gre xmit codesnet/ipv6/ip6_gre.c+75 -480 replies
3/3ip6_gre: Add ERSPAN native tunnel supportinclude/net/ip6_tunnel.h net/ipv6/ip6_gre.c+267 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 net-next 0/3] ip6_gre: add erspan native tunnel for ipv6

The patch series add support for ERSPAN tunnel over ipv6. The first patch refectors the existing ipv4 gre implementation and the second refactors the ipv6 gre's xmit code. Finally the last patch introduces erspan protocol.

change in v5:
- add cover-letter description

change in v4:
- rebase on top of net-next
- use log_ecn_error in ip6_tnl_rcv

change in v3:
- add inline for functions in header
- rebase on top of net-next

change in v2:
- remove inline
- fix some indent
- fix errors reports by clang and scan-build

William Tu (3):
ip_gre: Refector the erpsan tunnel code.
ip6_gre: Refactor ip6gre xmit codes
ip6_gre: Add ERSPAN native tunnel support

 include/net/erspan.h     |  51 ++++++
 include/net/ip6_tunnel.h |   1 +
 net/ipv4/ip_gre.c        |  54 +------
 net/ipv6/ip6_gre.c       | 393 ++++++++++++++++++++++++++++++++++++++++-------
 4 files changed, 398 insertions(+), 101 deletions(-)

--
A test script is provided below:
#!/bin/bash
# In the namespace NS0, create veth0 and ip6erspan00 # Out of the namespace, create veth1 and ip6erspan11 # Ping in and out of namespace using ERSPAN protocol

# Patch v2 for iproute2
# https://marc.info/?l=linux-netdev&m=151002165705772&w=2

cleanup() {
set +ex
ip netns del ns0
ip link del ip6erspan11
ip link del veth1
}

main() {
	trap cleanup 0 2 3 9

	ip netns add ns0
	ip link add veth0 type veth peer name veth1
	ip link set veth0 netns ns0

	# non-namespace
	ip addr add dev veth1 fc00:100::2/96
	ip link add dev ip6erspan11 type ip6erspan seq key 102 erspan 123 \
		 local fc00:100::2 \
		remote fc00:100::1

	ip addr add dev ip6erspan11 fc00:200::2/96
	ip addr add dev ip6erspan11 10.10.200.2/24

	# namespace: ns0 
	ip netns exec ns0 ip addr add fc00:100::1/96 dev veth0

	# Tunnel
	ip netns exec ns0 ip link add dev ip6erspan00 type ip6erspan seq key 102 erspan 12 \
	     local fc00:100::1 \
	    remote fc00:100::2

	ip netns exec ns0 ip addr add dev ip6erspan00 fc00:200::1/96
	ip netns exec ns0 ip addr add dev ip6erspan00 10.10.200.1/24

	ip link set dev veth1 up
	ip link set dev ip6erspan11 up
	ip netns exec ns0 ip link set dev ip6erspan00 up
	ip netns exec ns0 ip link set dev veth0 up
}

main

# Ping underlying
ping6 -c 1 fc00:100::1 || true

# ping overlay
ping -c 3 10.10.200.1
ping6 -c 3 fc00:200::1
Signature · 1 line
2.7.4