From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 14A28A0524; Mon, 19 Apr 2021 16:24:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E9C3A4130F; Mon, 19 Apr 2021 16:24:55 +0200 (CEST) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mails.dpdk.org (Postfix) with ESMTP id 8370E412E6 for ; Mon, 19 Apr 2021 16:24:54 +0200 (CEST) Received: by mail-wr1-f46.google.com with SMTP id s7so34173842wru.6 for ; Mon, 19 Apr 2021 07:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=C2+MxAuBcDna0DoD0FE2onSQRiTR3CWXBt9NpRXyPTQ=; b=eGJf5N7x1oydAF+8Jre+E1ZFTlm99qiNCgKoI5JoURU/t8h/F+4wSsqwXCUzG7h8CI ulinCAwWKTYuLer5NwH5Ou0D+QdpzPGGjUEivLH3FYInY+fp+dq2Ud98QZ76rM9Q7Xb3 AiutVlNpeg8KAOT2QkzKmsSm3UQey0lpTELEDSWjwza4IErnFewH/p4dRE67tGhSyAAz dDZUbZBLCks7dauWZvTcNac9V03TYojJanZ6lt5FxLXb2NCY43rYlPCuQoteIsRaM7m7 jcX9wEJ89qtj88xee1MWs4bpg94WhKoF18OmiNb/FTqypkoXoyA7LkJ3lIWef/HPWaau xptw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=C2+MxAuBcDna0DoD0FE2onSQRiTR3CWXBt9NpRXyPTQ=; b=o692EBVPCDWqLTNMB2O2SxVZZKuXoqrsf3vEkRszlkZyO3Z4BMwotiglKS+C7baeaB KWJK5O7UgbdYv6QLQfRE02sGUlc1ktuKMA6UwwFpLjIwjTpYgW+/mEEp65xoj8Yg1B8G SHYY4kyTA/c4xJrxzuWnhzDi61OketbmogjlQVJ+HWrh/x/GHD8zPAaWZI9VUFXtH172 g1LW6ZtXVQ6PQZ47Il1I5MxZsZEto+Xayp7oMZHAPnoXzxg1z9cW4BMRgf5xCEjkjoXC FIQn/Mws9rw9aXcFh+mq1RLltx7wdqIIMZ3qi+BrwO1FFTyqMaY0NMLBBsq/gk5nijMS E9kg== X-Gm-Message-State: AOAM531jKk86jbjcNxEG3Xs4WcR+LzwFs4befvk5dilagcGCfnWv8JN4 5dSmKM5uMITBCyDzuNEDTD5clA== X-Google-Smtp-Source: ABdhPJxjSAHlnL4vAPzE6978kFu7nu1lFHdhsuMRNknHC+iZDX+HkjXoNpixSR5IWoiTwaRnrZHkYg== X-Received: by 2002:a5d:4e47:: with SMTP id r7mr14797010wrt.271.1618842294288; Mon, 19 Apr 2021 07:24:54 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id i20sm18522206wmq.29.2021.04.19.07.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 07:24:53 -0700 (PDT) Date: Mon, 19 Apr 2021 16:24:53 +0200 From: Olivier Matz To: Lingyu Liu Cc: dev@dpdk.org, qi.z.zhang@intel.com, thomas@monjalon.net, david.marchand@redhat.com, Hemant Agrawal Message-ID: <20210419142453.GC1726@platinum> References: <20210417090415.5477-1-lingyu.liu@intel.com> <20210417092531.6001-1-lingyu.liu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210417092531.6001-1-lingyu.liu@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH v2] mbuf: support eCPRI hardware packet type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Lingyu, On Sat, Apr 17, 2021 at 09:25:31AM +0000, Lingyu Liu wrote: > Add L2_ETHER_ECPRI and L4_UDP_TUNNEL_ECPRI in RTE_PTYPE. > > Signed-off-by: Lingyu Liu > Acked-by: Hemant Agrawal The number of available packet types for tunnels is quite low (already mentionned in this thread [1]). [1] https://patches.dpdk.org/project/dpdk/patch/20210408081720.23314-3-ktejasree@marvell.com Can you give some details about how it will be used? For instance, which driver will set it, which kind of application will use it. Thanks, Olivier > --- > V2 change: > - refine commit log > > 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); > + } > } > } > MKDUMPSTR(print_buf, buf_size, cur_len, > diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c > index d6f906b06c..2bf97c89c6 100644 > --- a/lib/librte_mbuf/rte_mbuf_ptype.c > +++ b/lib/librte_mbuf/rte_mbuf_ptype.c > @@ -21,6 +21,7 @@ const char *rte_get_ptype_l2_name(uint32_t ptype) > case RTE_PTYPE_L2_ETHER_PPPOE: return "L2_ETHER_PPPOE"; > case RTE_PTYPE_L2_ETHER_FCOE: return "L2_ETHER_FCOE"; > case RTE_PTYPE_L2_ETHER_MPLS: return "L2_ETHER_MPLS"; > + case RTE_PTYPE_L2_ETHER_ECPRI: return "L2_ETHER_ECPRI"; > default: return "L2_UNKNOWN"; > } > } > @@ -71,6 +72,7 @@ const char *rte_get_ptype_tunnel_name(uint32_t ptype) > case RTE_PTYPE_TUNNEL_VXLAN_GPE: return "TUNNEL_VXLAN_GPE"; > case RTE_PTYPE_TUNNEL_MPLS_IN_UDP: return "TUNNEL_MPLS_IN_UDP"; > case RTE_PTYPE_TUNNEL_MPLS_IN_GRE: return "TUNNEL_MPLS_IN_GRE"; > + case RTE_PTYPE_TUNNEL_ECPRI: return "TUNNEL_ECPRI"; > default: return "TUNNEL_UNKNOWN"; > } > } > 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 > @@ -144,6 +144,13 @@ extern "C" { > * <'ether type'=[0x8847|0x8848]> > */ > #define RTE_PTYPE_L2_ETHER_MPLS 0x0000000a > +/** > + * eCPRI (extend Common Public Radio Interface) packet type. > + * > + * Packet format: > + * <'ether type'=[0xAEFE]> > + */ > +#define RTE_PTYPE_L2_ETHER_ECPRI 0x0000000b > /** > * Mask of layer 2 packet types. > * It is used for outer packet for tunneling cases. > @@ -491,6 +498,19 @@ extern "C" { > * | 'destination port'=6635> > */ > #define RTE_PTYPE_TUNNEL_MPLS_IN_UDP 0x0000d000 > +/** > + * ECPRI packet type. > + * > + * Packet format: > + * <'ether type'=0x0800 > + * | 'version'=4, 'protocol'=17, > + * | 'destination port'=5123> > + * or, > + * <'ether type'=0x86DD > + * | 'version'=6, 'protocol'=17, > + * | 'destination port'=5123> > + */ > +#define RTE_PTYPE_TUNNEL_ECPRI 0x0000e000 > /** > * Mask of tunneling packet types. > */ > @@ -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) > /** > * Get the name of the l2 packet type > * > -- > 2.25.1 >