app/testpmd: add PF and VF targets to sample flow action
authorSatheesh Paul <psatheesh@marvell.com>
Mon, 21 Dec 2020 05:46:36 +0000 (11:16 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 2 Feb 2021 23:48:11 +0000 (00:48 +0100)
Add support to specify PF or VF as targets in "set sample_actions"
command.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
app/test-pmd/cmdline_flow.c

index 1d96278..49d9f9c 100644 (file)
@@ -583,6 +583,7 @@ 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 action_rss_data sample_rss_data[RAW_SAMPLE_CONFS_MAX_NUM];
+struct rte_flow_action_vf sample_vf[RAW_SAMPLE_CONFS_MAX_NUM];
 
 static const char *const modify_field_ops[] = {
        "set", "add", "sub", NULL
@@ -7918,6 +7919,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;