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 D39D0A00C2; Wed, 28 Sep 2022 11:25:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7CDD44113D; Wed, 28 Sep 2022 11:25:02 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2046.outbound.protection.outlook.com [40.107.92.46]) by mails.dpdk.org (Postfix) with ESMTP id 9B2D74113C for ; Wed, 28 Sep 2022 11:25:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OoO8GH70T2v3AfIx0lENHb5kNnGleKMfWNQ/yBXLbcT/03OXlb6/0vHClWWEMkCz/0RAeMwh5ImxkI2CdMZVpHx/4Yy0PPBV85zWIN68CFjvh+aUvArJ/OfXHpFl+8+hKFFhdcm6eEtY7K0HvbD3Px2UH5yIiT6HPQCr3LNwE4J3KDVLbydEf95xaCyI0gd6o8AZBaWopF5kWFK9yQUh5NlG6RK2vQHrQI1LvsyUEo1ri6xIzaP4CcZT8wNw86a4wNMNnTF1FUUJjgLAAfymNtuAKAAesPSL5HstkMvtWkHXUa7UipDLkCIdvT+KP+hJ2RftMYheM7mx3owTBRU/Tg== 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=9U9NNWiXvpH8+ykz/L1xRe/ZgANJ7JoH/OlaH5sagik=; b=nSM12CHnXfeTL4blHiyyWNPKFOz6cKANxTwouG/5/jcCJ1Z5cJL2JuCAamp0sCtYzF0WT4hZ61jMsAQgKPol8s93N32CgWZrTQoZ2URmQ0l0P73ovw+Coz7mIC+QIoxGVmrJQku2TkyAnQi9N66bmC0RmGFO2cvtZOmv01SbTaoEDEemeRFSR+hVd2clqWnSWjMBLpiDrTrGrhzVU8V9FyFDc33MwqORYWSv06ulN1dAjwpW90tcOUR4WKRpSXF073wkY50quyqjdZLz/zNC/mKWAFRWVKVFcawZk95UDjBMLhH8M7PWupbqHHaKABw+NQ1GRfD3zSdf0esAHvDubw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=monjalon.net 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=9U9NNWiXvpH8+ykz/L1xRe/ZgANJ7JoH/OlaH5sagik=; b=ez30l0s9WHFDwlC0v2AnZkYbzK3fs5qx9JIqs0ocaqaU0jAHzk5doyxyD0NE59YUwDI2dXz5HbSuaNGvi/1gHfAxS88vfsGeCdB3g5PNGrRQXm7zOetCPlQrGl16GamnkvkSxCjPIEyU6OVwhYe1r2AQjPEdeb4I5kQ19uCEX8iOdBecoCOozHgbWIgJL+uXa278fvdliPx5CXOcp8yXIUFpjEKftAZG4tK4EpzECtlf11vRe3EY7KFmqEMyKLnZdjcDrE9U7pnOUgRF/6c22ycoX96rCCPr7WAb602pLOp5U6yt21FCHk36LXhDYhTYys/IgFRpu9WJpJLvF24SuA== Received: from MW4P222CA0023.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::28) by CH2PR12MB4278.namprd12.prod.outlook.com (2603:10b6:610:ab::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17; Wed, 28 Sep 2022 09:24:57 +0000 Received: from CO1NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:303:114:cafe::e7) by MW4P222CA0023.outlook.office365.com (2603:10b6:303:114::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.15 via Frontend Transport; Wed, 28 Sep 2022 09:24:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT017.mail.protection.outlook.com (10.13.175.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Wed, 28 Sep 2022 09:24:56 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 28 Sep 2022 02:24:44 -0700 Received: from nvidia.com (10.126.231.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; Wed, 28 Sep 2022 02:24:40 -0700 From: Rongwei Liu To: , , , , Aman Singh , Yuying Zhang , Ferruh Yigit , "Andrew Rybchenko" CC: , Subject: [PATCH v3] ethdev: add hint when creating async transfer table Date: Wed, 28 Sep 2022 12:24:25 +0300 Message-ID: <20220928092425.68214-1-rongweil@nvidia.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <5d8d42b2-7011-cb46-7f2c-1b1019c4151e@oktetlabs.ru> References: <5d8d42b2-7011-cb46-7f2c-1b1019c4151e@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.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: CO1NAM11FT017:EE_|CH2PR12MB4278:EE_ X-MS-Office365-Filtering-Correlation-Id: 818bfc3e-27dd-42c6-6bfb-08daa1334ede 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: AZ2n6rSoS1h1vEcbQMDnUtELcawI2SrM7j8YKr29Jct+wcvuzaUs5+WzkAOmt4d9azZYxZ20ImlKnz4+dhb5utE8Li8MFQBIxFYcWmMCuP1LuzOn/O8XcN5SwVGqgyE4TCdS57seofytj7TcOz2RuqyxsAWCEvbhGuzr0tmGYafBIOeAs/iEJa9ARFSzp65sX8rI1eJpdXTxUEFG4ZgLzkEUOGg9OvmzTW/dHwbB5eyZ/0dZ+HClg6Ri/ZTfeHcRgBQAMXY9psbaSHN9WGzC4WRmA8UhCk5J67BO6qjJPS3VpPMkEElIZbhTC/x1XPMWrhXYt/W9upWvtMLcKOwNPI5xYhW+s+k9ZeGilDEx1QWl3RWv6YI0U91Eb4qJQ1f2fPD1nNyU8jIUZbfUxQgsojm4fLCa3mQjjg8IPody+lxBbkteUiZEbkfFAK5TtFHS3T8sderrLfpaX77vNewp1tDaIOa1c1gqL0dBL1NkQRoJf+cmBy2iivikWuyhnwCGy3yV3E+d9gF3GW4yF1jmBVW0tdZH/EIYKZhb6+bPhn8whTFnhmPLfo1Hg9erGMhZR3I8JA5lC2wLzjECvG36IkvGbemlul0L/hWrU0Vx/BQGRBlyR2HzMRfoZplV2hsHOgkq8nXDWs7QvtoISYEtS7dMHZB5kr/vwJX/seLHzmvw+lEa1rKHvXXZqdeMYn8hXdYiucljagR8qLUg9RzHfENd0sg+6M1BEKLac/SEZ4HRT4YuT3wvunfjbEuUigX41/VmZIH8mIwjK15NiItq6g== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(346002)(39860400002)(376002)(396003)(136003)(451199015)(40470700004)(46966006)(36840700001)(83380400001)(2616005)(426003)(336012)(16526019)(1076003)(186003)(47076005)(356005)(7636003)(82740400003)(36860700001)(5660300002)(8936002)(41300700001)(82310400005)(2906002)(478600001)(40460700003)(26005)(6286002)(7696005)(6666004)(107886003)(8676002)(40480700001)(4326008)(70206006)(70586007)(55016003)(54906003)(110136005)(316002)(36756003)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2022 09:24:56.3856 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 818bfc3e-27dd-42c6-6bfb-08daa1334ede X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4278 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_template_table_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, and this new field doesn't expose any matching criteira. By default, the transfer domain is to match bi-direction traffic, and no behavior changed. 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 Acked-by: Ori Kam v2: Move the new field to template table attribute. --- app/test-pmd/cmdline_flow.c | 26 +++++++++++++++++++++ doc/guides/prog_guide/rte_flow.rst | 7 ++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/ethdev/rte_flow.h | 7 ++++++ 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index d97be6fe98..beacb0a802 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -178,6 +178,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, @@ -1142,6 +1144,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, @@ -2882,6 +2886,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", @@ -8895,6 +8911,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.transfer_mode = 1; + return len; + case TABLE_TRANSFER_VF_ORIG: + if (!out->args.table.attr.flow_attr.transfer) + return -1; + out->args.table.attr.transfer_mode = 2; + return len; default: return -1; } diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 588914b231..de8d6836d6 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -3748,6 +3748,13 @@ the maximum number of flow rules is defined at table creation time. Any flow rule creation beyond the maximum table size is rejected. Application may create another table to accommodate more rules in this case. +Attribute: transfer_mode +^^^^^^^^^^^^^^^^^^^^^^^^ + +This is an optional table attribute and meaningless if `Attribute: Transfer` +is not specified. It doesn't expose any matching criteria but just as a hint +to indicate PMD where to bound the rules. + .. code-block:: c struct rte_flow_template_table * diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 5fbec06c35..9a97c5f513 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3125,7 +3125,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 017f690798..a546e9a72b 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -5233,6 +5233,13 @@ struct rte_flow_template_table_attr { * Maximum number of flow rules that this table holds. */ uint32_t nb_flows; + /** + * 0 means bidirection, + * 0x1 origin uplink, + * 0x2 origin vport, + * N/A both set. + */ + uint32_t transfer_mode:2; }; /** -- 2.31.1