From: <psatheesh@marvell.com>
To: Ori Kam <orika@nvidia.com>, Wenzhuo Lu <wenzhuo.lu@intel.com>,
Beilei Xing <beilei.xing@intel.com>,
Bernard Iremonger <bernard.iremonger@intel.com>
Cc: <dev@dpdk.org>, Satheesh Paul <psatheesh@marvell.com>
Subject: [dpdk-dev] [PATCH] app/testpmd: add PF and VF targets to flow action type sample
Date: Mon, 21 Dec 2020 11:16:36 +0530 [thread overview]
Message-ID: <20201221054636.4574-1-psatheesh@marvell.com> (raw)
From: Satheesh Paul <psatheesh@marvell.com>
Add support to specify PF or VF as targets in "set sample_actions"
command.
Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
---
The changes add support for below usecases.
1. Sample mirror to PF
testpmd>set sample_actions 0 / pf / end
#pkts to VF id 2 will be mirrored to the PF
testpmd>flow create 0 ingress pattern eth / end actions sample ratio 1 \
index 0 / vf id 2 / end
2. Sample mirror to VF
testpmd>set sample_actions 1 / vf id 1 / end
#pkts to VF id 2 will be mirrored to VF id 1
testpmd>flow create 0 ingress pattern eth / end actions sample ratio 1 \
index 1 / vf id 2 / end
app/test-pmd/cmdline_flow.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 585cab98b..12f2b1664 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -560,6 +560,7 @@ struct rte_flow_action_queue sample_queue[RAW_SAMPLE_CONFS_MAX_NUM];
struct rte_flow_action_count sample_count[RAW_SAMPLE_CONFS_MAX_NUM];
struct rte_flow_action_port_id sample_port_id[RAW_SAMPLE_CONFS_MAX_NUM];
struct rte_flow_action_raw_encap sample_encap[RAW_SAMPLE_CONFS_MAX_NUM];
+struct rte_flow_action_vf sample_vf[RAW_SAMPLE_CONFS_MAX_NUM];
/** Maximum number of subsequent tokens and arguments on the stack. */
#define CTX_STACK_SIZE 16
@@ -7558,6 +7559,14 @@ cmd_set_raw_parsed_sample(const struct buffer *in)
(const void *)action->conf, size);
action->conf = &sample_port_id[idx];
break;
+ case RTE_FLOW_ACTION_TYPE_PF:
+ break;
+ case RTE_FLOW_ACTION_TYPE_VF:
+ size = sizeof(struct rte_flow_action_vf);
+ rte_memcpy(&sample_vf[idx],
+ (const void *)action->conf, size);
+ action->conf = &sample_vf[idx];
+ break;
default:
printf("Error - Not supported action\n");
return;
--
2.25.4
next reply other threads:[~2020-12-21 5:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-21 5:46 psatheesh [this message]
2021-01-27 16:47 ` Ferruh Yigit
2021-01-31 8:53 ` Ori Kam
2021-02-02 9:14 ` 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=20201221054636.4574-1-psatheesh@marvell.com \
--to=psatheesh@marvell.com \
--cc=beilei.xing@intel.com \
--cc=bernard.iremonger@intel.com \
--cc=dev@dpdk.org \
--cc=orika@nvidia.com \
--cc=wenzhuo.lu@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).