* [PATCH net-next] mpls: allow routes on ipgre devices
@ 2016-06-16 8:09 Simon Horman
2016-06-16 13:12 ` Robert Shearman
2016-06-17 0:14 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Simon Horman @ 2016-06-16 8:09 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Robert Shearman, Roopa Prabhu, Simon Horman
This appears to be necessary and sufficient to provide
MPLS in GRE (RFC4023) support.
This can be used by establishing an ipgre tunnel device
and then routing MPLS over it.
The following example will forward MPLS frames received with an outermost
MPLS label 100 over tun1, a GRE tunnel. The forwarded packet will have the
outermost MPLS LSE removed and two new LSEs added with labels 200
(outermost) and 300 (next).
ip link add name tun1 type gre remote 10.0.99.193 local 10.0.99.192 ttl 225
ip link set up dev tun1
ip addr add 10.0.98.192/24 dev tun1
ip route sh
echo 1 > /proc/sys/net/mpls/conf/eth0/input
echo 101 > /proc/sys/net/mpls/platform_labels
ip -f mpls route add 100 as 200/300 via inet 10.0.98.193
ip -f mpls route sh
Also remove unnecessary braces.
Reviewed-by: Dinan Gunawardena <dinan.gunawardena@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
net/mpls/af_mpls.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index 7a4aa3450dd7..e9beaa58573c 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -1009,9 +1009,10 @@ static int mpls_dev_notify(struct notifier_block *this, unsigned long event,
unsigned int flags;
if (event == NETDEV_REGISTER) {
- /* For now just support ethernet devices */
- if ((dev->type == ARPHRD_ETHER) ||
- (dev->type == ARPHRD_LOOPBACK)) {
+ /* For now just support Ethernet and IPGRE devices */
+ if (dev->type == ARPHRD_ETHER ||
+ dev->type == ARPHRD_LOOPBACK ||
+ dev->type == ARPHRD_IPGRE) {
mdev = mpls_add_dev(dev);
if (IS_ERR(mdev))
return notifier_from_errno(PTR_ERR(mdev));
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net-next] mpls: allow routes on ipgre devices
2016-06-16 8:09 [PATCH net-next] mpls: allow routes on ipgre devices Simon Horman
@ 2016-06-16 13:12 ` Robert Shearman
2016-06-17 0:14 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Robert Shearman @ 2016-06-16 13:12 UTC (permalink / raw)
To: Simon Horman, David S. Miller; +Cc: netdev, Roopa Prabhu
On 16/06/16 09:09, Simon Horman wrote:
> This appears to be necessary and sufficient to provide
> MPLS in GRE (RFC4023) support.
>
> This can be used by establishing an ipgre tunnel device
> and then routing MPLS over it.
>
> The following example will forward MPLS frames received with an outermost
> MPLS label 100 over tun1, a GRE tunnel. The forwarded packet will have the
> outermost MPLS LSE removed and two new LSEs added with labels 200
> (outermost) and 300 (next).
>
> ip link add name tun1 type gre remote 10.0.99.193 local 10.0.99.192 ttl 225
> ip link set up dev tun1
> ip addr add 10.0.98.192/24 dev tun1
> ip route sh
>
> echo 1 > /proc/sys/net/mpls/conf/eth0/input
> echo 101 > /proc/sys/net/mpls/platform_labels
> ip -f mpls route add 100 as 200/300 via inet 10.0.98.193
> ip -f mpls route sh
>
> Also remove unnecessary braces.
>
> Reviewed-by: Dinan Gunawardena <dinan.gunawardena@netronome.com>
Thanks for testing this and making the necessary change.
Acked-by: Robert Shearman <rshearma@brocade.com>
> Signed-off-by: Simon Horman <simon.horman@netronome.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] mpls: allow routes on ipgre devices
2016-06-16 8:09 [PATCH net-next] mpls: allow routes on ipgre devices Simon Horman
2016-06-16 13:12 ` Robert Shearman
@ 2016-06-17 0:14 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-06-17 0:14 UTC (permalink / raw)
To: simon.horman; +Cc: netdev, rshearma, roopa
From: Simon Horman <simon.horman@netronome.com>
Date: Thu, 16 Jun 2016 17:09:09 +0900
> This appears to be necessary and sufficient to provide
> MPLS in GRE (RFC4023) support.
>
> This can be used by establishing an ipgre tunnel device
> and then routing MPLS over it.
>
> The following example will forward MPLS frames received with an outermost
> MPLS label 100 over tun1, a GRE tunnel. The forwarded packet will have the
> outermost MPLS LSE removed and two new LSEs added with labels 200
> (outermost) and 300 (next).
>
> ip link add name tun1 type gre remote 10.0.99.193 local 10.0.99.192 ttl 225
> ip link set up dev tun1
> ip addr add 10.0.98.192/24 dev tun1
> ip route sh
>
> echo 1 > /proc/sys/net/mpls/conf/eth0/input
> echo 101 > /proc/sys/net/mpls/platform_labels
> ip -f mpls route add 100 as 200/300 via inet 10.0.98.193
> ip -f mpls route sh
>
> Also remove unnecessary braces.
>
> Reviewed-by: Dinan Gunawardena <dinan.gunawardena@netronome.com>
> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Applied, thanks Simon.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-17 0:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16 8:09 [PATCH net-next] mpls: allow routes on ipgre devices Simon Horman
2016-06-16 13:12 ` Robert Shearman
2016-06-17 0:14 ` David Miller
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).