From patchwork Tue Jul 4 06:47:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ke Xu X-Patchwork-Id: 129236 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 1393A42DCD; Tue, 4 Jul 2023 08:47:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F2634113F; Tue, 4 Jul 2023 08:47:33 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 8B3D440E03 for ; Tue, 4 Jul 2023 08:47:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688453252; x=1719989252; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7ozA6mjoKY7z2e9YPiA6EtrF+voRkI8A9aEA9bzYYts=; b=c2cpUVhmNCs+tS9orWwHq/0/66lBjAQ6z5fhGWv+Sjwe4REhGNdS3RSQ gdxTIxGHE9lh+u5aPNnCEp/L4DJHLnVcMJPK6wWBeoJPdsHqy8OUxQ0ob GvnxBfFmt556E3+V4NuP25E+9Ktjw6YPnu7sPHrthPBM9MJ4OtGn+6zZN 7A3d9xj4yFW71eBftwHADaGYjvfOrnZAFV50cSDENPdYhiaVsS2M3yKn2 MBG39PYjiaNCFsrUE13VyI8E8lBO06DDo7uf4xqcrjD5V0OslGhtFSogP 1tEVm5cE/Dl+zc6PBy0WtOv8H5HMv4ZXqm7zPTggS5vgQ1cd2oSth1r42 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10760"; a="393791580" X-IronPort-AV: E=Sophos;i="6.01,179,1684825200"; d="scan'208";a="393791580" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2023 23:47:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10760"; a="721995407" X-IronPort-AV: E=Sophos;i="6.01,179,1684825200"; d="scan'208";a="721995407" Received: from dpdk-xuke-host.sh.intel.com ([10.67.114.220]) by fmsmga007.fm.intel.com with ESMTP; 03 Jul 2023 23:47:28 -0700 From: Ke Xu To: dts@dpdk.org Cc: ke1.xu@intel.com, lijuan.tu@intel.com, zhiminx.huang@intel.com Subject: [V1][DTS 1/2] framework/packet: Add GTPU and GENEVE support for packet module. Date: Tue, 4 Jul 2023 06:47:25 +0000 Message-Id: <20230704064726.455361-2-ke1.xu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230704064726.455361-1-ke1.xu@intel.com> References: <20230704064726.455361-1-ke1.xu@intel.com> MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Implemented GTPU and GENEVE layer in packet module. Packet module only supports limited tunneling layers like VxLAN, GRE. New packet types are required in recent DPDK releases and GTPU and GENEVE are required to be added. Signed-off-by: Ke Xu --- framework/packet.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/framework/packet.py b/framework/packet.py index 2c16e7cb..c44c955f 100644 --- a/framework/packet.py +++ b/framework/packet.py @@ -17,6 +17,8 @@ import time from importlib import import_module from socket import AF_INET6 +from scapy.contrib.geneve import GENEVE +from scapy.contrib.gtp import GTP_U_Header, GTPPDUSessionContainer from scapy.contrib.lldp import LLDPDU, LLDPDUManagementAddress from scapy.contrib.mpls import MPLS from scapy.contrib.nsh import NSH @@ -51,6 +53,7 @@ scapy_modules_required = { "GTPEchoRequest", "GTPEchoResponse", ], + "scapy.contrib.geneve": ["GENEVE"], "scapy.contrib.lldp": ["LLDPDU", "LLDPDUManagementAddress"], "scapy.contrib.pfcp": ["PFCP"], "scapy.contrib.nsh": ["NSH"], @@ -90,7 +93,7 @@ LayersTypes = { # <'ether type'=0x0800 'version'=4, 'protocol'=17 'destination port'=4789> # or # <'ether type'=0x86DD 'version'=6, 'next header'=17 'destination port'=4789> - "TUNNEL": ["ip", "gre", "vxlan", "nvgre", "geneve", "grenat"], + "TUNNEL": ["ip", "gre", "vxlan", "nvgre", "gtpu", "geneve", "grenat"], "INNER L2": ["inner_mac", "inner_vlan"], # inner_ipv4_unknown, inner_ipv6_unknown "INNER L3": ["inner_ipv4", "inner_ipv4_ext", "inner_ipv6", "inner_ipv6_ext"], @@ -167,7 +170,8 @@ class scapy(object): "ipv6_in_ip": IP() / IPv6(src="::1"), "ipv6_frag_in_ip": IP() / IPv6(src="::1", nh=44) / IPv6ExtHdrFragment(), "nvgre": GRE(key_present=1, proto=0x6558, key=0x00000100), - "geneve": "Not Implement", + "gtpu": GTP_U_Header(gtp_type=255, teid=0x123456), + "geneve": GENEVE(), } def __init__(self):