Modified the naming scheme for hardware tables.
authorBen Pfaff <blp@nicira.com>
Thu, 26 Jun 2008 23:21:18 +0000 (16:21 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 26 Jun 2008 23:21:18 +0000 (16:21 -0700)
Because of historical string munging during the kernel build process
if you named your hardware table hwtable-something, when it was built
the filename would look appropriate, but the actual module info would change
the internal name to be hwtable_something, thus after an insmod with the filename
you could not perform an rmmod with the same filename. As a result
the naming scheme has been changed to hwtable_NAME, NAME being the hardware
the table supports.

Further, include files in the hardware table should be prefixed with the
folder name, e.g. #include "hwtable_NAME/my_header.h".

Based on commits from David Erickson <derickso@stanford.edu>.

README.hwtables
configure.ac
datapath/hwtable-dummy/Modules.mk [deleted file]
datapath/hwtable_dummy/Modules.mk [new file with mode: 0644]
datapath/hwtable_dummy/hwtable_dummy.c [moved from datapath/hwtable-dummy/hwtable-dummy.c with 100% similarity]

index e0b2a03..2b00553 100644 (file)
@@ -17,7 +17,7 @@ hardware table module is loaded (and before it is unloaded) will take
 advantage of hardware switching features.
 
 Creating a hardware table module is straightforward.  Create a
-directory in the openflow source tree named datapath/hwtable-NAME,
+directory in the openflow source tree named datapath/hwtable_NAME,
 where NAME identifies the hardware that the module supports.  Populate
 that directory with the C source files that comprise the module, plus
 a file named Modules.mk that specifies how to build the module.  This
@@ -33,6 +33,6 @@ the OpenFlow configure script command as the argument to
 
 Each hardware table module's code is encapsulated in a directory, so
 it is easy to separate a hardware table implementation from OpenFlow.
-Simply package up the contents of the hwtable-NAME directory and
+Simply package up the contents of the hwtable_NAME directory and
 distribute it for builders to extract into their distribution
 directory.
index 2be62d5..5fea45f 100644 (file)
@@ -45,7 +45,7 @@ case "${enable_hw_tables}" in # (
     ;;
 esac
 for d in $hw_tables; do
-    mk=datapath/hwtable-$d/Modules.mk
+    mk=datapath/hwtable_$d/Modules.mk
     if test ! -e $srcdir/$mk; then
        AC_MSG_ERROR([--enable-hw-tables=$d specified but $mk is missing])
     fi
diff --git a/datapath/hwtable-dummy/Modules.mk b/datapath/hwtable-dummy/Modules.mk
deleted file mode 100644 (file)
index 97484a0..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# Specify the module to build.
-all_modules += hwtable-dummy
-
-# Specify the source files that comprise the module.
-hwtable-dummy_sources = \
-       hwtable-dummy/hwtable-dummy.c
diff --git a/datapath/hwtable_dummy/Modules.mk b/datapath/hwtable_dummy/Modules.mk
new file mode 100644 (file)
index 0000000..2a3014d
--- /dev/null
@@ -0,0 +1,7 @@
+# Specify the module to build.
+all_modules += hwtable_dummy
+
+# Specify the source files that comprise the module.
+hwtable_dummy_sources = \
+       hwtable_dummy/hwtable_dummy.c
+