Revision d8e2262a5044c1a05b4da51e5d0976f10c487a9f authored by Saif Hasan on 21 September 2018, 21:30:05 UTC, committed by David S. Miller on 24 September 2018, 19:19:27 UTC
Summary:

This appears to be necessary and sufficient change to enable `MPLS` on
`ip6gre` tunnels (RFC4023).

This diff allows IP6GRE devices to be recognized by MPLS kernel module
and hence user can configure interface to accept packets with mpls
headers as well setup mpls routes on them.

Test Plan:

Test plan consists of multiple containers connected via GRE-V6 tunnel.
Then carrying out testing steps as below.

- Carry out necessary sysctl settings on all containers

```
sysctl -w net.mpls.platform_labels=65536
sysctl -w net.mpls.ip_ttl_propagate=1
sysctl -w net.mpls.conf.lo.input=1
```

- Establish IP6GRE tunnels

```
ip -6 tunnel add name if_1_2_1 mode ip6gre \
  local 2401:db00:21:6048:feed:0::1 \
  remote 2401:db00:21:6048:feed:0::2 key 1
ip link set dev if_1_2_1 up
sysctl -w net.mpls.conf.if_1_2_1.input=1
ip -4 addr add 169.254.0.2/31 dev if_1_2_1 scope link

ip -6 tunnel add name if_1_3_1 mode ip6gre \
  local 2401:db00:21:6048:feed:0::1 \
  remote 2401:db00:21:6048:feed:0::3 key 1
ip link set dev if_1_3_1 up
sysctl -w net.mpls.conf.if_1_3_1.input=1
ip -4 addr add 169.254.0.4/31 dev if_1_3_1 scope link
```

- Install MPLS encap rules on node-1 towards node-2

```
ip route add 192.168.0.11/32 nexthop encap mpls 32/64 \
  via inet 169.254.0.3 dev if_1_2_1
```

- Install MPLS forwarding rules on node-2 and node-3
```
// node2
ip -f mpls route add 32 via inet 169.254.0.7 dev if_2_4_1

// node3
ip -f mpls route add 64 via inet 169.254.0.12 dev if_4_3_1
```

- Ping 192.168.0.11 (node4) from 192.168.0.1 (node1) (where routing
  towards 192.168.0.1 is via IP route directly towards node1 from node4)
```
ping 192.168.0.11
```

- tcpdump on interface to capture ping packets wrapped within MPLS
  header which inturn wrapped within IP6GRE header

```
16:43:41.121073 IP6
  2401:db00:21:6048:feed::1 > 2401:db00:21:6048:feed::2:
  DSTOPT GREv0, key=0x1, length 100:
  MPLS (label 32, exp 0, ttl 255) (label 64, exp 0, [S], ttl 255)
  IP 192.168.0.1 > 192.168.0.11:
  ICMP echo request, id 1208, seq 45, length 64

0x0000:  6000 2cdb 006c 3c3f 2401 db00 0021 6048  `.,..l<?$....!`H
0x0010:  feed 0000 0000 0001 2401 db00 0021 6048  ........$....!`H
0x0020:  feed 0000 0000 0002 2f00 0401 0401 0100  ......../.......
0x0030:  2000 8847 0000 0001 0002 00ff 0004 01ff  ...G............
0x0040:  4500 0054 3280 4000 ff01 c7cb c0a8 0001  E..T2.@.........
0x0050:  c0a8 000b 0800 a8d7 04b8 002d 2d3c a05b  ...........--<.[
0x0060:  0000 0000 bcd8 0100 0000 0000 1011 1213  ................
0x0070:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223  .............!"#
0x0080:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233  $%&'()*+,-./0123
0x0090:  3435 3637                                4567
```

Signed-off-by: Saif Hasan <has@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d2f85c9
Raw File
Kconfig
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
#		http://www.samsung.com/

# Configuration options for the EXYNOS

menuconfig ARCH_EXYNOS
	bool "Samsung EXYNOS"
	depends on ARCH_MULTI_V7
	select ARCH_HAS_HOLES_MEMORYMODEL
	select ARCH_SUPPORTS_BIG_ENDIAN
	select ARM_AMBA
	select ARM_GIC
	select COMMON_CLK_SAMSUNG
	select EXYNOS_THERMAL
	select EXYNOS_PMU
	select EXYNOS_SROM
	select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS
	select GPIOLIB
	select HAVE_ARM_SCU if SMP
	select HAVE_S3C2410_I2C if I2C
	select HAVE_S3C2410_WATCHDOG if WATCHDOG
	select HAVE_S3C_RTC if RTC_CLASS
	select PINCTRL
	select PINCTRL_EXYNOS
	select PM_GENERIC_DOMAINS if PM
	select S5P_DEV_MFC
	select SAMSUNG_MC
	select SOC_SAMSUNG
	select SRAM
	select THERMAL
	select THERMAL_OF
	select MFD_SYSCON
	select MEMORY
	select CLKSRC_EXYNOS_MCT
	select POWER_RESET
	select POWER_RESET_SYSCON
	select POWER_RESET_SYSCON_POWEROFF
	help
	  Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)

if ARCH_EXYNOS

config S5P_DEV_MFC
	bool
	help
	  Compile in setup memory (init) code for MFC

config ARCH_EXYNOS3
	bool "SAMSUNG EXYNOS3"
	select ARM_CPU_SUSPEND if PM
	help
	  Samsung EXYNOS3 (Cortex-A7) SoC based systems

config ARCH_EXYNOS4
	bool "SAMSUNG EXYNOS4"
	default y
	select ARM_CPU_SUSPEND if PM_SLEEP
	select CLKSRC_SAMSUNG_PWM if CPU_EXYNOS4210
	select CPU_EXYNOS4210
	select GIC_NON_BANKED
	select MIGHT_HAVE_CACHE_L2X0
	help
	  Samsung EXYNOS4 (Cortex-A9) SoC based systems

config ARCH_EXYNOS5
	bool "SAMSUNG EXYNOS5"
	default y
	help
	  Samsung EXYNOS5 (Cortex-A15/A7) SoC based systems

comment "EXYNOS SoCs"

config SOC_EXYNOS3250
	bool "SAMSUNG EXYNOS3250"
	default y
	depends on ARCH_EXYNOS3

config CPU_EXYNOS4210
	bool "SAMSUNG EXYNOS4210"
	default y
	depends on ARCH_EXYNOS4

config SOC_EXYNOS4412
	bool "SAMSUNG EXYNOS4412"
	default y
	depends on ARCH_EXYNOS4

config SOC_EXYNOS5250
	bool "SAMSUNG EXYNOS5250"
	default y
	depends on ARCH_EXYNOS5

config SOC_EXYNOS5260
	bool "SAMSUNG EXYNOS5260"
	default y
	depends on ARCH_EXYNOS5

config SOC_EXYNOS5410
	bool "SAMSUNG EXYNOS5410"
	default y
	depends on ARCH_EXYNOS5

config SOC_EXYNOS5420
	bool "SAMSUNG EXYNOS5420"
	default y
	depends on ARCH_EXYNOS5

config SOC_EXYNOS5800
	bool "SAMSUNG EXYNOS5800"
	default y
	depends on SOC_EXYNOS5420

config EXYNOS5420_MCPM
	bool "Exynos5420 Multi-Cluster PM support"
	depends on MCPM && SOC_EXYNOS5420
	select ARM_CCI400_PORT_CTRL
	select ARM_CPU_SUSPEND
	help
	  This is needed to provide CPU and cluster power management
	  on Exynos5420 implementing big.LITTLE.

config EXYNOS_CPU_SUSPEND
	bool
	select ARM_CPU_SUSPEND
	default PM_SLEEP || ARM_EXYNOS_CPUIDLE

endif
back to top