ip_frag: disable ip fragmentation if mbuf refcnt is disabled

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 <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
This commit is contained in:
Pablo de Lara 2014-10-22 12:17:01 +01:00 committed by Thomas Monjalon
parent 33e79bed3e
commit c0cddf03f1
2 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -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.