From patchwork Mon Dec 21 05:46:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Satheesh Paul Antonysamy X-Patchwork-Id: 85582 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7C417A09EF; Mon, 21 Dec 2020 06:46:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5C027CB83; Mon, 21 Dec 2020 06:46:50 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 5A907CB7F for ; Mon, 21 Dec 2020 06:46:48 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 0BL5e5Wb019640; Sun, 20 Dec 2020 21:46:46 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=QsYw2Yc0svmllKJCplWKPvWCELKXWM6DFnubjZbTpSc=; b=gqhu14Pe0bvQAG5gJR6gpA5nCJv9Q1lqvTScfYBZaYeYsjegRQ5mfRgvyGFwc/YaNNcr eQ503l6gy7lJQNIhclluk/svZLT4sHncr07Hv960EKfxky7p7BUQ2guFC5a/SungiYF3 +Uj/y1mWFKdyi9BzTWXAeqx3RBWeSUFTjn9uLJd8r+2/wS9LCAd6HnNf0YN9jhxbFp1g bEr7eNakWj2QnjnPei7HJYXgAL6TcyCc7nNSzOHo3yrbzQBgclH4kEoTOiB+kW38Qklt +1RVS79hLDs3WYzqDKvQhOh1/7wkV94ELsGE+Djg9BARh5EXmaJawGdns2/Jcc2q9ksx oA== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 35j4wvhckt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 20 Dec 2020 21:46:46 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 20 Dec 2020 21:46:45 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 20 Dec 2020 21:46:43 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 20 Dec 2020 21:46:43 -0800 Received: from localhost.localdomain (unknown [10.28.34.33]) by maili.marvell.com (Postfix) with ESMTP id AA3FF3F7040; Sun, 20 Dec 2020 21:46:41 -0800 (PST) From: To: Ori Kam , Wenzhuo Lu , Beilei Xing , Bernard Iremonger CC: , Satheesh Paul Date: Mon, 21 Dec 2020 11:16:36 +0530 Message-ID: <20201221054636.4574-1-psatheesh@marvell.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2020-12-21_02:2020-12-19, 2020-12-21 signatures=0 Subject: [dpdk-dev] [PATCH] app/testpmd: add PF and VF targets to flow action type sample X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Satheesh Paul Add support to specify PF or VF as targets in "set sample_actions" command. Signed-off-by: Satheesh Paul Acked-by: Ori Kam --- 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;