From 601e279df074a339334885a6f19de9f6db988755 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Wed, 28 May 2014 18:32:35 +0100 Subject: [PATCH] ip_frag: move fragmentation/reassembly headers into a library Signed-off-by: Anatoly Burakov Acked-by: Thomas Monjalon --- config/common_bsdapp | 5 +++ config/common_linuxapp | 5 +++ examples/ip_reassembly/main.c | 2 +- examples/ipv4_frag/main.c | 2 +- lib/Makefile | 1 + lib/librte_ip_frag/Makefile | 42 +++++++++++++++++++ .../librte_ip_frag}/ipv4_frag_tbl.h | 0 .../librte_ip_frag/rte_ip_frag.h | 0 .../librte_ip_frag/rte_ipv4_rsmbl.h | 0 9 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 lib/librte_ip_frag/Makefile rename {examples/ip_reassembly => lib/librte_ip_frag}/ipv4_frag_tbl.h (100%) rename examples/ipv4_frag/rte_ipv4_frag.h => lib/librte_ip_frag/rte_ip_frag.h (100%) rename examples/ip_reassembly/ipv4_rsmbl.h => lib/librte_ip_frag/rte_ipv4_rsmbl.h (100%) diff --git a/config/common_bsdapp b/config/common_bsdapp index ef8eeab1c7..574172137b 100644 --- a/config/common_bsdapp +++ b/config/common_bsdapp @@ -266,6 +266,11 @@ CONFIG_RTE_MAX_LCORE_FREQS=64 # CONFIG_RTE_LIBRTE_NET=y +# +# Compile librte_ip_frag +# +CONFIG_RTE_LIBRTE_IP_FRAG=y + # # Compile librte_meter # diff --git a/config/common_linuxapp b/config/common_linuxapp index 5453c57d86..b696322ed3 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -302,6 +302,11 @@ CONFIG_RTE_MAX_LCORE_FREQS=64 # CONFIG_RTE_LIBRTE_NET=y +# +# Compile librte_ip_frag +# +CONFIG_RTE_LIBRTE_IP_FRAG=y + # # Compile librte_meter # diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index c4427b3a23..a38733c285 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -94,7 +94,7 @@ #define MAX_PKT_BURST 32 -#include "ipv4_rsmbl.h" +#include "rte_ipv4_rsmbl.h" #ifndef IPv6_BYTES #define IPv6_BYTES_FMT "%02x%02x:%02x%02x:%02x%02x:%02x%02x:"\ diff --git a/examples/ipv4_frag/main.c b/examples/ipv4_frag/main.c index 3250540389..ff6001538d 100644 --- a/examples/ipv4_frag/main.c +++ b/examples/ipv4_frag/main.c @@ -71,7 +71,7 @@ #include #include -#include "rte_ipv4_frag.h" +#include "rte_ip_frag.h" #include "main.h" #define RTE_LOGTYPE_L3FWD RTE_LOGTYPE_USER1 diff --git a/lib/Makefile b/lib/Makefile index a9f94b4340..f183f36936 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -51,6 +51,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_HASH) += librte_hash DIRS-$(CONFIG_RTE_LIBRTE_LPM) += librte_lpm DIRS-$(CONFIG_RTE_LIBRTE_ACL) += librte_acl DIRS-$(CONFIG_RTE_LIBRTE_NET) += librte_net +DIRS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += librte_ip_frag DIRS-$(CONFIG_RTE_LIBRTE_POWER) += librte_power DIRS-$(CONFIG_RTE_LIBRTE_METER) += librte_meter DIRS-$(CONFIG_RTE_LIBRTE_SCHED) += librte_sched diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile new file mode 100644 index 0000000000..4c353da228 --- /dev/null +++ b/lib/librte_ip_frag/Makefile @@ -0,0 +1,42 @@ +# BSD LICENSE +# +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +include $(RTE_SDK)/mk/rte.vars.mk + +# install this header file +SYMLINK-$(CONFIG_RTE_LIBRTE_IP_FRAG)-include += rte_ip_frag.h +SYMLINK-$(CONFIG_RTE_LIBRTE_IP_FRAG)-include += ipv4_frag_tbl.h +SYMLINK-$(CONFIG_RTE_LIBRTE_IP_FRAG)-include += rte_ipv4_rsmbl.h + +# this library depends on rte_ether +DEPDIRS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += lib/librte_mempool lib/librte_ether + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/examples/ip_reassembly/ipv4_frag_tbl.h b/lib/librte_ip_frag/ipv4_frag_tbl.h similarity index 100% rename from examples/ip_reassembly/ipv4_frag_tbl.h rename to lib/librte_ip_frag/ipv4_frag_tbl.h diff --git a/examples/ipv4_frag/rte_ipv4_frag.h b/lib/librte_ip_frag/rte_ip_frag.h similarity index 100% rename from examples/ipv4_frag/rte_ipv4_frag.h rename to lib/librte_ip_frag/rte_ip_frag.h diff --git a/examples/ip_reassembly/ipv4_rsmbl.h b/lib/librte_ip_frag/rte_ipv4_rsmbl.h similarity index 100% rename from examples/ip_reassembly/ipv4_rsmbl.h rename to lib/librte_ip_frag/rte_ipv4_rsmbl.h -- 2.20.1