Re: [PATCH net-next] vrf: rename the framework to mrf

2015-08-24 Thread Nicolas Dichtel

Le 22/08/2015 19:47, David Miller a écrit :

From: Nicolas Dichtel nicolas.dich...@6wind.com
Date: Sat, 22 Aug 2015 18:10:20 +0200


This patch renames the recently added vrf driver. 'VRF' term is very
generic and there is no clear definition of it.
For example, someone may expect more isolation and uses network namespaces
to implement VRF,


This is a rediculous argument.

Does someone using VRF on a Cisco box expect Linux namespaces to be used?

Sorry, this is not going to get applied.


I spent some time today to check threads on this topic on Quagga and on netdev
and I digged into the VRF-lite's commercial documentations. I finally agree
with you, let's drop this patch.


Nicolas
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] vrf: rename the framework to mrf

2015-08-22 Thread David Miller
From: Nicolas Dichtel nicolas.dich...@6wind.com
Date: Sat, 22 Aug 2015 18:10:20 +0200

 This patch renames the recently added vrf driver. 'VRF' term is very
 generic and there is no clear definition of it.
 For example, someone may expect more isolation and uses network namespaces
 to implement VRF,

This is a rediculous argument.

Does someone using VRF on a Cisco box expect Linux namespaces to be used?

Sorry, this is not going to get applied.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next] vrf: rename the framework to mrf

2015-08-22 Thread Nicolas Dichtel
This patch renames the recently added vrf driver. 'VRF' term is very
generic and there is no clear definition of it.
For example, someone may expect more isolation and uses network namespaces
to implement VRF,

MRF was suggested by Cumulus people, so let's use this term.

This patch also enlightens the fact that this driver is not *the* way to
implement VRF in linux, but *a* tool among others.

CC: Shrijeet Mukherjee s...@cumulusnetworks.com
CC: David Ahern d...@cumulusnetworks.com
Signed-off-by: Nicolas Dichtel nicolas.dich...@6wind.com
---
 drivers/net/Kconfig  |   8 +-
 drivers/net/Makefile |   2 +-
 drivers/net/mrf.c| 668 +++
 drivers/net/vrf.c| 668 ---
 include/linux/netdevice.h|  20 +-
 include/net/flow.h   |   2 +-
 include/net/mrf.h| 177 
 include/net/route.h  |   4 +-
 include/net/vrf.h| 178 
 include/uapi/linux/if_link.h |  10 +-
 net/ipv4/af_inet.c   |   4 +-
 net/ipv4/fib_frontend.c  |  12 +-
 net/ipv4/fib_trie.c  |   2 +-
 net/ipv4/icmp.c  |   7 +-
 net/ipv4/ip_fragment.c   |   6 +-
 net/ipv4/ip_output.c |   2 +-
 net/ipv4/route.c |  10 +-
 net/ipv4/udp.c   |   8 +-
 18 files changed, 894 insertions(+), 894 deletions(-)
 create mode 100644 drivers/net/mrf.c
 delete mode 100644 drivers/net/vrf.c
 create mode 100644 include/net/mrf.h
 delete mode 100644 include/net/vrf.h

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index f50373645ab4..db4e5f5e8535 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -296,12 +296,12 @@ config NLMON
  diagnostics, etc. This is mostly intended for developers or support
  to debug netlink issues. If unsure, say N.
 
-config NET_VRF
-   tristate Virtual Routing and Forwarding (Lite)
+config NET_MRF
+   tristate Multiple Routing Framework
depends on IP_MULTIPLE_TABLES  IPV6_MULTIPLE_TABLES
---help---
- This option enables the support for mapping interfaces into VRF's. The
- support enables VRF devices.
+ This option enables the support for mapping interfaces into MRF's. The
+ support enables MRF devices.
 
 endif # NET_CORE
 
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index ca16dd689b36..60da845fa976 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -25,7 +25,7 @@ obj-$(CONFIG_VIRTIO_NET) += virtio_net.o
 obj-$(CONFIG_VXLAN) += vxlan.o
 obj-$(CONFIG_GENEVE) += geneve.o
 obj-$(CONFIG_NLMON) += nlmon.o
-obj-$(CONFIG_NET_VRF) += vrf.o
+obj-$(CONFIG_NET_MRF) += mrf.o
 
 #
 # Networking Drivers
diff --git a/drivers/net/mrf.c b/drivers/net/mrf.c
new file mode 100644
index ..c959703a5a9c
--- /dev/null
+++ b/drivers/net/mrf.c
@@ -0,0 +1,668 @@
+/*
+ * mrf.c: device driver to encapsulate a MRF space
+ *
+ * Copyright (c) 2015 Cumulus Networks. All rights reserved.
+ * Copyright (c) 2015 Shrijeet Mukherjee s...@cumulusnetworks.com
+ * Copyright (c) 2015 David Ahern d...@cumulusnetworks.com
+ *
+ * Based on dummy, team and ipvlan drivers
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include linux/module.h
+#include linux/kernel.h
+#include linux/netdevice.h
+#include linux/etherdevice.h
+#include linux/ip.h
+#include linux/init.h
+#include linux/moduleparam.h
+#include linux/netfilter.h
+#include linux/rtnetlink.h
+#include net/rtnetlink.h
+#include linux/u64_stats_sync.h
+#include linux/hashtable.h
+
+#include linux/inetdevice.h
+#include net/ip.h
+#include net/ip_fib.h
+#include net/ip6_route.h
+#include net/rtnetlink.h
+#include net/route.h
+#include net/addrconf.h
+#include net/mrf.h
+
+#define DRV_NAME   mrf
+#define DRV_VERSION1.0
+
+#define mrf_is_slave(dev)   ((dev)-flags  IFF_SLAVE)
+
+#define mrf_master_get_rcu(dev) \
+   ((struct net_device *)rcu_dereference(dev-rx_handler_data))
+
+struct pcpu_dstats {
+   u64 tx_pkts;
+   u64 tx_bytes;
+   u64 tx_drps;
+   u64 rx_pkts;
+   u64 rx_bytes;
+   struct u64_stats_sync   syncp;
+};
+
+static struct dst_entry *mrf_ip_check(struct dst_entry *dst, u32 cookie)
+{
+   return dst;
+}
+
+static int mrf_ip_local_out(struct sk_buff *skb)
+{
+   return ip_local_out(skb);
+}
+
+static unsigned int mrf_v4_mtu(const struct dst_entry *dst)
+{
+   /* TO-DO: return max ethernet size? */
+   return dst-dev-mtu;
+}
+
+static void mrf_dst_destroy(struct dst_entry *dst)
+{
+   /* our dst lives forever - or until the device is closed */
+}
+
+static unsigned int mrf_default_advmss(const