From patchwork Wed Oct 22 11:17:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 918 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id C26CB7E80; Wed, 22 Oct 2014 13:08:45 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 7626E7E7B for ; Wed, 22 Oct 2014 13:08:44 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 22 Oct 2014 04:15:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,768,1406617200"; d="scan'208";a="593685345" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 22 Oct 2014 04:17:02 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s9MBH15v023991 for ; Wed, 22 Oct 2014 12:17:01 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s9MBH1rY027470 for ; Wed, 22 Oct 2014 12:17:01 +0100 Received: (from pdelarax@localhost) by sivswdev02.ir.intel.com with id s9MBH1E2027466 for dev@dpdk.org; Wed, 22 Oct 2014 12:17:01 +0100 From: Pablo de Lara To: dev@dpdk.org Date: Wed, 22 Oct 2014 12:17:01 +0100 Message-Id: <1413976621-27430-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1413900943-27711-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1413900943-27711-1-git-send-email-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH v2] librte_ip_frag: Disable ipv4/v6 fragmentation if RTE_MBUF_REFCNT=n X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" rte_ipv4_fragment_packet() and rte_ipv6_fragment packet() call rte_pktmbuf_attach() to attach the segment of the original packet to the segment of the new fragmented one. Such function is not declared if RTE_MBUF_REFCNT is disabled, as it needs to call rte_mbuf_refcnt_update, not declared either. Therefore, the ipv4/v6 fragmentation libraries are disabled in that situation. Signed-off-by: Pablo de Lara Acked-by: Sergio Gonzalez Monroy --- lib/librte_ip_frag/Makefile | 6 +++++- lib/librte_ip_frag/rte_ip_frag.h | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile index 2265c93..8c00d39 100644 --- a/lib/librte_ip_frag/Makefile +++ b/lib/librte_ip_frag/Makefile @@ -38,9 +38,13 @@ CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) #source files +ifeq ($(CONFIG_RTE_MBUF_REFCNT),y) SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_fragmentation.c -SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_reassembly.c SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv6_fragmentation.c +else +$(info WARNING: Fragmentation feature is disabled because it needs MBUF_REFCNT.) +endif +SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv4_reassembly.c SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ipv6_reassembly.c SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += rte_ip_frag_common.c SRCS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += ip_frag_internal.c diff --git a/lib/librte_ip_frag/rte_ip_frag.h b/lib/librte_ip_frag/rte_ip_frag.h index e0936dc..230a903 100644 --- a/lib/librte_ip_frag/rte_ip_frag.h +++ b/lib/librte_ip_frag/rte_ip_frag.h @@ -175,6 +175,7 @@ rte_ip_frag_table_destroy( struct rte_ip_frag_tbl *tbl) rte_free(tbl); } +#ifdef RTE_MBUF_REFCNT /** * This function implements the fragmentation of IPv6 packets. * @@ -203,7 +204,7 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in, uint16_t mtu_size, struct rte_mempool *pool_direct, struct rte_mempool *pool_indirect); - +#endif /* * This function implements reassembly of fragmented IPv6 packets. @@ -252,6 +253,7 @@ rte_ipv6_frag_get_ipv6_fragment_header(struct ipv6_hdr *hdr) return NULL; } +#ifdef RTE_MBUF_REFCNT /** * IPv4 fragmentation. * @@ -280,6 +282,7 @@ int32_t rte_ipv4_fragment_packet(struct rte_mbuf *pkt_in, uint16_t nb_pkts_out, uint16_t mtu_size, struct rte_mempool *pool_direct, struct rte_mempool *pool_indirect); +#endif /* * This function implements reassembly of fragmented IPv4 packets.