Hi, Pim We have a readme file in the patch, and I attached it here.
BTW, the corresponding patch for generic flow is https://gerrit.fd.io/r/c/vpp/+/34802 Best Regards, Xu Ting From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of Pim van Pelt Sent: Monday, July 25, 2022 9:09 AM To: vpp-dev@lists.fd.io Cc: Damjan Marion <dmar...@me.com> Subject: Re: [vpp-dev] Gerrit review request for packetforge - 36149 Hi Xu, Do you have documentation (notably: a userguide) for this tool? The readme is sparse and it seems like "read the code" is a bit much to ask :) groet, Pim On Sun, Jul 24, 2022 at 6:04 PM Xu, Ting <ting...@intel.com<mailto:ting...@intel.com>> wrote: Hi, I have submitted a patch for packetforge weeks ago (https://gerrit.fd.io/r/c/vpp/+/36149). It is a tool to create flow rules using generic flow, which was upstreamed in the last release. Packetforge can provide a user-friendly interface to add/enable flow rules to use NIC’s hardware flow offloading function. According to Damjan’s comment, we put packetforge in ./extras, and in this v1 patch, we created a python script as a interface, to support add and enable function. We will refine it and add more functions in the future. The detailed description and usage can be found in commit log and README in the patch. Please have a look at my patch and give some comments, thanks! Best Regards, Xu Ting -- Pim van Pelt <p...@ipng.nl<mailto:p...@ipng.nl>> PBVP1-RIPE - http://www.ipng.nl/
.. _packetforge_doc: Packetforge for generic flow ============================ Packetforge is a tool to support generic flow. Since the input format of generic flow is hard to read and create, packetforge can help to create generic flow rules using a format of naming protocols (like Scapy) or json profile. Packetforge is built based on a parsegraph, users can modify the graph nodes and edges if needed. Command examples ---------------- :: $ python flow_create.py -p "mac()/ipv4(src=1.1.1.1,dst=2.2.2.2)/udp()" -a "redirect-to-queue 3" Naming format input. It needs two parameters. Pattern format is similar to Scapy protocols. Actions format is the same as vnet/flow command. This command will add and enable flow rules to interface 1. :: $ python flow_create.py -f "./flow_rule_examples/mac_ipv4.json" Json profile format input. This command takes a json profile as parameter. In the json profile, there will be protocols and their fields and values. Users can define spec and mask for each field. Actions can be added in the profile directly, otherwise "-a" option should be added in the command. The example can be found in flow_rule_examples folder. :: $ show flow entry It is a vnet/flow command, used in VPP CLI. It can show the added flow rules after using the above commands. In addition, if users want to delete or disable the rules, vnet/flow commands "test flow del" and "test flow disable" are valid. ParseGraph ---------- Packetforge is built based on a ParseGraph. The ParseGraph is constructed with nodes and edges. Nodes are protocols, including information about protocol's name, fields and default values. Edges are the relationship between two protocols, including some actions needed when connecting two protocols. For example, change the mac header ethertype to 0x0800 when connecting mac and ipv4. More details are in the spec in parsegraph folder. Users can build the ParseGraph following the spec by themselves, like adding a new protocol. If NIC supports the new protocol, the rule can be created. Otherwise, it will return error.
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#21719): https://lists.fd.io/g/vpp-dev/message/21719 Mute This Topic: https://lists.fd.io/mt/92596268/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-