summaryrefslogtreecommitdiffstats
path: root/src/l2fwd/Makefile
diff options
context:
space:
mode:
authorEugene Snider <eugene.snider@huawei.com>2015-05-05 11:31:12 -0700
committerEugene Snider <eugene.snider@huawei.com>2015-05-06 10:31:23 -0700
commitfcc2e6c829f1ddbfc745addf4ac4b7ca84ba72db (patch)
tree5e7f7e66b87cedd3e054132dbea106a4d157fcaa /src/l2fwd/Makefile
parentb1d3b553bbb82907ed643ddf245b85097dce7f91 (diff)
Add l2 fwd kernel module
This commit adds a simple kernel module for l2 forwarding or termination This module provides only level 2 forwarding between two ports, it does not do any NAT or Masquerade. Arguments are: net1=ethXXXX # set forwarding port 1 net2=ethXXX # set forwarding port 2 terminate=1 # terminate the connection and free the skb Changed to GPL licensing to avoid compilation issues Added sanity build target Fix whitespace issues JIRA: VSPERF-39 Change-Id: I0fa3e0135af06b7cba665a357dccfb9459edb9f6 Signed-off-by: Eugene Snider <eugene.snider@huawei.com>
Diffstat (limited to 'src/l2fwd/Makefile')
-rw-r--r--src/l2fwd/Makefile43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/l2fwd/Makefile b/src/l2fwd/Makefile
new file mode 100644
index 00000000..21fbe5bb
--- /dev/null
+++ b/src/l2fwd/Makefile
@@ -0,0 +1,43 @@
+# Copyright 2015 Futurewei Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# A copy of the license is included with this distribution. If you did not
+# recieve a copy you may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+obj-m += l2fwd.o
+
+KBUILD_CFLAGS += -Wno-unused-function -Wno-unused-label -Wno-unused-variable
+# Allow kernel version to be overridden by environment
+KERNEL_VERSION ?= $(shell uname -r)
+
+KERNELDIR := /lib/modules/$(KERNEL_VERSION)/build
+PWD := $(shell pwd)
+
+all:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+
+sanity:
+ echo "Done"
+
+clean:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
+ rm -f l2fwd*deb
+
+install:
+ sudo mkdir /lib/modules/`uname -r`/kernel/net/core
+ sudo cp *.ko /lib/modules/`uname -r`/kernel/net/core
+
+uninstall:
+ sudo rm /lib/modules/`uname -r`/kernel/net/core/l2fwd.ko
+
+debian-package: all
+ ./gen_debian_package.sh