From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D1518A00C5; Sun, 5 Jul 2020 13:36:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4ACBB1DB9E; Sun, 5 Jul 2020 13:36:56 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80089.outbound.protection.outlook.com [40.107.8.89]) by dpdk.org (Postfix) with ESMTP id 290691DB79 for ; Sun, 5 Jul 2020 13:36:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H5o/fEE2VnIDx8foYJeGBm3vpF9ktzta1l7PJD8lpN1y8k442MGw5uc1maPFPoPZfUhEpiANQozbrlgy/kHqWU6e3ghFoazSDGgy9BwpZf98xYFvlwd/LaBSg/IlGDpvckrTmzbfBhdEAt1pCNPMiGU32GrlUBxymgaFbzocmHHPkoX+CmnpG58zaV6cShBktv1aRCYI3fCYYD1W91UAYWNQmhRpD0m0KEJ5wW3fcszyHok+VU57yJs+wQ2MPu26zV9VK07l1qAnCDLAzaZY0AKokud+QDUWq2gPE1Y1QmXwPoBgB/Ug1coTOiit4Jo39fdCj+ziNo85D3kceVolKg== 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=c5nFakKgfq3U3gvyp3z5v6ZVQsqhqPTlcLfh5NIPk3w=; b=g6fJdoxdSL+8X42vQbQD95M4ap7KMwF1Rqxfpu+lV4lkbyCaJ2//G31cp1F1G4nu9SmjRVg9RI9fnmwu3hMsrAgVHKVTN6p9i0N0Q9Kx5MLvHcZXA7zIiIOh9wS8XwJJ/hqxB0if5F08ACx2xE0N25U/KbW6BfQebTglam/NFRYQg644qwzDlNTRZ8d8lhVVp0hkvDM2mLTtj+geQWhsZK1jKUqxWidv3/+Bq3jSkpRGkZ4HChYsP8CP8F3hIrBzdMRN7RE12E273zZvY7GXWVu8wmw4duhfr872KX3kD7vYzZ3Ja8nqEPch7vPxGfKxrRLBKupCci4NWS2HAdyXVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c5nFakKgfq3U3gvyp3z5v6ZVQsqhqPTlcLfh5NIPk3w=; b=qLXRbkYX14fMS5L1Zz1zzcXPnm6LU6m33lf70ilm+e00b+e+ueQkMU7WiVRtGZt1qzFOg/rH1AcPS7LicEeS9NqCPbjmIkHwkYjXRRDdABzS7GAs6xK9koT5mdEju2P66WwJBYIeInhrfblJwAXVr/du41p/73GoWymgq1MX7+A= Received: from AM6PR05MB5176.eurprd05.prod.outlook.com (2603:10a6:20b:63::30) by AM6PR05MB4821.eurprd05.prod.outlook.com (2603:10a6:20b:2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.28; Sun, 5 Jul 2020 11:36:53 +0000 Received: from AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::9024:accb:4d6b:805f]) by AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::9024:accb:4d6b:805f%3]) with mapi id 15.20.3153.029; Sun, 5 Jul 2020 11:36:53 +0000 From: Ori Kam To: Bing Zhao , "john.mcnamara@intel.com" , "marko.kovacevic@intel.com" , Thomas Monjalon , "ferruh.yigit@intel.com" , "arybchenko@solarflare.com" , "olivier.matz@6wind.com" CC: "dev@dpdk.org" , "wenzhuo.lu@intel.com" , "beilei.xing@intel.com" , "bernard.iremonger@intel.com" Thread-Topic: [PATCH v3 2/2] app/testpmd: add eCPRI in flow creation patterns Thread-Index: AQHWUG/xhVU6WdkpDkSgkdToTokKTaj44B2A Date: Sun, 5 Jul 2020 11:36:53 +0000 Message-ID: References: <1593672361-285288-1-git-send-email-bingz@mellanox.com> <1593694422-299952-1-git-send-email-bingz@mellanox.com> <1593694422-299952-3-git-send-email-bingz@mellanox.com> In-Reply-To: <1593694422-299952-3-git-send-email-bingz@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [147.236.152.129] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: a73c65d4-aedc-4f7d-839a-08d820d7b739 x-ms-traffictypediagnostic: AM6PR05MB4821: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 045584D28C x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MSwerrMPLcr4GhoGiSVEydeYaiIRbewxwRoXrjhbRJLCq1/CgCyKQgL1gBhPh7rKrAOTZ9C19RRcIIrzU1c8nKz54oTrRWMdCIFnXWdnM9PKJrn5fJySqdtWAv+SaQo4W5f+oiNtnxZrHwa/dNXvN6DK4y+6OHp9tR9ypIv2wuYBLBK83DG1gK863r1Myo/3ULCuThtRUvAGOYP3L0eAXGjw/ekMRlHT4b1F2Vj/jQTZpYbpo8Iq0CC2caWFyhda6Ju5pxfITeQ5tMpjA4ElTCGW52bxXj/CTkOT+5ZS2M3fvr9dlNETt+oeXN3tnwkAlqutL8sMB4mjM4+/WQRjww== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR05MB5176.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(39860400002)(366004)(136003)(376002)(346002)(8676002)(186003)(26005)(7416002)(33656002)(53546011)(6506007)(55016002)(9686003)(7696005)(71200400001)(76116006)(66556008)(66476007)(64756008)(66446008)(4326008)(66946007)(83380400001)(478600001)(2906002)(8936002)(5660300002)(52536014)(316002)(110136005)(54906003)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: ja+lV1oWjrbdlPmVBlRaAuAuDTMOlbUS9r1vvFhc4VSz/RCcmTgt5TYyxQTKuypPAKtBtHROrIM4czgWoEv5LVGla4exGhr6CFNWGYq0PRRitjfiaEJ3Clx0oC0+ZYL2/Pc2+AkLlZPArhUNOJIcyNc+i74jY7Q1I8n663X/WAjx3OyvOZMfuEBbuutr6Oyz7e44CGKdqJZHPs3VJPbnxzST//BOXRqe3G7Sof5F43D0Dczr9QNcSO4tukieCC7hfeOHih+2AKzjFodZFJarPWdRKbWjsexbJ8VhHBJNDCxq28z1WGKEV8Ww1Zf1T40owmVyuBPvu3Z5Yq+1U5CZPiTkJCiBvqFBR3thxiiCkwswSDSVmcnN6xbRy4HwuuJjWk2XUcDzqxGbPA2SevJkJetD3WbmBpIWopNdcB4KiLM9O19uFVMwkBLorYC0CZLG2+crNGgE0/vEbpox1tS0G2LkXQCv1iDmfRUlJ9dcfDfdZJWxTOVyP2ty5aVUEn1n Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM6PR05MB5176.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a73c65d4-aedc-4f7d-839a-08d820d7b739 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2020 11:36:53.6282 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: LubB6oA8OCUDW52ABz32cM5gXcLRQ5J/vzK3hBWcHrC2tpZCrC7w2fTpdZka4+n9VHwaHRLQpOUJcXs7ku1YdA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4821 Subject: Re: [dpdk-dev] [PATCH v3 2/2] app/testpmd: add eCPRI in flow creation patterns X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Bing, > -----Original Message----- > From: Bing Zhao > Sent: Thursday, July 2, 2020 3:54 PM > To: Ori Kam ; john.mcnamara@intel.com; > marko.kovacevic@intel.com; Thomas Monjalon ; > ferruh.yigit@intel.com; arybchenko@solarflare.com; olivier.matz@6wind.com > Cc: dev@dpdk.org; wenzhuo.lu@intel.com; beilei.xing@intel.com; > bernard.iremonger@intel.com > Subject: [PATCH v3 2/2] app/testpmd: add eCPRI in flow creation patterns >=20 > In order to verify offloading of eCPRI protocol via flow rules, the > command line of flow creation should support the parsing of the eCPRI > pattern. >=20 > Based on the specification, one eCPRI message will have the common > header and payload. Payload format is various based on the type field > of the common header. Fixed strings will be used instead of integer > to make the CLI easy for auto-completion. >=20 > The testpmd command line examples of flow to match eCPRI item are > listed below: > 1. flow create 0 ... pattern eth / ecpri / end actions ... > This is to match all eCPRI messages. > 2. flow create 0 ... pattern eth / ecpri common type rtc_ctrl / end act= ions ... > This is to match all eCPRI messages with the type #2 - "Real-Time > Control Data". > 3. flow create 0 ... pattern eth / ecpri common type iq_data pc_id is [= U16Int] / > end actions ... > This is to match eCPRI messages with the type #0 - "IQ Data", and > the physical channel ID 'pc_id' of the messages is a specific > value. Since the sequence ID is changeable, there is no need to > match that field in the flow. > Currently, only type #0, #2 and #5 will be supported. >=20 > Since eCPRI could be over Ethernet layer (or after .1Q) and UDP > layer, it is the PMD driver's responsibility to check whether eCPRI > is supported and which protocol stack is supported. Network byte > order should be used for eCPRI header, the same as other headers. >=20 > Signed-off-by: Bing Zhao > --- > app/test-pmd/cmdline_flow.c | 143 > ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 143 insertions(+) >=20 > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index 4e2006c..801581e 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -230,6 +230,15 @@ enum index { > ITEM_PFCP, > ITEM_PFCP_S_FIELD, > ITEM_PFCP_SEID, > + ITEM_ECPRI, > + ITEM_ECPRI_COMMON, > + ITEM_ECPRI_COMMON_TYPE, > + ITEM_ECPRI_COMMON_TYPE_IQ_DATA, > + ITEM_ECPRI_COMMON_TYPE_RTC_CTRL, > + ITEM_ECPRI_COMMON_TYPE_DLY_MSR, > + ITEM_ECPRI_MSG_IQ_DATA_PCID, > + ITEM_ECPRI_MSG_RTC_CTRL_RTCID, > + ITEM_ECPRI_MSG_DLY_MSR_MSRID, >=20 > /* Validate/create actions. */ > ACTIONS, > @@ -791,6 +800,7 @@ static const enum index next_item[] =3D { > ITEM_ESP, > ITEM_AH, > ITEM_PFCP, > + ITEM_ECPRI, > END_SET, > ZERO, > }; > @@ -1101,6 +1111,24 @@ static const enum index item_l2tpv3oip[] =3D { > ZERO, > }; >=20 > +static const enum index item_ecpri[] =3D { > + ITEM_ECPRI_COMMON, > + ITEM_NEXT, > + ZERO, > +}; > + > +static const enum index item_ecpri_common[] =3D { > + ITEM_ECPRI_COMMON_TYPE, > + ZERO, > +}; > + > +static const enum index item_ecpri_common_type[] =3D { > + ITEM_ECPRI_COMMON_TYPE_IQ_DATA, > + ITEM_ECPRI_COMMON_TYPE_RTC_CTRL, > + ITEM_ECPRI_COMMON_TYPE_DLY_MSR, > + ZERO, > +}; > + > static const enum index next_action[] =3D { > ACTION_END, > ACTION_VOID, > @@ -1409,6 +1437,9 @@ static int parse_vc_spec(struct context *, const st= ruct > token *, > const char *, unsigned int, void *, unsigned int); > static int parse_vc_conf(struct context *, const struct token *, > const char *, unsigned int, void *, unsigned int); > +static int parse_vc_item_ecpri_type(struct context *, const struct token= *, > + const char *, unsigned int, > + void *, unsigned int); > static int parse_vc_action_rss(struct context *, const struct token *, > const char *, unsigned int, void *, > unsigned int); > @@ -2802,6 +2833,66 @@ static const struct token token_list[] =3D { > .next =3D NEXT(item_pfcp, NEXT_ENTRY(UNSIGNED), > item_param), > .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_pfcp, > seid)), > }, > + [ITEM_ECPRI] =3D { > + .name =3D "ecpri", > + .help =3D "match eCPRI header", > + .priv =3D PRIV_ITEM(ECPRI, sizeof(struct rte_flow_item_ecpri)), > + .next =3D NEXT(item_ecpri), > + .call =3D parse_vc, > + }, > + [ITEM_ECPRI_COMMON] =3D { > + .name =3D "common", > + .help =3D "eCPRI common header", > + .next =3D NEXT(item_ecpri_common), > + }, > + [ITEM_ECPRI_COMMON_TYPE] =3D { > + .name =3D "type", > + .help =3D "type of common header", > + .next =3D NEXT(item_ecpri_common_type), > + .args =3D ARGS(ARG_ENTRY_HTON(struct rte_flow_item_ecpri)), > + }, > + [ITEM_ECPRI_COMMON_TYPE_IQ_DATA] =3D { > + .name =3D "iq_data", > + .help =3D "Type #0: IQ Data", > + .next =3D NEXT(NEXT_ENTRY(ITEM_ECPRI_MSG_IQ_DATA_PCID, > + ITEM_NEXT)), > + .call =3D parse_vc_item_ecpri_type, > + }, > + [ITEM_ECPRI_MSG_IQ_DATA_PCID] =3D { > + .name =3D "pc_id", > + .help =3D "Physical Channel ID", > + .next =3D NEXT(item_ecpri, NEXT_ENTRY(UNSIGNED), > item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ecpri, > + hdr.type0.pc_id)), > + }, > + [ITEM_ECPRI_COMMON_TYPE_RTC_CTRL] =3D { > + .name =3D "rtc_ctrl", > + .help =3D "Type #2: Real-Time Control Data", > + .next =3D > NEXT(NEXT_ENTRY(ITEM_ECPRI_MSG_RTC_CTRL_RTCID, > + ITEM_NEXT)), > + .call =3D parse_vc_item_ecpri_type, > + }, > + [ITEM_ECPRI_MSG_RTC_CTRL_RTCID] =3D { > + .name =3D "rtc_id", > + .help =3D "Real-Time Control Data ID", > + .next =3D NEXT(item_ecpri, NEXT_ENTRY(UNSIGNED), > item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ecpri, > + hdr.type2.rtc_id)), > + }, > + [ITEM_ECPRI_COMMON_TYPE_DLY_MSR] =3D { > + .name =3D "delay_measure", > + .help =3D "Type #5: One-Way Delay Measurement", > + .next =3D > NEXT(NEXT_ENTRY(ITEM_ECPRI_MSG_DLY_MSR_MSRID, > + ITEM_NEXT)), > + .call =3D parse_vc_item_ecpri_type, > + }, > + [ITEM_ECPRI_MSG_DLY_MSR_MSRID] =3D { > + .name =3D "msr_id", > + .help =3D "Measurement ID", > + .next =3D NEXT(item_ecpri, NEXT_ENTRY(UNSIGNED), > item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ecpri, > + hdr.type5.msr_id)), > + }, > /* Validate/create actions. */ > [ACTIONS] =3D { > .name =3D "actions", > @@ -4124,6 +4215,58 @@ parse_vc_conf(struct context *ctx, const struct > token *token, > return len; > } >=20 > +/** Parse eCPRI common header type field. */ > +static int > +parse_vc_item_ecpri_type(struct context *ctx, const struct token *token, > + const char *str, unsigned int len, > + void *buf, unsigned int size) > +{ > + struct rte_flow_item_ecpri *ecpri; > + struct rte_flow_item_ecpri *ecpri_mask; > + struct rte_flow_item *item; > + uint32_t data_size; > + uint8_t msg_type; > + struct buffer *out =3D buf; > + const struct arg *arg; > + > + (void)size; > + /* Token name must match. */ > + if (parse_default(ctx, token, str, len, NULL, 0) < 0) > + return -1; > + switch (ctx->curr) { > + case ITEM_ECPRI_COMMON_TYPE_IQ_DATA: > + msg_type =3D RTE_ECPRI_MSG_TYPE_IQ_DATA; > + break; > + case ITEM_ECPRI_COMMON_TYPE_RTC_CTRL: > + msg_type =3D RTE_ECPRI_MSG_TYPE_RTC_CTRL; > + break; > + case ITEM_ECPRI_COMMON_TYPE_DLY_MSR: > + msg_type =3D RTE_ECPRI_MSG_TYPE_DLY_MSR; > + break; > + default: > + return -1; > + } > + if (!ctx->object) > + return len; > + arg =3D pop_args(ctx); > + if (!arg) > + return -1; > + ecpri =3D (struct rte_flow_item_ecpri *)out->args.vc.data; > + ecpri->hdr.common.type =3D msg_type; > + data_size =3D ctx->objdata / 3; /* spec, last, mask */ > + ecpri_mask =3D (struct rte_flow_item_ecpri *)(out->args.vc.data + > + (data_size * 2)); > + ecpri_mask->hdr.common.type =3D 0xFF; > + if (arg->hton) { > + ecpri->hdr.dw0 =3D rte_cpu_to_be_32(ecpri->hdr.dw0); > + ecpri_mask->hdr.dw0 =3D rte_cpu_to_be_32(ecpri_mask- > >hdr.dw0); > + } > + item =3D &out->args.vc.pattern[out->args.vc.pattern_n - 1]; > + item->spec =3D ecpri; > + item->mask =3D ecpri_mask; > + return len; > +} > + > /** Parse RSS action. */ > static int > parse_vc_action_rss(struct context *ctx, const struct token *token, > -- Acked-by: Ori Kam Thanks, Ori > 2.5.5