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 8EB74A0579; Thu, 8 Apr 2021 14:30:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B9CD40698; Thu, 8 Apr 2021 14:30:00 +0200 (CEST) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mails.dpdk.org (Postfix) with ESMTP id 71BCA40138 for ; Thu, 8 Apr 2021 14:29:58 +0200 (CEST) Received: by mail-wr1-f54.google.com with SMTP id e12so1932530wro.11 for ; Thu, 08 Apr 2021 05:29:58 -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=n5uSragDP5EtpqMMnDjCjgrASj/MAibQvBmnLXU+UUk=; b=YlQhIEOAr5z/I+yDT83/eTfI2Vq5dFBuk6iII8w7fh0U2UJwM+O4+A6jCsYe3UnDVg gg6cM63v/oC2M/EzRK1RZDSXmGxxk8nE4LHPi5AOSR3QvmWFGEp1Vnc3RMKOiZDjrW06 w6neEwdAsr/QPS6dZB0TxECXMkhiHzXrKK1cE73xpb/37Cxbdzu6POYoUa+26tHrHg+B PdXKwBGYPJ3HduTOhFmA2LqxriyPWpQYeTTCpPX9o0oQQS0TXufZ9pBHt0aZNACXY30B 64iBmMHYdm23yp3GcWwToQJ3+OPVOG/wReAMxccnZR4R/asNRoBfOIqCyMnNi4Dv2OKG 8wCQ== 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=n5uSragDP5EtpqMMnDjCjgrASj/MAibQvBmnLXU+UUk=; b=RDQ7ey8ogn0h0xPlLjD2oI23Y1fRYXvgUoT5hACf3elnWLdZ6WbUQDsZktHmh7b7ry JXrzaXUJbCV2mtlHL6I2ICtz5p4b1O3sKVrJu+P75IdPiboor5IJF2MbH44Ah1xdXI/F EqCzB76OBXKXuqWwxqdrm8/WSZHBU9BAY5qBoL2X63QuCykDRP9yV/iVqWSMCTMfBi6q 5vDURgpXLlPhByd4PVlAdf/A3VfAYsK4lDv/K03KKyM4iy4uReJVTxJVcxKlMhdtsSti jW3Gp3oB12lLO3pYzQ5XfQT1aKO0eIAyFa8Q/RRmS/czZHP6Wjuj+wL2Zy7p+3hmZpxD 5zCQ== X-Gm-Message-State: AOAM531okRTPPy9osJutXa3YsDWZmJr3TWePUMSp5OM9sWI9hmbSXPKE eH5epLfryhIwNqX6bXc9VppKTA== X-Google-Smtp-Source: ABdhPJxA73Hy/jaR+ONfMr+xOkH7NLdzufMpMTmGXMWH6peDhGtChWv5RH7D3WEjgOGZqGm1vElmAg== X-Received: by 2002:a5d:6cc3:: with SMTP id c3mr10617074wrc.179.1617884998153; Thu, 08 Apr 2021 05:29:58 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id p17sm11101294wmq.47.2021.04.08.05.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 05:29:57 -0700 (PDT) Date: Thu, 8 Apr 2021 14:29:56 +0200 From: Olivier Matz To: Raslan Darawsheh Cc: dev@dpdk.org, ferruh.yigit@intel.com, orika@nvidia.com, andrew.rybchenko@oktetlabs.ru, ivan.malov@oktetlabs.ru, ying.a.wang@intel.com, viacheslavo@nvidia.com, shirik@nvidia.com Message-ID: <20210408122956.GX1650@platinum> References: <20210330075036.6579-2-rasland@nvidia.com> <20210404074552.24190-1-rasland@nvidia.com> <20210404074552.24190-2-rasland@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210404074552.24190-2-rasland@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 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? > 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) = 5, is it really expected? It would help to see the specification to have a better idea of how to 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 ; }; }; Also, you need to take care about endianness. Regards, Olivier