From 89d08b1a1760ca31b4f1ce22945ba31ed16f7484 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 26 Jun 2008 16:21:18 -0700 Subject: [PATCH] Modified the naming scheme for hardware tables. 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 . --- README.hwtables | 4 ++-- configure.ac | 2 +- datapath/hwtable-dummy/Modules.mk | 6 ------ datapath/hwtable_dummy/Modules.mk | 7 +++++++ .../hwtable-dummy.c => hwtable_dummy/hwtable_dummy.c} | 0 5 files changed, 10 insertions(+), 9 deletions(-) delete mode 100644 datapath/hwtable-dummy/Modules.mk create mode 100644 datapath/hwtable_dummy/Modules.mk rename datapath/{hwtable-dummy/hwtable-dummy.c => hwtable_dummy/hwtable_dummy.c} (100%) diff --git a/README.hwtables b/README.hwtables index e0b2a038..2b005539 100644 --- a/README.hwtables +++ b/README.hwtables @@ -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. diff --git a/configure.ac b/configure.ac index 2be62d59..5fea45f8 100644 --- a/configure.ac +++ b/configure.ac @@ -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 index 97484a0f..00000000 --- a/datapath/hwtable-dummy/Modules.mk +++ /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 index 00000000..2a3014d9 --- /dev/null +++ b/datapath/hwtable_dummy/Modules.mk @@ -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 + diff --git a/datapath/hwtable-dummy/hwtable-dummy.c b/datapath/hwtable_dummy/hwtable_dummy.c similarity index 100% rename from datapath/hwtable-dummy/hwtable-dummy.c rename to datapath/hwtable_dummy/hwtable_dummy.c -- 2.30.2