linux-dpdk: packet: do not force reparse for odp_packet_has_eth()

Message ID 1455756421-21215-1-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer Feb. 18, 2016, 12:47 a.m.
This brings odp-dpdk back to the same logic as is used in linux-generic
and fixes Bug https://bugs.linaro.org/show_bug.cgi?id=2040

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 platform/linux-dpdk/odp_packet_flags.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Zoltan Kiss March 1, 2016, 5:24 p.m. | #1
This won't work with ODP-DPDK, because it doesn't call packet_parse_l2() 
on each packet to avoid the performance penalty of that.
I think we should use the built-in rte_mbuf fields instead now, I'll 
send a patch for that.

Zoli

On 18/02/16 00:47, Bill Fischofer wrote:
> This brings odp-dpdk back to the same logic as is used in linux-generic
> and fixes Bug https://bugs.linaro.org/show_bug.cgi?id=2040
>
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>   platform/linux-dpdk/odp_packet_flags.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/platform/linux-dpdk/odp_packet_flags.c b/platform/linux-dpdk/odp_packet_flags.c
> index 83a4006..8e406c2 100644
> --- a/platform/linux-dpdk/odp_packet_flags.c
> +++ b/platform/linux-dpdk/odp_packet_flags.c
> @@ -48,7 +48,9 @@ int odp_packet_has_l4(odp_packet_t pkt)
>
>   int odp_packet_has_eth(odp_packet_t pkt)
>   {
> -	retflag(pkt, input_flags.eth);
> +	odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
> +
> +	return pkt_hdr->input_flags.eth;
>   }
>
>   int odp_packet_has_jumbo(odp_packet_t pkt)
>

Patch hide | download patch | download mbox

diff --git a/platform/linux-dpdk/odp_packet_flags.c b/platform/linux-dpdk/odp_packet_flags.c
index 83a4006..8e406c2 100644
--- a/platform/linux-dpdk/odp_packet_flags.c
+++ b/platform/linux-dpdk/odp_packet_flags.c
@@ -48,7 +48,9 @@  int odp_packet_has_l4(odp_packet_t pkt)
 
 int odp_packet_has_eth(odp_packet_t pkt)
 {
-	retflag(pkt, input_flags.eth);
+	odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
+
+	return pkt_hdr->input_flags.eth;
 }
 
 int odp_packet_has_jumbo(odp_packet_t pkt)