From a0c97d110c4fc4e43aa9dbf3861a89fc4fc0bc93 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Fri, 26 Mar 2010 14:04:13 -0700 Subject: [PATCH] Added patches for openflow reference version. These may not be needed if they are pushed upstream. --- util/openflow-patches/README | 5 +++++ util/openflow-patches/controller.patch | 15 +++++++++++++++ util/openflow-patches/datapath.patch | 26 ++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 util/openflow-patches/README create mode 100644 util/openflow-patches/controller.patch create mode 100644 util/openflow-patches/datapath.patch diff --git a/util/openflow-patches/README b/util/openflow-patches/README new file mode 100644 index 0000000..36f19ad --- /dev/null +++ b/util/openflow-patches/README @@ -0,0 +1,5 @@ +Patches for OpenFlow Reference Implementation + +controller.patch: patch controller to support up to 4096 switches (up from 16!) + +datapath.patch: patch to kernel datapath to compile with CONFIG_NET_NS=y diff --git a/util/openflow-patches/controller.patch b/util/openflow-patches/controller.patch new file mode 100644 index 0000000..c392fae --- /dev/null +++ b/util/openflow-patches/controller.patch @@ -0,0 +1,15 @@ +diff --git a/controller/controller.c b/controller/controller.c +index 41f2547..6eec590 100644 +--- a/controller/controller.c ++++ b/controller/controller.c +@@ -58,8 +58,8 @@ + #include "vlog.h" + #define THIS_MODULE VLM_controller + +-#define MAX_SWITCHES 16 +-#define MAX_LISTENERS 16 ++#define MAX_SWITCHES 4096 ++#define MAX_LISTENERS 4096 + + struct switch_ { + struct lswitch *lswitch; diff --git a/util/openflow-patches/datapath.patch b/util/openflow-patches/datapath.patch new file mode 100644 index 0000000..019b60e --- /dev/null +++ b/util/openflow-patches/datapath.patch @@ -0,0 +1,26 @@ +diff --git a/datapath/datapath.c b/datapath/datapath.c +index 4a4d3a2..365aa25 100644 +--- a/datapath/datapath.c ++++ b/datapath/datapath.c +@@ -47,6 +47,9 @@ + +#include "compat.h" + ++#ifdef CONFIG_NET_NS ++#include ++#endif + +/* Strings to describe the manufacturer, hardware, and software. This data + * is queriable through the switch description stats message. */ +@@ -259,7 +262,11 @@ send_openflow_skb(const struct datapath *dp, + struct sk_buff *skb, const struct sender *sender) +{ + return (sender +- ? genlmsg_unicast(skb, sender->pid) ++#ifdef CONFIG_NET_NS ++ ? genlmsg_unicast(&init_net, skb, sender->pid) ++#else ++ ? genlmsg_unicast(skb, sender->pid) ++#endif + : genlmsg_multicast(skb, 0, dp_mc_group(dp), GFP_ATOMIC)); +}