DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jiawei Wang <jiaweiw@nvidia.com>
To: viacheslavo@nvidia.com, xiaoyun.li@intel.com,
	ferruh.yigit@intel.com, thomas@monjalon.net
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2] doc: add sampling and mirroring in testpmd guide
Date: Wed, 31 Mar 2021 11:51:09 +0300	[thread overview]
Message-ID: <1617180669-225007-1-git-send-email-jiaweiw@nvidia.com> (raw)
In-Reply-To: <1615295935-11197-1-git-send-email-jiaweiw@nvidia.com>

Update documentation for sample action usage in testpmd and
show the command line example.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
v2:
* Update the description.
---
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 63 +++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f59eb8a..6606433 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -2003,6 +2003,24 @@ Set fec mode for a specific port::
 
   testpmd> set port (port_id) fec_mode auto|off|rs|baser
 
+Config Sample actions list
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Configure the sample actions list to be used when sampling a packet by
+rte_flow_action_sample::
+
+ set sample_actions {index} {action} [/ {action} [...]] / end
+
+There are multiple global buffers for ``sample_actions``, this command will set
+one internal buffer index by ``{index}``.
+
+In order to use different sample actions list, ``index`` must be specified
+during the flow rule creation::
+
+ testpmd> flow create 0 ingress pattern eth / ipv4 / end actions
+        sample ratio 2 index 2 / end
+
+Otherwise the default index ``0`` is used.
 
 Port Functions
 --------------
@@ -4841,6 +4859,51 @@ if seid is set)::
  testpmd> flow create 0 ingress pattern eth / ipv6 / pfcp s_field is 1
         seid is 1 / end actions queue index 3 / end
 
+Sample Sampling/Mirroring rules
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sample/Mirroring rules can be set by the following commands
+
+NIC-RX Sampling rule, the matched ingress packets and sent to the queue 1,
+also each second packets are duplicated and marked with 0x1234 and sent to
+queue 0.
+
+::
+
+ testpmd> set sample_actions 0 mark id  0x1234 / queue index 0 / end
+ testpmd> flow create 0 ingress group 1 pattern eth / end actions
+        sample ratio 2 index 0 / queue index 1 / end
+
+Sampling rule with port representors (with "transfer" attribute), the matched
+ingress packets are sent to port id 2, also each second packets are sent to
+PF port.
+
+::
+
+ testpmd> set sample_actions 0 / end
+ testpmd> flow create 0 ingress transfer pattern eth / end actions
+        sample ratio 2 index 0 / port_id id 2 / end
+
+Mirroring rule with port representors (with "transfer" attribute), the matched
+ingress packets with encapsulation header are sent to port id 0, and also
+mirrored the packets and sent to port id 2.
+
+::
+
+ testpmd> set sample_actions 0 port_id id 2 / end
+ testpmd> flow create 1 ingress transfer pattern eth / end actions
+        sample ratio 1 index 0  / raw_encap / port_id id 0 / end
+
+Mirroring rule with port representors (with "transfer" attribute), the matched
+ingress packets are sent to port id 2, and also mirrored the packets with
+encapsulation header and sent to port id 0.
+
+::
+
+ testpmd> set sample_actions 0 raw_encap / port_id id 0 / end
+ testpmd> flow create 0 ingress transfer pattern eth / end actions
+        sample ratio 1 index 0  / port_id id 2 / end
+
 BPF Functions
 --------------
 
-- 
1.8.3.1


  parent reply	other threads:[~2021-03-31  8:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 13:18 [dpdk-dev] [PATCH] " Jiawei Wang
2021-03-25 17:10 ` Ferruh Yigit
2021-03-25 17:15   ` Thomas Monjalon
2021-03-31  6:58     ` Jiawei(Jonny) Wang
2021-03-31  6:38   ` Jiawei(Jonny) Wang
2021-03-31  9:44     ` Ferruh Yigit
2021-03-31 14:38       ` Jiawei(Jonny) Wang
2021-03-31 15:26         ` Ferruh Yigit
2021-03-31  8:51 ` Jiawei Wang [this message]
2021-04-01  2:39 ` [dpdk-dev] [PATCH v3] " Jiawei Wang
2021-04-01 11:52   ` Ferruh Yigit

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=1617180669-225007-1-git-send-email-jiaweiw@nvidia.com \
    --to=jiaweiw@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    --cc=xiaoyun.li@intel.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).