netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: William Tu <u9012063@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCHv2 net-next 0/3] ip6_gre: add erspan native tunnel for ipv6
Date: Wed,  8 Nov 2017 16:13:01 -0800	[thread overview]
Message-ID: <1510186384-16411-1-git-send-email-u9012063@gmail.com> (raw)

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 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       | 395 ++++++++++++++++++++++++++++++++++++++++-------
 4 files changed, 400 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
---

2.7.4

             reply	other threads:[~2017-11-09  0:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09  0:13 William Tu [this message]
2017-11-09  0:13 ` [PATCHv2 net-next 1/3] ip_gre: Refector the erpsan tunnel code William Tu
2017-11-11 10:07   ` David Miller
2017-11-13 15:14     ` William Tu
2017-11-09  0:13 ` [PATCHv2 net-next 2/3] ip6_gre: Refactor ip6gre xmit codes William Tu
2017-11-09  0:31   ` Florian Westphal
2017-11-09  0:13 ` [PATCHv2 net-next 3/3] ip6_gre: Add ERSPAN native tunnel support William Tu

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=1510186384-16411-1-git-send-email-u9012063@gmail.com \
    --to=u9012063@gmail.com \
    --cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).