From patchwork Thu Oct 29 11:46:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 82739 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 36DF4A04B5; Thu, 29 Oct 2020 12:46:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C86F1CA74; Thu, 29 Oct 2020 12:46:55 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by dpdk.org (Postfix) with ESMTP id DD7E3CA67 for ; Thu, 29 Oct 2020 12:46:52 +0100 (CET) Received: from localhost.localdomain (unknown [188.242.7.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 2149A7F523; Thu, 29 Oct 2020 14:46:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 2149A7F523 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1603972011; bh=blzbWySfRJZx8g70DXiQEYju61m/1jf86YLPKHdUh0Y=; h=From:To:Cc:Subject:Date; b=qhvDa3wkNzY4VrYkezwoBKPjD1H1Z0N74Y672LbNTM0LUJrpwu8odRH/nXfJ8Tv7Q S7undRGkk5r6Pik536I/twQRYhfknT36sv1AXiInrQ0qi6NCD5Rxz5w01QT3C32c7S /4bZyQne7Qw7tsP1OyFawMsYHqyJEbcp3qyyvNlM= From: Ivan Malov To: dev@dpdk.org Cc: Ori Kam , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Date: Thu, 29 Oct 2020 14:46:43 +0300 Message-Id: <20201029114644.22169-1-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 1/2] ethdev: introduce transfer attribute to shared action conf 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" In a flow rule, attribute "transfer" means operation level at which both traffic is matched and actions are conducted. Add the very same attribute to shared action configuration. If a driver needs to prepare HW resources in two different ways, depending on the operation level, in order to set up an action, then this new attribute will indicate the level. Also, when handling a flow rule insertion, the driver will be able to turn down a shared action if its level is unfit. Signed-off-by: Ivan Malov --- lib/librte_ethdev/rte_flow.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index a8eac4deb..0b993d8eb 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -3487,6 +3487,13 @@ struct rte_flow_shared_action_conf { /**< Action valid for rules applied to ingress traffic. */ uint32_t egress:1; /**< Action valid for rules applied to egress traffic. */ + + /** + * This attribute matches that of the flow rules which + * are supposed to comprise the given shared action. + * See struct rte_flow_attr. + */ + uint32_t transfer:1; }; /** From patchwork Thu Oct 29 11:46:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 82740 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 4FD2DA04B5; Thu, 29 Oct 2020 12:47:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9BCADCAAE; Thu, 29 Oct 2020 12:47:02 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by dpdk.org (Postfix) with ESMTP id 3B748CAAD for ; Thu, 29 Oct 2020 12:47:01 +0100 (CET) Received: from localhost.localdomain (unknown [188.242.7.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id E1EA47F476; Thu, 29 Oct 2020 14:46:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru E1EA47F476 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1603972020; bh=40zh5BoYm9BUwhP/0f0eBIhZyRXVFD9MM8yxM7smRx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VT/cxa6FK0i5H3l9DuClZsxHgwGJCfnjNSLkJ2GArzvHiwsqqK4m7Cmmwih8Zbxdz 6np8AjDuTFLbc9WdSmmszLK+7FlRuFcb3E2a4K8FZlORP6cziTqFcQQawq+eoVqJdZ 6rGzUifDFg19zk8g3TzIR91FAseq5yvP0r49oPEk= From: Ivan Malov To: dev@dpdk.org Cc: Ori Kam , Wenzhuo Lu , Beilei Xing , Bernard Iremonger Date: Thu, 29 Oct 2020 14:46:44 +0300 Message-Id: <20201029114644.22169-2-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201029114644.22169-1-ivan.malov@oktetlabs.ru> References: <20201029114644.22169-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 2/2] app/testpmd: support shared flow action attribute transfer 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" This attribute helps PMDs to tell actions supposed to work on the so-called hardware e-switch level from regular ones. Signed-off-by: Ivan Malov --- app/test-pmd/cmdline_flow.c | 12 ++++++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 3d1dd0595..a0f63c684 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -114,6 +114,7 @@ enum index { SHARED_ACTION_CREATE_ID, SHARED_ACTION_INGRESS, SHARED_ACTION_EGRESS, + SHARED_ACTION_TRANSFER, SHARED_ACTION_SPEC, /* Shared action destroy arguments */ @@ -782,6 +783,7 @@ static const enum index next_sa_create_attr[] = { SHARED_ACTION_CREATE_ID, SHARED_ACTION_INGRESS, SHARED_ACTION_EGRESS, + SHARED_ACTION_TRANSFER, SHARED_ACTION_SPEC, ZERO, }; @@ -4280,6 +4282,12 @@ static const struct token token_list[] = { .next = NEXT(next_sa_create_attr), .call = parse_sa, }, + [SHARED_ACTION_TRANSFER] = { + .name = "transfer", + .help = "affect rule to transfer", + .next = NEXT(next_sa_create_attr), + .call = parse_sa, + }, [SHARED_ACTION_SPEC] = { .name = "action", .help = "specify action to share", @@ -4515,6 +4523,9 @@ parse_sa(struct context *ctx, const struct token *token, case SHARED_ACTION_INGRESS: out->args.vc.attr.ingress = 1; return len; + case SHARED_ACTION_TRANSFER: + out->args.vc.attr.transfer = 1; + return len; default: return -1; } @@ -7267,6 +7278,7 @@ cmd_flow_parsed(const struct buffer *in) &((const struct rte_flow_shared_action_conf) { .ingress = in->args.vc.attr.ingress, .egress = in->args.vc.attr.egress, + .transfer = in->args.vc.attr.transfer, }), in->args.vc.actions); break; diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 70d20113e..da6e407e8 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -4782,7 +4782,7 @@ Creating shared actions shared action ID. It is bound to ``rte_flow_shared_action_create()``:: flow shared_action {port_id} create [action_id {shared_action_id}] - [ingress] [egress] action {action} / end + [ingress] [egress] [transfer] action {action} / end If successful, it will show::