From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 718A3A0542; Wed, 7 Sep 2022 04:41:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14AF8400D6; Wed, 7 Sep 2022 04:41:22 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 27A0840042 for ; Wed, 7 Sep 2022 04:41:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pu2Ga1Z8IqOnrX/+seC7MB4xfLRVLjfNj0WRRfkwbB6SIj3F7WxakEAJ29MKEVru40oBllg4CsoXR0zVcU3CXIdgTAWIjXP1DWY9EaxIun2RW7jbfgABh+FnTC17bRXnBYpaVqJFJCFAAusbSNkKx05CVfpg3/Id3crLgQ+SE847uj2luJq9eD8oc0cTK9mc4EDFYg9ppEVr/ctmgEZtStNTA/Sx0nSDTvXKMpBhU7ge/YryOBA+76zCSlOZzbShnD6KpjS3miBGJYusuqw8in16xUamQWtaPM+dgxLpvU21buVEnj0zXwnivrkAn4/NFKmkq2G3lhFQGSd9NDio2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VdZHYoflQMnvZqyAIZj5+oUJpcQXBzrzsg+x8GuSlog=; b=OfBoVL403l3VV90ds/BTMyLhwscuHV8FjerW5VleCykRyYUKspUWHhenfIQY++89NeKV15Ka7nrKOHEo0sXcn/uAKYogFcDi1E737dBVGDWlNS/a8hh5Jetu7WQwj5Er2BgbiQWjGxB51S1OHK7ZzmyjKu6ctyj4fwLbxKGdddrSz9Ip+UChePeQn3inUaLF3EOTUkL6ZgRs4YjkXcPTq8bqVaoSfbJemQllhanwboaxoMWtpcUbZzcuyCxJkTgwYNr4mhL1ijDPYrZnpi1JCBMc+hEClgB/DyhVi94p6Bv42Dn8KPjUbQOkMdilN6nvYAzGQQwHvxgl0fUIgQJ1yA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=xilinx.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VdZHYoflQMnvZqyAIZj5+oUJpcQXBzrzsg+x8GuSlog=; b=KnXzH2UWfvD9rxwsF/qjNENIVJzm5yvCCG8PyB/iTrZjpu2CFvBYjZHjiYDcXMMDB2tS5AhX4hBY2YxLT2jV7zwEGd5Z3PRsf4QO/2eBLoUUQR67fUFwPfWUpBEEP1l/bP8dgn9Com9FnR3fPBwvWv5qqh9v/qaWpgc+QC/WxJMBNwuI+6bEqz+sRETOBqAKVlI9TFx1WUFyO66oLWOVrgdWSrRc7VGc3btyyEIqJqvpJq7wvd+B4iqUOLhhU98VxDr32IUKIEHik8qpySni3soixk6SYynBo/BPPmtNcp4SQJjCt+kTDKt3zTkZZJMAE01aYtwUcaH0pDsnbceM3w== Received: from MW2PR2101CA0007.namprd21.prod.outlook.com (2603:10b6:302:1::20) by MN2PR12MB4439.namprd12.prod.outlook.com (2603:10b6:208:262::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.11; Wed, 7 Sep 2022 02:41:19 +0000 Received: from CO1NAM11FT034.eop-nam11.prod.protection.outlook.com (2603:10b6:302:1:cafe::54) by MW2PR2101CA0007.outlook.office365.com (2603:10b6:302:1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.4 via Frontend Transport; Wed, 7 Sep 2022 02:41:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by CO1NAM11FT034.mail.protection.outlook.com (10.13.174.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5612.13 via Frontend Transport; Wed, 7 Sep 2022 02:41:18 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Wed, 7 Sep 2022 02:40:39 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 6 Sep 2022 19:40:35 -0700 From: Rongwei Liu To: , , , , Aman Singh , Yuying Zhang , Ferruh Yigit , "Andrew Rybchenko" CC: , Subject: [PATCH v1] ethdev: add direction info when creating the transfer table Date: Wed, 7 Sep 2022 05:40:20 +0300 Message-ID: <20220907024020.2474860-1-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT034:EE_|MN2PR12MB4439:EE_ X-MS-Office365-Filtering-Correlation-Id: f69f9c64-f539-4d32-dad9-08da907a7116 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /w85oy8+M1cxYpgjZNIdD6uqOzTDMxZo4YSG7ph/jAYC4QOuXvcphOwct0z9FSE4S/L7UNWiGggaY7n7LTlau5amiXq9FUqyXnt+EIt1EN+icaO3DOwWa0tiXUxDKy6vwdV+c2WpKwjBw2Lso8XzhIvXv1DwJo3LKFCkDkaVImhGhH0YMb2U04cL4ZVcxIrH6rPUM0cddIh+EUeCpc2YAllXwkIi6L4c3DZfNnAuuaMJl7zw4HcWCXBvCtpmJHKRGbE2SVIgMEk5qjBPTKObsX2BYD62RtGrR/8+i0W+sP8iNfhirf91FIlCBQ2yG2FjP7uQ7AC2ly+BRRiZ3FgmRC1LKkh6zDiIbaVU4ZrK0ntNvZDClsrSRBK2Ws+a2LSbIIv/NHHOESasm+yVw0wpsSzVwp33yTxE1aNF0sTnKUyL/4HuzyD6cMfBDn1gdHDk5s/taAGwmVBL9/u7+FFoVP+JIZBrpx+0Vsjmv4eXypE0GyaVoLJm5e8cW5VO6deykluj/YQabT8axq87JpNcu+q6AErmTCGbTc22zS9208IxoyiucGskj6cWh0iv35r0y6w8XsLxdXp9Zac5bXfCKdOpfTRQ3AakDjGoKllT3P+Zk/Tw0JYgLFA2nVen1yqrL7nq85ms0xThbO+ZYWrrZHDdWKLLBhO8EDuipb55ljuULEYg4LN+AhaxIzF9mjxqo5OW/3OYqxoxnQfrouInVqsjpG+iDPUy4SbMknD3q3OPSlPMEd7u9YfZYe1UjSm6weAW9bv6RwVWVKxGms3isD1zUtvmhtaBJQt/6KDgypA= X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(346002)(136003)(376002)(396003)(46966006)(40470700004)(36840700001)(81166007)(356005)(82740400003)(40460700003)(36860700001)(4326008)(55016003)(8676002)(70206006)(70586007)(82310400005)(110136005)(316002)(54906003)(426003)(26005)(5660300002)(8936002)(16526019)(40480700001)(2616005)(6286002)(83380400001)(47076005)(1076003)(478600001)(6666004)(186003)(107886003)(7696005)(2906002)(86362001)(336012)(41300700001)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2022 02:41:18.2985 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f69f9c64-f539-4d32-dad9-08da907a7116 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT034.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4439 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The transfer domain rule is able to match traffic wire/vf origin and it means two directions' underlayer resource. In customer deployments, they usually match only one direction traffic in single flow table: either from wire or from vf. Introduce one new member transfer_mode into rte_flow_attr to indicate the flow table direction property: from wire, from vf or bi-direction(default). It helps to save underlayer memory also on insertion rate. By default, the transfer domain is bi-direction, and no behavior changes. 1. Match wire origin only flow template_table 0 create group 0 priority 0 transfer wire_orig... 2. Match vf origin only flow template_table 0 create group 0 priority 0 transfer vf_orig... Signed-off-by: Rongwei Liu --- app/test-pmd/cmdline_flow.c | 26 +++++++++++++++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/ethdev/rte_flow.h | 9 ++++++- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 7f50028eb7..b25b595e82 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -177,6 +177,8 @@ enum index { TABLE_INGRESS, TABLE_EGRESS, TABLE_TRANSFER, + TABLE_TRANSFER_WIRE_ORIG, + TABLE_TRANSFER_VF_ORIG, TABLE_RULES_NUMBER, TABLE_PATTERN_TEMPLATE, TABLE_ACTIONS_TEMPLATE, @@ -1141,6 +1143,8 @@ static const enum index next_table_attr[] = { TABLE_INGRESS, TABLE_EGRESS, TABLE_TRANSFER, + TABLE_TRANSFER_WIRE_ORIG, + TABLE_TRANSFER_VF_ORIG, TABLE_RULES_NUMBER, TABLE_PATTERN_TEMPLATE, TABLE_ACTIONS_TEMPLATE, @@ -2881,6 +2885,18 @@ static const struct token token_list[] = { .next = NEXT(next_table_attr), .call = parse_table, }, + [TABLE_TRANSFER_WIRE_ORIG] = { + .name = "wire_orig", + .help = "affect rule direction to transfer", + .next = NEXT(next_table_attr), + .call = parse_table, + }, + [TABLE_TRANSFER_VF_ORIG] = { + .name = "vf_orig", + .help = "affect rule direction to transfer", + .next = NEXT(next_table_attr), + .call = parse_table, + }, [TABLE_RULES_NUMBER] = { .name = "rules_number", .help = "number of rules in table", @@ -8894,6 +8910,16 @@ parse_table(struct context *ctx, const struct token *token, case TABLE_TRANSFER: out->args.table.attr.flow_attr.transfer = 1; return len; + case TABLE_TRANSFER_WIRE_ORIG: + if (!out->args.table.attr.flow_attr.transfer) + return -1; + out->args.table.attr.flow_attr.transfer_mode = 1; + return len; + case TABLE_TRANSFER_VF_ORIG: + if (!out->args.table.attr.flow_attr.transfer) + return -1; + out->args.table.attr.flow_attr.transfer_mode = 2; + return len; default: return -1; } diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 330e34427d..603b7988dd 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3332,7 +3332,8 @@ It is bound to ``rte_flow_template_table_create()``:: flow template_table {port_id} create [table_id {id}] [group {group_id}] - [priority {level}] [ingress] [egress] [transfer] + [priority {level}] [ingress] [egress] + [transfer [vf_orig] [wire_orig]] rules_number {number} pattern_template {pattern_template_id} actions_template {actions_template_id} diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index a79f1e7ef0..512b08d817 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -130,7 +130,14 @@ struct rte_flow_attr { * through a suitable port. @see rte_flow_pick_transfer_proxy(). */ uint32_t transfer:1; - uint32_t reserved:29; /**< Reserved, must be zero. */ + /** + * 0 means bidirection, + * 0x1 origin uplink, + * 0x2 origin vport, + * N/A both set. + */ + uint32_t transfer_mode:2; + uint32_t reserved:27; /**< Reserved, must be zero. */ }; /** -- 2.27.0