DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: Xueming Li <xuemingl@mellanox.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [RFC PATCH 0/2] using scapy to generate packet templates
Date: Thu, 19 Oct 2017 15:21:47 +0000	[thread overview]
Message-ID: <E923DB57A917B54B9182A2E928D00FA650FC8D5F@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <20171019140649.26668-1-xuemingl@mellanox.com>

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xueming Li
> Sent: Thursday, October 19, 2017 3:07 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: Xueming Li <xuemingl@mellanox.com>; dev@dpdk.org
> Subject: [dpdk-dev] [RFC PATCH 0/2] using scapy to generate packet templates

Hi,

First off - cool to make DPDK more dynamic with Scapy, and I see value in
"somehow" enabling DPDK with Scapy.

> 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.


Testpmd is a good use-case, but perhaps we're limiting the scope of DPDK/Scapy
if we only integrate with Testpmd. What if I wanted to easily generate some traffic from a sample app?

As a suggestion, what about building a library that provides Scapy functionality,
allowing any application to easily generate mbufs using the rte_scapy* functions:

/* demo usage */
rte_scapy *scapy = rte_scapy_init();
rte_mbuf *m = rte_scapy_mbuf_from_str(scapy, "Ether()/IP()/UDP()");


Testpmd could then use the rte_scapy library, passing in any parameters
after   testpmd> scapy   command as a string?

Had you already considered this library type design?


> 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.

Not a strong opinion, but a gut feeling;
I see more value in generating packets with Python and using them from C
than giving Python full access to DPDK internals and hugepages.

Regards, -Harry


> 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

  parent reply	other threads:[~2017-10-19 15:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 14:06 Xueming Li
2017-10-19 14:06 ` [dpdk-dev] [RFC PATCH 1/2] app/testpmd: add packet template Xueming Li
2017-12-05  4:43   ` [dpdk-dev] [RFC v1 00/11] scapy/python extension Xueming Li
2017-12-05  4:45   ` Xueming Li
2017-12-05  4:48   ` Xueming Li
2017-12-05  4:55   ` Xueming Li
2017-12-05  6:14     ` Xueming(Steven) Li
2017-12-05  5:00   ` Xueming Li
2017-12-05  5:03   ` [dpdk-dev] [RFC v1 00/11] scappy/pythoon extension Xueming Li
2017-12-05  5:04   ` [dpdk-dev] [RFC v1 00/11] scapy/python extension Xueming Li
2017-12-10 23:16     ` Wiles, Keith
2019-01-10 13:06     ` Eelco Chaudron
2019-01-16 13:24       ` Xueming(Steven) Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 0/9] " Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 1/9] lib/cmdline: add echo support in batch loading from file Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 2/9] app/testpmd: support command echo in CLI batch loading Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 3/9] test: update batch loading test Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 4/9] lib/python: add embedded python lib Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 5/9] app/testpmd: add python command Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 6/9] app/testpmd: add pktgen forwarding engine Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 7/9] app/testpmd: add pktgen engine scapy commands Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 8/9] test/expect: add expect test scripts Xueming Li
2017-12-08  8:22   ` [dpdk-dev] [RFC v1 9/9] doc/scapy: add scapy how-to guide Xueming Li
2017-10-19 14:06 ` [dpdk-dev] [RFC PATCH 2/2] app/testpmd: add scapy command as pkt template Xueming Li
2017-10-19 15:21 ` Van Haaren, Harry [this message]
2017-10-21 16:04   ` [dpdk-dev] [RFC PATCH 0/2] using scapy to generate packet templates Xueming(Steven) Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E923DB57A917B54B9182A2E928D00FA650FC8D5F@IRSMSX102.ger.corp.intel.com \
    --to=harry.van.haaren@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=xuemingl@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).