From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id ED7211B20A for ; Thu, 19 Oct 2017 16:07:17 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@mellanox.com) with ESMTPS (AES256-SHA encrypted); 19 Oct 2017 16:07:14 +0200 Received: from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx [10.12.205.180]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v9JE7DaS010438; Thu, 19 Oct 2017 17:07:13 +0300 Received: from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1]) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id v9JE7AhN026718; Thu, 19 Oct 2017 22:07:10 +0800 Received: (from xuemingl@localhost) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id v9JE73T5026715; Thu, 19 Oct 2017 22:07:03 +0800 From: Xueming Li To: Jingjing Wu Cc: Xueming Li , dev@dpdk.org Date: Thu, 19 Oct 2017 22:06:47 +0800 Message-Id: <20171019140649.26668-1-xuemingl@mellanox.com> X-Mailer: git-send-email 2.13.3 Subject: [dpdk-dev] [RFC PATCH 0/2] using scapy to generate packet templates X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 14:07:18 -0000 The target is to make testpmd flexible to generate all kinds of packet in just one line. Examples: # send UDP packet to port 0 queue 0 testpmd> scapy 0 Ether()/IP()/UDP()/"hello_world" # send 4 L3 VXLAN packets with inner UDP dport 1-4 to port 1 queue 1-4, one packet per queue testpmd> scapy 1 Ether()/IP()/UDP()/VXLAN()/IPv6()/UDP(dport=(1,4))/"cool" # Random testpmd> scapy 2 Ether(src=RandMAC())/IP(dst=RandIP())/TCP(sport=RandShort(),dport=0x1234) This patch introduce scapy - a python tool to generate static packet templates. Txonly forwarding mode is modified to support template if available. Two new configuration: CONFIG_RTE_TEST_PMD_SCAPY=y CONFIG_RTE_PYTHON=python2.7 Scapy quick demo: http://www.secdev.org/projects/scapy/demo.html There are 2 other potential solution to support more fancy sending in the future: 1. Invoke scapy and expose mbuf hugepage pointers to python This should allow more flexible and dynamic processing 2. Scapy uses wrapped DPDK port as regular port Make scapy capable to send high speed streams. Xueming Li (2): app/testpmd: add packet template app/testpmd: add scapy command as pkt template app/test-pmd/Makefile | 5 +++ app/test-pmd/cmdline.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++++- app/test-pmd/testpmd.c | 3 ++ app/test-pmd/testpmd.h | 1 + app/test-pmd/txonly.c | 42 +++++++++++++-------- config/common_base | 2 + 6 files changed, 135 insertions(+), 17 deletions(-) -- 2.13.3