From patchwork Thu Jun 17 09:17:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raslan Darawsheh X-Patchwork-Id: 94318 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A1F4CA0C4C; Thu, 17 Jun 2021 11:17:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 889A74067A; Thu, 17 Jun 2021 11:17:45 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2061.outbound.protection.outlook.com [40.107.92.61]) by mails.dpdk.org (Postfix) with ESMTP id 9883240150 for ; Thu, 17 Jun 2021 11:17:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mDq6LluOFj52YNX8vk4IbgYfBgo72p3u+10kKmerWi7NWn6Rz5aoGLAxrK1MdzmtOvHZc6G6c6GB0dfYobj+3q3GU1kGt+7GxQNJyjilmxQbW3TY6vbtXxV3wNM4+1sjPNTrmhZGj/Yk9Tlqm/dy5L4Uf0u1LDBXU/RncT0vUCM/AMYffN0UwNZycBi3oLN9ohoxS3w9MxvZWHzkWCQYZIbDjWAQfV8btpgiB9Uz75Tv4oEn9iE7o0Ks6iGJ5YNjcw2jF9ooVcbxGcTLdpN2l6ZQY0oEvfpYRcr6qYtlkBuuVDQdU9H2nvx+eEoqi+CJesfqrNhl83U+NkQ5jgHjzA== 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=1mAiWudaWdeKo6mxMuW9uPysbdcCR3htTZy7fWLADFA=; b=IMBWBzmmQwmARUGPX/FONtp3zyrxqmDMpU5KGw7Z4lCpe3coAgjR12JtccQAlI/4yn4cVDQJyRTd6mqVCpGDZYibj/FaH+H6mcrfedD0JioGSBSZ7dCvRIwtNyVuM4iASkZQy7RwHsT8C+mMoMds090+kMo9pN7sQUezVpQg6StdZVR9tymaV9jRX6C8STlCU1e5PY9I4QBN4Pn0ZMZgaGZYlzBMtFcHMlh2kjDf6Dg3A/KrQy6LmKfJCnIMKBQI1asOvaVSDRL95G0MaleguRYFvpcZ9R4VKASLMEb6TslD+I9Gqr6ZBxnKGQ50uv24KxjF1LrBgCIW6MOW9+Kecg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=oktetlabs.ru smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=1mAiWudaWdeKo6mxMuW9uPysbdcCR3htTZy7fWLADFA=; b=PMiWgXUVr+AldTHrjniSb5ES09Ikzw7fspS68gY463LKpqJKnJfO88UoRdMx6KlI0YUIymAr99K+GnLGO6o4GKpigVhH5JAN4ovYQhF2sL8BR0NsdX96U1OrWd4EINgsud1aRqrI+CFS6CQPCTOZPxrCWcPZ7nySBOkZoupuicgMUrfCXSGW/kwWGUUrDnY822iRjy/oaUFk6cqEqofxOpP8Qa9h2lRraBYvl4SAUnThpb6ik4AW9ubXa0gydpfekA+esnQCRUk/WJEBFrcY5t4Z/boMOt3peMqwKzd5urJ6EYAeSSuWZDgITLmfgqhA2e2ksyyIZIXxcyJfVph17w== Received: from BN6PR19CA0118.namprd19.prod.outlook.com (2603:10b6:404:a0::32) by CH2PR12MB3797.namprd12.prod.outlook.com (2603:10b6:610:27::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Thu, 17 Jun 2021 09:17:41 +0000 Received: from BN8NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:404:a0:cafe::9b) by BN6PR19CA0118.outlook.office365.com (2603:10b6:404:a0::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Thu, 17 Jun 2021 09:17:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT055.mail.protection.outlook.com (10.13.177.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4242.16 via Frontend Transport; Thu, 17 Jun 2021 09:17:40 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 17 Jun 2021 09:17:37 +0000 From: Raslan Darawsheh To: CC: , , , , , , , Date: Thu, 17 Jun 2021 12:17:16 +0300 Message-ID: <20210617091716.2354978-1-rasland@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bc0262ac-84e5-4c27-3ac9-08d93170c189 X-MS-TrafficTypeDiagnostic: CH2PR12MB3797: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1013; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tk3d9qd8dGQitfqDqQyPwZhCJzUIpDvKWmvxRLjj3nsgoCSfhpCUOnnDMsyxJzpsUe3VdVJcPaU/rGqaL8LKGBmuoosjOARwj83/fOXOgau9JmTbSSb3MgIPyM6vj+P+rHUoENsYHJEIqDUiF+9B7Eus+skVlRwa8feYxD0hzSu7KDTr3s85rCABloUz3primbWr0gLKo85PrGoA9drsO3FQ75KHKP/Bucq1u3Y3iTf2DIsqPHru0pp7qn5Dd9iL+GpYO22nwGQL6tdftHhwOpMfM048HBoh7zABMGnmaEDOpgtkU4yjlnRNJKCVDNIGV4zsy4SYF4b/0UjCXmCPfY+shfpGchSJb9KKoUjf7k6xG15+9vWVAS3WlU31cDUZLzhkuvW2eFzABie89ow0z+lWjgRgHYU7wXwdSIZEA/DVZfYElMwMvE4WDd4UGqM79KViNwk0KFJ+5xZhHMPwvoN8SHSUEcn1p91JMNo/gyLLFImBp34xMAhbS0dKka3wkXs0MEruoYiBMO2OUm5gYGLLUyme8HlnXyh2nASNY77O5vwzLTUYahgnjCxazoHwaXAyki7GeR5zgTCXL/A2u3CFsUergcUhfk0r1xyZwWtr897EAPWj3WgypMlbHb6ajN8OTngfnIRsbRf+V+e6e0IMokN+iRYY60uNZoYTyDg= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(136003)(396003)(39850400004)(346002)(376002)(36840700001)(46966006)(186003)(4326008)(2616005)(70586007)(316002)(82310400003)(426003)(55016002)(83380400001)(336012)(70206006)(8936002)(6916009)(36860700001)(6666004)(36906005)(16526019)(82740400003)(356005)(36756003)(107886003)(6286002)(5660300002)(7636003)(54906003)(7696005)(2906002)(86362001)(478600001)(8676002)(26005)(1076003)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2021 09:17:40.1001 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc0262ac-84e5-4c27-3ac9-08d93170c189 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3797 Subject: [dpdk-dev] [PATCH v6] 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" Define new rte header for gtp PDU session container based on RFC 38415-g30 Signed-off-by: Raslan Darawsheh Reviewed-by: Andrew Rybchenko --- v6 : fixed typos fixed indentation of comments for fields --- lib/net/rte_gtp.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/lib/net/rte_gtp.h b/lib/net/rte_gtp.h index 6a6f9b238d..9f6deb9c7e 100644 --- a/lib/net/rte_gtp.h +++ b/lib/net/rte_gtp.h @@ -61,6 +61,84 @@ 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_generic_hdr { + uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes */ +#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + uint8_t pad:3; /**< type specific pad bits */ + uint8_t spare:2; /**< type specific spare bits */ + uint8_t qfi:6; /**< Qos Flow Identifier */ +#else + uint8_t qfi:6; /**< Qos Flow Identifier */ + uint8_t spare:2; /**< type specific spare bits */ + uint8_t pad:3; /**< type specific pad bits */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + uint8_t type:4; /**< PDU type */ +#endif + uint8_t data[0]; /**< variable length data fields */ +} __rte_packed; + +/** + * Optional extension for GTP with next_ext set to 0x85 + * type0 defined based on RFC 38415-g30 + */ +__extension__ +struct rte_gtp_psc_type0_hdr { + uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes */ +#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + uint8_t snp:1; /**< Sequence number presence */ + uint8_t spare_dl1:2; /**< spare down link bits */ + uint8_t ppp:1; /**< Paging policy presence */ + uint8_t rqi:1; /**< Reflective Qos Indicator */ + uint8_t qfi:6; /**< Qos Flow Identifier */ +#else + uint8_t qfi:6; /**< Qos Flow Identifier */ + uint8_t rqi:1; /**< Reflective Qos Indicator */ + uint8_t ppp:1; /**< Paging policy presence */ + uint8_t spare_dl1:2; /**< spare down link bits */ + uint8_t snp:1; /**< Sequence number presence */ + uint8_t type:4; /**< PDU type */ +#endif + uint8_t data[0]; /**< variable length data fields */ +} __rte_packed; + +/** + * Optional extension for GTP with next_ext set to 0x85 + * type1 defined based on RFC 38415-g30 + */ +__extension__ +struct rte_gtp_psc_type1_hdr { + uint8_t ext_hdr_len; /**< PDU ext hdr len in multiples of 4 bytes */ +#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint8_t type:4; /**< PDU type */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + uint8_t dl_delay_ind:1; /**< dl delay result presence */ + uint8_t ul_delay_ind:1; /**< ul delay result presence */ + uint8_t snp:1; /**< Sequence number presence ul */ + 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 */ +#else + uint8_t qfi:6; /**< Qos Flow Identifier */ + uint8_t spare_ul2:1; /**< spare up link bits */ + uint8_t n_delay_ind:1; /**< N3/N9 delay result presence */ + uint8_t snp:1; /**< Sequence number presence ul */ + uint8_t ul_delay_ind:1; /**< ul delay result presence */ + uint8_t dl_delay_ind:1; /**< dl delay result presence */ + uint8_t qmp:1; /**< Qos Monitoring Packet */ + uint8_t type:4; /**< PDU type */ +#endif + uint8_t data[0]; /**< variable length data fields */ +} __rte_packed; + /** GTP header length */ #define RTE_ETHER_GTP_HLEN \ (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))