From patchwork Wed Jul 12 19:31:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ke Xu X-Patchwork-Id: 129508 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 578F942E58; Wed, 12 Jul 2023 21:33:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0456741138; Wed, 12 Jul 2023 21:33:21 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 2B7F1400D5 for ; Wed, 12 Jul 2023 21:33:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689190400; x=1720726400; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I5p6Wo0nRu313PX/tKxlQNLQHwfepKXW8HDya3RqKJc=; b=mCN2jv2nWqo0MCqRxcqf/hvSNCI/Qh9H5L5fbWJz87VK87yqWDPDfNwG H7zKyfijws6S5Xtmy7Bst1+/Kc/K4h1/DOiNQI80+hLwiS6IYFAxKQIpA XdsjI3ctq7u4c3PbrPt3aTU7u9yaVoTBFGcTD2Heppnm1oK0g01GJo9sx pLlc5Yj9pWtvkeoWANv/iYWLFB5FE9P15AANDAQU2KobRHjVp9tk+VnMY 3dXGi5M9pLGLkxqlvIGRU8ETlCSnUNLL5V+j8EclPLKOqSof7IbaRGKcN tU7cowSgfXtMo+Ad6PJOdb8r4snL4PEWsvZhzWk7PkKLZTuKsiWAxSZ8q w==; X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="428728886" X-IronPort-AV: E=Sophos;i="6.01,200,1684825200"; d="scan'208";a="428728886" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 12:33:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10769"; a="791740096" X-IronPort-AV: E=Sophos;i="6.01,200,1684825200"; d="scan'208";a="791740096" Received: from dpdk-xuke-host.sh.intel.com ([10.67.114.220]) by fmsmga004.fm.intel.com with ESMTP; 12 Jul 2023 12:33:18 -0700 From: Ke Xu To: dts@dpdk.org Cc: ke1.xu@intel.com, tarcadia@qq.com Subject: [DTS][Patch V1 1/4] framework/packet: Add GTPU and GENEVE support for packet module. Date: Wed, 12 Jul 2023 19:31:23 +0000 Message-Id: <20230712193126.1994361-2-ke1.xu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230712193126.1994361-1-ke1.xu@intel.com> References: <20230712193126.1994361-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 Partially implemented GTPU and GENEVE layer in packet. Allowing limited usage of GTPU and GENEVE packets. 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):