DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] librte_ip_frag: Disable ipv4/v6 fragmentation if RTE_MBUF_REFCNT=n
@ 2014-10-21 14:15 Pablo de Lara
  2014-10-21 21:11 ` Thomas Monjalon
  2014-10-22 11:17 ` [dpdk-dev] [PATCH v2] " Pablo de Lara
  0 siblings, 2 replies; 6+ messages in thread
From: Pablo de Lara @ 2014-10-21 14:15 UTC (permalink / raw)
  To: dev

Ipv4/v6 fragmentation libraries depends on refcnt.
There was a compilation error if RTE_MBUF_REFCNT was disabled,
so those libraries have been disabled in that situation.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 lib/librte_ip_frag/Makefile      |    4 +++-
 lib/librte_ip_frag/rte_ip_frag.h |    5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index 2265c93..9043543 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -38,9 +38,11 @@ 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
+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.
-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] librte_ip_frag: Disable ipv4/v6 fragmentation if RTE_MBUF_REFCNT=n
  2014-10-21 14:15 [dpdk-dev] [PATCH] librte_ip_frag: Disable ipv4/v6 fragmentation if RTE_MBUF_REFCNT=n Pablo de Lara
@ 2014-10-21 21:11 ` Thomas Monjalon
  2014-10-22 10:22   ` De Lara Guarch, Pablo
  2014-10-22 11:17 ` [dpdk-dev] [PATCH v2] " Pablo de Lara
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2014-10-21 21:11 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dev

2014-10-21 15:15, Pablo de Lara:
> Ipv4/v6 fragmentation libraries depends on refcnt.
> There was a compilation error if RTE_MBUF_REFCNT was disabled,
> so those libraries have been disabled in that situation.

Please Pablo, could you add a short justification that it's not
possible to implement fragmentation without refcnt (at least with
the current design)?

What do you think of adding a warning as below?

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

-- 
Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] librte_ip_frag: Disable ipv4/v6 fragmentation if RTE_MBUF_REFCNT=n
  2014-10-21 21:11 ` Thomas Monjalon
@ 2014-10-22 10:22   ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 6+ messages in thread
From: De Lara Guarch, Pablo @ 2014-10-22 10:22 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Tuesday, October 21, 2014 10:12 PM
> To: De Lara Guarch, Pablo
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] librte_ip_frag: Disable ipv4/v6
> fragmentation if RTE_MBUF_REFCNT=n
> 
> 2014-10-21 15:15, Pablo de Lara:
> > Ipv4/v6 fragmentation libraries depends on refcnt.
> > There was a compilation error if RTE_MBUF_REFCNT was disabled,
> > so those libraries have been disabled in that situation.
> 
> Please Pablo, could you add a short justification that it's not
> possible to implement fragmentation without refcnt (at least with
> the current design)?

Will send a v2 with it.

> 
> What do you think of adding a warning as below?
> 
> > +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

Good idea. Thanks Thomas!

> 
> --
> Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v2] librte_ip_frag: Disable ipv4/v6 fragmentation if RTE_MBUF_REFCNT=n
  2014-10-21 14:15 [dpdk-dev] [PATCH] librte_ip_frag: Disable ipv4/v6 fragmentation if RTE_MBUF_REFCNT=n Pablo de Lara
  2014-10-21 21:11 ` Thomas Monjalon
@ 2014-10-22 11:17 ` Pablo de Lara
  2014-10-28 12:01   ` Sergio Gonzalez Monroy
  1 sibling, 1 reply; 6+ messages in thread
From: Pablo de Lara @ 2014-10-22 11:17 UTC (permalink / raw)
  To: 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 <pablo.de.lara.guarch@intel.com>
---
 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.
-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] librte_ip_frag: Disable ipv4/v6 fragmentation if RTE_MBUF_REFCNT=n
  2014-10-22 11:17 ` [dpdk-dev] [PATCH v2] " Pablo de Lara
@ 2014-10-28 12:01   ` Sergio Gonzalez Monroy
  2014-10-29 23:50     ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Sergio Gonzalez Monroy @ 2014-10-28 12:01 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dev

On Wed, Oct 22, 2014 at 12:17:01PM +0100, Pablo de Lara wrote:
> 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>
> ---
>  lib/librte_ip_frag/Makefile      |    6 +++++-
>  lib/librte_ip_frag/rte_ip_frag.h |    5 ++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
>

Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] librte_ip_frag: Disable ipv4/v6 fragmentation if RTE_MBUF_REFCNT=n
  2014-10-28 12:01   ` Sergio Gonzalez Monroy
@ 2014-10-29 23:50     ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2014-10-29 23:50 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: 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 <pablo.de.lara.guarch@intel.com>
> 
> Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>

Applied

Thanks
-- 
Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-29 23:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-21 14:15 [dpdk-dev] [PATCH] librte_ip_frag: Disable ipv4/v6 fragmentation if RTE_MBUF_REFCNT=n Pablo de Lara
2014-10-21 21:11 ` Thomas Monjalon
2014-10-22 10:22   ` De Lara Guarch, Pablo
2014-10-22 11:17 ` [dpdk-dev] [PATCH v2] " Pablo de Lara
2014-10-28 12:01   ` Sergio Gonzalez Monroy
2014-10-29 23:50     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).