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 25473A0A0E; Wed, 7 Apr 2021 17:24:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2E41140FC7; Wed, 7 Apr 2021 17:24:45 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80079.outbound.protection.outlook.com [40.107.8.79]) by mails.dpdk.org (Postfix) with ESMTP id B1C3F406A3 for ; Wed, 7 Apr 2021 17:24:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZwA77jVsKSItyr8huwEWHBjyD3fVC2leFZZq/hmHPsXYHZ/p7U4SkBHb4WOIrSfDN6A+DPL2snvTPn8LoN3bDiu0FQWW79JXvu0kevNPZRVAPmp+LSuD+Wp5c7SRlyr0fCsOHny1gUgUvAQ3SnC3edctPkhxOpWiCiklTOiE9fLfqQJj1+n0/c6eCjUy/oiNx64Zkps3ZgeBiTpvXDsSd2pUn4PY6FzzIPx5WbV92rm2/zjpIv4xISlQ6i82fBRYC4xAvztpEszVjT6bLvuXpPgAGi3fOoj1lx9mbunJzBBNt0rNWUmHC4b616EA84L6m0gR5GPELTUrPi6YyX/3Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZBkjuSCOt5CScdWExeDM7FVYKbpnmLpWl/bPnHgbqwo=; b=TOS8kpoNV8a//SQ9KMbhYKVES5WRhXgsAAdg/Q3KnDZQeaAtda01/0N9xxuV0HwqN3HDNdTkXJSIMIXusQ6HdDfwsmMz5XaBISH+Dl4vIDheTHaaKcXMTq/NwSvaoJKevTVCM78/WGk48biItnyhLtVyUYMWrS8aGUEfA+omGOHX66rK20T4ay2a9UcNa9vhZ9tFvm7Sm+xdlpiHh6cTrFdUFtwqESSornCm0BWaBhWwWqy0E2Z8xYyzd6xRC8wsbvQ8b4+3XJewHh4rH9akzdlgExGzQDV1Y/3eYaoThKme6Dw7zO31R2CVJlS+JDanTpMmYfbdIUDRReo/+6LThA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZBkjuSCOt5CScdWExeDM7FVYKbpnmLpWl/bPnHgbqwo=; b=X1Csm2+zz20fDG7rO5Mj4+U7HvF1BquS9FETCiZ89pbNbZvKVMJ3B/o1ZRNnVuCQzs09ey33bHUz2rl4oBYphIp0BpWn6z37WZKFP//gtWY5pxhRqW0NtYXGj/mdokDGuljNjfrKKN6xHMGDLHRGgxIAjo/0yaPkWOH1N4lGndg= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) by AM6PR04MB6645.eurprd04.prod.outlook.com (2603:10a6:20b:fe::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.27; Wed, 7 Apr 2021 15:24:42 +0000 Received: from AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55]) by AM6PR04MB4456.eurprd04.prod.outlook.com ([fe80::ad9e:a38e:e84e:bf55%6]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 15:24:42 +0000 To: dev@dpdk.org References: <20210407141842.483976-1-lingyu.liu@intel.com> <20210407150945.485176-1-lingyu.liu@intel.com> From: Hemant Agrawal Message-ID: Date: Wed, 7 Apr 2021 20:54:34 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 In-Reply-To: <20210407150945.485176-1-lingyu.liu@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [223.178.219.73] X-ClientProxiedBy: HK2PR04CA0068.apcprd04.prod.outlook.com (2603:1096:202:15::12) To AM6PR04MB4456.eurprd04.prod.outlook.com (2603:10a6:20b:22::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.2] (223.178.219.73) by HK2PR04CA0068.apcprd04.prod.outlook.com (2603:1096:202:15::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 15:24:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0e0e079-ac70-44ae-c8de-08d8f9d9443b X-MS-TrafficTypeDiagnostic: AM6PR04MB6645: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:785; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AAVt10I2Ci4ue/wwHRZ96Xbg4xV67OV53RvRMsQyowxDmPmsHu2ATHLjv9IaHEdKhLy3A4duOTWAsHlWmPHsL5EOW5inR9qMzVgNA1bPGmzfRzwuywq/cVE/rv0b3vuenJI0NZCWEnctFsFrBW6x/rIIbHXe+jK1a25ZQoWDgmO0CTff3aoq0VBsLdtXnIbSMXJhok8ycIxHINMu2WZzB8YPoKry8BsDTomkJPwzbpktqpUb5hxP7fQFoYsykveF2PbCqFLeZ2xS898IahrR7KJjMN7A+VUujBkEacr4NF4HJRzfpNeyIo/GuIDqsmqXKtww1HEd/JAKobaozUbFTmRARlcFi/nVt3kBa7JZ5BgFqPFqSaf6coM15RCrBD6Ee70eYmsY/GizNLTTJBtswd+6c3T/6TbfnQcPIZI9CsvPlRyaX9lRy6a/pEC9ituhB0lraCB58qV04o1jLSUOYucxno5S824E5tO1f033kuobULYXlKKZqGCKSIPX/MDIhQNv/+va92ZSsO84GMIbddW/QjlDYaIn5te9stSu+BxAnuEfyBf87PNryun6tvJXtT5TBY9Q8eS35+SaMDHUGqHMEwZhuUyV8Ph1n70dQAoIQS6p81il81+mopGxBZI2C4YgkXBQHyAQsLbWbq+V+loD2aaxYSmFjd6LsiLgGXFl7ztDZJohF/lZf8Lg6mrqq6t5pb66iXcCIPBEj4EZWnk126Zgg9InQQdAJHlW/RY2CG7KORet+nzwum/qLQ8O X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB4456.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(396003)(39860400002)(136003)(366004)(86362001)(6666004)(16526019)(26005)(316002)(186003)(8676002)(31696002)(2616005)(8936002)(478600001)(38350700001)(44832011)(53546011)(38100700001)(6916009)(956004)(6486002)(52116002)(66946007)(66476007)(66556008)(83380400001)(31686004)(16576012)(5660300002)(2906002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?UTE4bEg3b3lEdmdmYXYrRXNGak1TZXR0WkxDSFVQNEx5dFY5SWpHV3ZleWwz?= =?utf-8?B?eHZVc2RZc0d2QWVrSU9ESDVqcW5yNXJLWm5yczlIdWp3WXpHVDhTSG00RXY1?= =?utf-8?B?RVlpQ0ZmcmI0SHhMRWRkYWMyWmpSRGpZckJwZG42RFRTb0JCMjRWVUlyb0N4?= =?utf-8?B?NDd4U1phMkZCdjVDSkVod2EwWlBpd3hpRFArM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ZOTGY3ZEhkNUpzMURhczFvQm82bi85?= =?utf-8?B?ZGpNRmh6ZzJBb0VBVFNXdVowN0xzYm1lVi83ZlVVVnNDWG1DcWt3NFRIN3Zm?= =?utf-8?B?aUlQckYvTmtQSWc3Uk5YVEdlZGxPbm9TUFpHbHlOZU5jR2gyR2FhZ0FyQUR3?= =?utf-8?B?V0dqUDgvMXh3Z1RtL1pXRWZkaDJFeGwzbVJsdVJLamNYemxvN0VxYTBhcmI2?= =?utf-8?B?UWRLWnlZL3RiWHMraGFBbVhrZkE0YXdFa25ZRnNJd29WTThNU3FzamxxTWFW?= =?utf-8?B?ZWZWL0R5OU9UdEZESUpNYUlWSXVTV01VT1JmZXV6dE9Kakt0N05SVzNvTWNM?= =?utf-8?B?c0thZ2Rzdk5MWWlUeDNmVUVQQzZSVTF4U3M3WEZmaHB3MFhBb3pId0dwaHJa?= =?utf-8?B?dDhqWm84cmcvYVlYekNYQVJKOEdBUk84LzcxQlJNUkdxVEowT0ZlQmFPTFNp?= =?utf-8?B?dW5RNlExaDRtbGtLQzRWQU1PM200MFRZOER6NHdMMm42TWJrTjlIMktKM3Zl?= =?utf-8?B?cUE1VmtKQ1lEOW8yTkpNb0Q2U2cwNTdmbkxaZkR4alcyODBrTzFqSENIUVZr?= =?utf-8?B?NzgzRDFvQW9ZS0FBUHRJaGdONlc5YXdmOGU4bW5uM2lVdjN4Wmx2VFJWN3FW?= =?utf-8?Q?aLnaJ7k+aHXsvXXimAg7wL4SE8SEG2Z5SKZU/v4?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0e0e079-ac70-44ae-c8de-08d8f9d9443b X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4456.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 15:24:42.3721 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CztNk5E/MXHRlI5fBUwLY0i7+FQh5QQefmpd4Q/gFYeWvdw/gy7UOvlcs4OJnYexPEwwamfrMW+fG3Zure1jUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB6645 Subject: Re: [dpdk-dev] [RFC 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: , Reply-To: hemant.agrawal@nxp.com Errors-To: dev-bounces@dpdk.org Sender: "dev" looks ok to me. Acked-by: Hemant Agrawal On 4/7/2021 8:39 PM, Liulingyu wrote: > Add L2_ETHER_ECPRI and L4_UDP_TUNNEL_ECPRI in RTE_PTYPE. > > Signed-off-by: Liulingyu > --- > 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 > *