DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: Lingyu Liu <lingyu.liu@intel.com>,
	dev@dpdk.org, qi.z.zhang@intel.com, olivier.matz@6wind.com,
	thomas@monjalon.net, david.marchand@redhat.com
Cc: Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: Re: [dpdk-dev] [PATCH V3 1/2] mbuf: support eCPRI hardware packet type
Date: Tue, 20 Apr 2021 12:57:43 +0300	[thread overview]
Message-ID: <b2b75e0f-cfd5-fbd0-f88a-ffb44fa1dc06@oktetlabs.ru> (raw)
In-Reply-To: <20210420083817.10741-2-lingyu.liu@intel.com>

On 4/20/21 11:38 AM, Lingyu Liu wrote:
> Add L2_ETHER_ECPRI and L4_UDP_TUNNEL_ECPRI in RTE_PTYPE.
> 
> Signed-off-by: Lingyu Liu <lingyu.liu@intel.com>
> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> ---
>  app/test-pmd/util.c              | 25 ++++++++++++++++---------
>  lib/librte_mbuf/rte_mbuf_ptype.c |  2 ++
>  lib/librte_mbuf/rte_mbuf_ptype.h | 22 ++++++++++++++++++++++
>  3 files changed, 40 insertions(+), 9 deletions(-)
> 
> diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
> index a9e431a8b2..494ebbf909 100644
> --- a/app/test-pmd/util.c
> +++ b/app/test-pmd/util.c
> @@ -258,16 +258,23 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
>  				udp_hdr = rte_pktmbuf_mtod_offset(mb,
>  				struct rte_udp_hdr *,
>  				l2_len + l3_len);
> -				l4_len = sizeof(struct rte_udp_hdr);
> -				vxlan_hdr = rte_pktmbuf_mtod_offset(mb,
> -				struct rte_vxlan_hdr *,
> -				l2_len + l3_len + l4_len);
>  				udp_port = RTE_BE_TO_CPU_16(udp_hdr->dst_port);
> -				vx_vni = rte_be_to_cpu_32(vxlan_hdr->vx_vni);
> -				MKDUMPSTR(print_buf, buf_size, cur_len,
> -					  " - VXLAN packet: packet type =%d, "
> -					  "Destination UDP port =%d, VNI = %d",
> -					  packet_type, udp_port, vx_vni >> 8);
> +				l4_len = sizeof(struct rte_udp_hdr);
> +				if (RTE_ETH_IS_ECPRI_HDR(packet_type)) {
> +					MKDUMPSTR(print_buf, buf_size, cur_len,
> +						  " - eCPRI packet: packet type =%d, "
> +						  "Destination UDP port =%d",
> +						  packet_type, udp_port);
> +				} else {
> +					vxlan_hdr = rte_pktmbuf_mtod_offset(mb,
> +					struct rte_vxlan_hdr *,
> +					l2_len + l3_len + l4_len);
> +					vx_vni = rte_be_to_cpu_32(vxlan_hdr->vx_vni);
> +					MKDUMPSTR(print_buf, buf_size, cur_len,
> +						  " - VXLAN packet: packet type =%d, "
> +						  "Destination UDP port =%d, VNI = %d",
> +						  packet_type, udp_port, vx_vni >> 8);
> +				}

It definitely requires a pre-patch to avoid assumption
that any UDP tunnel is a VXLAN.

>  			}
>  		}
>  		MKDUMPSTR(print_buf, buf_size, cur_len,

[snip]

> diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
> index 17a2dd3576..5fdf369ac0 100644
> --- a/lib/librte_mbuf/rte_mbuf_ptype.h
> +++ b/lib/librte_mbuf/rte_mbuf_ptype.h

[snip]

> @@ -688,6 +708,8 @@ extern "C" {
>  		RTE_PTYPE_INNER_L3_MASK |				\
>  		RTE_PTYPE_INNER_L4_MASK))
>  
> +/* Check if it is a ECPRI packet */
> +#define  RTE_ETH_IS_ECPRI_HDR(ptype) ((ptype) & RTE_PTYPE_TUNNEL_ECPRI)

It looks wrong. You should apply tunnel mask
RTE_PTYPE_TUNNEL_MASK and compare result with
RTE_PTYPE_TUNNEL_ECPRI.


  reply	other threads:[~2021-04-20  9:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-17  9:04 [dpdk-dev] [PATCH v1] mbuf: support eCPRI hardware packet type Add L2_ETHER_ECPRI and L4_UDP_TUNNEL_ECPRI in RTE_PTYPE Lingyu Liu
2021-04-17  9:25 ` [dpdk-dev] [PATCH v2] mbuf: support eCPRI hardware packet type Lingyu Liu
2021-04-19 14:24   ` Olivier Matz
2021-04-20  2:17     ` Liu, Lingyu
2021-04-20  7:51       ` Thomas Monjalon
2021-04-20 10:06         ` Andrew Rybchenko
2021-04-22 11:09         ` Liu, Lingyu
2021-04-20 13:01       ` Bing Zhao
2021-04-20  8:38   ` [dpdk-dev] [PATCH V3 0/2] mbuf:add eCPRI hardware packet type mapping Lingyu Liu
2021-04-20  8:38     ` [dpdk-dev] [PATCH V3 1/2] mbuf: support eCPRI hardware packet type Lingyu Liu
2021-04-20  9:57       ` Andrew Rybchenko [this message]
2021-04-20  8:38     ` [dpdk-dev] [PATCH V3 2/2] net/iavf: update PTYPE mapping for eCPRI Lingyu Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2b75e0f-cfd5-fbd0-f88a-ffb44fa1dc06@oktetlabs.ru \
    --to=andrew.rybchenko@oktetlabs.ru \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=lingyu.liu@intel.com \
    --cc=olivier.matz@6wind.com \
    --cc=qi.z.zhang@intel.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).