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 690FBA0524; Tue, 13 Apr 2021 09:45:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1CA26160BE9; Tue, 13 Apr 2021 09:45:50 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2040.outbound.protection.outlook.com [40.107.220.40]) by mails.dpdk.org (Postfix) with ESMTP id B101F160BDF for ; Tue, 13 Apr 2021 09:45:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bc5vUBBA9/dyIQCMtAg6SjBdnlAUC4k5HrzvsblSlX5pQ8Z7GQfRgvaJelNW2p4agT/2jRfOL5+bNYYXoruIzvmeM+7UPCmuRInmoBxiWlDlb2YgNwVw++ZqEz9NWVysYiJ8Y77GxgcLNQcYSr4MaquzHny3UiV4n64VllqeZ6D9c4xR/eXwF3yK33cLfb52I4cOu3ZndFriIatRid1/65d2lrzc0mMP00qNCxZjqSgxAFa5vkSbcm+ihNLqJ2oscFpFrzW/itOEGbiSJoAVv8cZroM/oKBlfmnttePeJbOFeNUp3axiqtHzi/5KS1CQTDTJ4NdNT5ZlwwNcFfw0Cg== 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=238ER5GYVdFww+qLeAgEEJBOjLL9fSvAMkLun/YQqiI=; b=AJTyKWsbd1PEtBLdBHXI5nWkeR/9wfbBON5kYAwxKZDosfItSyjvIukHSzEfnogY11fRyVluNPBgMzqWZotMhJIqwe7sFHUUJsuYJleofyCF/r/cNk6np1pWKvoNRIvNLrCKz/o5tL0/gyh4tn8eVrM81WT9G6CnPaTqXEs6jXkZSkPUFdIYUtFFqjqUzTBpTlJFLAq8xDvIz59nIDSFxy803pRnq1nqDf2FD2iXyjaCz8XCr1p1cfFgf9EiX9D7a1bxAac/4QwpjUKZWWX7OHH73734tNA1OriUu9zYq7BChb/4Nbp802Htle0cZhqdpFd9oBOzi5BG6KifgSeg3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=238ER5GYVdFww+qLeAgEEJBOjLL9fSvAMkLun/YQqiI=; b=mWIEDmjQJ/wrZIl3/3l8LxPKuCbtoTLWROHxUYQuX4rrnwXfzF3nOy0L6/EKFD2tEmJZWUgDNemWnb9WbhmRa27jDzgw2upRXOjwc2ushAnlhngLHFJEhuzVI86lOqBSm7gr/W7dmnfQxsnGVU7Zx/drHmmHohJatU38z6dlgRnU+3wIF1pnnXjKaZdbm4jFXX9/zTjlK5WrGvZx+/6Q1EbS0py415sZXs3Enx0EVbe6Q+BMaiOIGQejnbxIBr0e5TVy+JPd1ulTD4p/r1sWBKeoEQyA4yxHOHDWvlrbANQIrsVGbVJGqG0z3TmNtmAQYYBUo9G7yQXYxmKB5o1H4g== Received: from DM6PR12MB2748.namprd12.prod.outlook.com (2603:10b6:5:43::28) by DM5PR12MB2517.namprd12.prod.outlook.com (2603:10b6:4:bb::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Tue, 13 Apr 2021 07:45:46 +0000 Received: from DM6PR12MB2748.namprd12.prod.outlook.com ([fe80::d011:3b55:aafb:9280]) by DM6PR12MB2748.namprd12.prod.outlook.com ([fe80::d011:3b55:aafb:9280%5]) with mapi id 15.20.4020.022; Tue, 13 Apr 2021 07:45:46 +0000 From: Raslan Darawsheh To: Olivier Matz CC: "dev@dpdk.org" , "ferruh.yigit@intel.com" , Ori Kam , "andrew.rybchenko@oktetlabs.ru" , "ivan.malov@oktetlabs.ru" , "ying.a.wang@intel.com" , Slava Ovsiienko , Shiri Kuzin Thread-Topic: [PATCH v4 1/2] ethdev: add new ext hdr for gtp psc Thread-Index: AQHXLHLlH2yWQSo7L0Op6qQCfrVvhKqqjhUwgAAa6QCAB25aAA== Date: Tue, 13 Apr 2021 07:45:46 +0000 Message-ID: References: <20210330075036.6579-2-rasland@nvidia.com> <20210404074552.24190-1-rasland@nvidia.com> <20210404074552.24190-2-rasland@nvidia.com> <20210408122956.GX1650@platinum> <20210408141036.GY1650@platinum> In-Reply-To: <20210408141036.GY1650@platinum> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [188.161.230.40] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8dd6d2d0-9e70-4c26-c0da-08d8fe502647 x-ms-traffictypediagnostic: DM5PR12MB2517: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sMPcff4jqlDJmcIVyRK3gXWGjC1zINvBmk+v71TxIn5cZ1k7ttpmFBtoQXac42pBF0fkaj/qk9GF/gnhMK++UlVg98EOSiXCq7o7iu2NbsU5QzYs2i8u+BEwAh9cj/r/uADywUUn3lIB3IUUOMBqmtlgBhsH61GBHRqLf8l02KAbQqLBSrKbULyl7LXRNH1oSSKk8BN5wvpoRR08OREAlNFUYQaTT80XB4qiD0At5JJwq/qtDAc0CBSPNgdvnJW18TSIw4h46i6opcUlyZuA7oawy9ny8lk9/BnD7RFztSKvObxnEqKFGXpxAhzv88ZiUMZBa1Z8cqxWh42Y7P6+gHFaXb8ZALiuImHkXF83t6frplJ7UgCTG6WBNSY3RZWhSOM/vW1LHrguZLhjEILoKM6kc2pMFIb/ai1nhGU7XUrpCeMjpDkZc2YCVpX8xKN/tnyHm4FLKt3fEg7OH13KOZug0QuXpE+kKAnEMmGbvAsJ38NGs5PPlND0aR7P18U2es3+69eRCf/kQsFkrvEx8VrMDF6tQ7nYWAhevjdK2hjSpikze0Fx/awnyi9VlfRxnxrmxD+TKRDYQ98U0EL+UkClPLUefpes8SaDl5IkO31qTlYPJV5t2Sf5VDJA9kzrEPUioYKR8GPVL6N3hZlTHtrUlzRaQfgTunz4bQt/VZYPkuUudinhxDl54IeZozm2 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB2748.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(39860400002)(136003)(376002)(55016002)(26005)(2906002)(6506007)(8936002)(38100700002)(71200400001)(8676002)(478600001)(83380400001)(186003)(9686003)(45080400002)(107886003)(66556008)(4326008)(64756008)(54906003)(66476007)(66446008)(5660300002)(53546011)(76116006)(33656002)(52536014)(7696005)(966005)(6916009)(86362001)(316002)(66946007)(122000001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?AIElSYB7EBQZg3nwv3Vi/9Jh/RkFQhF2AdBPbrkX7AMTuA846JUHUCTkGLed?= =?us-ascii?Q?xd4Ci8wG3L0XuzazmwaT7Mw2NqQC23YE+oJ8IkuvbNLVX3wJ47ndppUuY6yF?= =?us-ascii?Q?tSSl0KwqSHU+cvEp3kTQjMamgtYY7U3ol5qNKVe1vTOLJDiJ8HvWcUKJXagf?= =?us-ascii?Q?V0Z8EjX4L3qk7+sBaYIP0zFbeB8tXVhRPg8NsDPPaA6QFa9b66+xjRtYNPlQ?= =?us-ascii?Q?Vwhb+1GKqOweeZ+w3Y2u5iOjnLnX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?Q?LuRT045sgpR+KZjcP+AROE7vs0Myx7ofpSf/W6sH9ND3COufaS4yDSvhI4rl?= =?us-ascii?Q?Q/9qIhPTRrOu71sQhCKK6vaQqoEvRKASaIe6+gTgFMRcDxcD1IhZEW5gTz99?= =?us-ascii?Q?701C35vUbsbnkqCoyaJm0PHLk6teicyNTYymq6MbjnCNTcS1WrUTnfjyuj8I?= =?us-ascii?Q?rbQXnrGFVhUKAhsohKSxxOnQ?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB2748.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8dd6d2d0-9e70-4c26-c0da-08d8fe502647 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Apr 2021 07:45:46.4931 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Ka7aon05iW/vjuPvjCbRmphRk4FPXtqzR4APvCWb0HlRR7nOdw+dtMy3+CjpvIw/tD7PMWRc5DvTsBRnQFuzEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2517 Subject: Re: [dpdk-dev] [PATCH v4 1/2] ethdev: add new ext hdr for gtp psc 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 and sorry for late response,=20 > -----Original Message----- > From: Olivier Matz > Sent: Thursday, April 8, 2021 5:11 PM > To: Raslan Darawsheh > Cc: dev@dpdk.org; ferruh.yigit@intel.com; Ori Kam ; > andrew.rybchenko@oktetlabs.ru; ivan.malov@oktetlabs.ru; > ying.a.wang@intel.com; Slava Ovsiienko ; Shiri > Kuzin > Subject: Re: [PATCH v4 1/2] ethdev: add new ext hdr for gtp psc >=20 > On Thu, Apr 08, 2021 at 12:37:27PM +0000, Raslan Darawsheh wrote: > > Hi Olivier, > > > > > -----Original Message----- > > > From: Olivier Matz > > > Sent: Thursday, April 8, 2021 3:30 PM > > > To: Raslan Darawsheh > > > Cc: dev@dpdk.org; ferruh.yigit@intel.com; Ori Kam ; > > > andrew.rybchenko@oktetlabs.ru; ivan.malov@oktetlabs.ru; > > > ying.a.wang@intel.com; Slava Ovsiienko ; Shir= i > > > Kuzin > > > Subject: Re: [PATCH v4 1/2] ethdev: add new ext hdr for gtp psc > > > > > > Hi Raslan, > > > > > > On Sun, Apr 04, 2021 at 10:45:51AM +0300, Raslan Darawsheh wrote: > > > > Define new rte header for gtp PDU session container > > > > based on RFC 38415-g30 > > > > > > Do you have a link to this RFC? > > Yes sure, > > > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fww > w.3gpp.org%2Fftp%2FSpecs%2Farchive%2F38_series%2F38.415%2F38415- > g30.zip&data=3D04%7C01%7Crasland%40nvidia.com%7C5279dde172024bc > d1f6b08d8fa981668%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C6 > 37534878435191995%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD > AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3D > LuD7%2FvJgqJbZ78ncaM7UrpiLNPUt7zbPPfSMemyb2Y8%3D&reserved > =3D0 > > > > > > > > > Signed-off-by: Raslan Darawsheh > > > > --- > > > > lib/librte_net/rte_gtp.h | 34 > ++++++++++++++++++++++++++++++++++ > > > > 1 file changed, 34 insertions(+) > > > > > > > > diff --git a/lib/librte_net/rte_gtp.h b/lib/librte_net/rte_gtp.h > > > > index 6a6f9b238d..088b0b5a53 100644 > > > > --- a/lib/librte_net/rte_gtp.h > > > > +++ b/lib/librte_net/rte_gtp.h > > > > @@ -61,6 +61,40 @@ struct rte_gtp_hdr_ext_word { > > > > uint8_t next_ext; /**< Next Extension Header Type. */ > > > > } __rte_packed; > > > > > > > > +/** > > > > + * Optional extension for GTP with next_ext set to 0x85 > > > > + * defined based on RFC 38415-g30. > > > > + */ > > > > +__extension__ > > > > +struct rte_gtp_psc_hdr { > > > > + uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes= */ > > > > + uint8_t type:4; /**< PDU type */ > > > > + uint8_t qmp:1; /**< Qos Monitoring Packet */ > > > > + union { > > > > + struct { > > > > + uint8_t snp:1; /**< Sequence number presence */ > > > > + uint8_t spare_dl1:2; /**< spare down link bits */ > > > > + }; > > > > + struct { > > > > + uint8_t dl_delay_ind:1; /**< dl delay result presence > > > */ > > > > + uint8_t ul_delay_ind:1; /**< ul delay result presence > > > */ > > > > + uint8_t snp_ul1:1; /**< Sequence number presence > > > ul */ > > > > + }; > > > > + }; > > > > + union { > > > > + struct { > > > > + uint8_t ppp:1; /**< Paging policy presence */ > > > > + uint8_t rqi:1; /**< Reflective Qos Indicator */ > > > > + }; > > > > + struct { > > > > + uint8_t n_delay_ind:1; /**< N3/N9 delay result > > > presence */ > > > > + uint8_t spare_ul2:1; /**< spare up link bits */ > > > > + }; > > > > + }; > > > > + uint8_t qfi:6; /**< Qos Flow Identifier */ > > > > + uint8_t data[0]; /**< data feilds */ > > > > +} __rte_packed; > > > > > > With this header, sizeof(rte_gtp_psc_hdr) =3D 5, is it really expecte= d? > > The data[0] is variable length data, I guess I should send another vers= ion to > mention that in the comment maybe. > > The header size according to the spec should be 4 octets aligned in gen= eral. >=20 > What I wanted to highlight is that using union of structs containing > bitfields does not work as you expect: each union is at least 1 byte. > This results in a structure that does not match the expected header. I see thanks for explaining. >=20 > > > > > > It would help to see the specification to have a better idea of how t= o > > Sure, I've just posted the link above, please let me know of any sugges= tion > that you have, and I'll be glad to do accordingly. > > > > > split, but a possible solution is to do something like this: > > > > > > struct rte_gtp_psc_generic_hdr { > > > uint8_t ext_hdr_len; > > > uint8_t type:4 > > > uint8_t qmp:1; > > > uint8_t pad:3; > > > }; > > > > > > struct rte_gtp_psc__hdr { > > > uint8_t ext_hdr_len; > > > uint8_t type:4 > > > uint8_t qmp:1; > > > uint8_t uint8_t snp:1; > > > uint8_t spare_dl1:2; > > > ... > > > }; > > > > > > ... > > > > > > struct rte_gtp_psc_hdr { > > > union { > > > struct rte_gtp_psc_generic_hdr generic; > > > struct rte_gtp_psc__hdr ; > > > struct rte_gtp_psc__hdr ; > > > }; > > > }; >=20 > From what I see in the documation, I think this approach should > work. From afar, I suggest: >=20 > struct rte_gtp_psc_generic_hdr { > #if big endian > uint8_t type:4 > uint8_t qmp:1; > uint8_t pad:3; > #else > uint8_t pad:3; > uint8_t qmp:1; > uint8_t type:4 > #endif > }; >=20 > struct rte_gtp_psc_type0_hdr { > #if big endian > uint8_t type:4 > uint8_t qmp:1; > uint8_t snp:1; > uint8_t spare:2; >=20 > uint8_t ppp:1; > ... > #else > uint8_t pad:3; > uint8_t qmp:1; > uint8_t type:4 > uint8_t spare:2; > uint8_t snp:1; >=20 > ... > #endif > uint8_t data[0]; /* for variable fields */ > }; >=20 > struct rte_gtp_psc_type1_hdr { > ... same for fixed fields of type1 >=20 >=20 > uint8_t data[0]; /* for variable fields */ > }; >=20 Sure, will consider and do it this way in the next version. > I don't see in the spec where is the reference to ext_hdr_len. >=20 The ext_hdr_len is part of the definition for all ext_hdrs see this link fo= r more details: https://en.wikipedia.org/wiki/GPRS_Tunnelling_Protocol So, it's not mentioned in the doc. > Regards, > Olivier