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 BB7CCA0542; Wed, 26 Oct 2022 23:50:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0714F4284D; Wed, 26 Oct 2022 23:50:00 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2046.outbound.protection.outlook.com [40.107.212.46]) by mails.dpdk.org (Postfix) with ESMTP id B40664284D for ; Wed, 26 Oct 2022 23:49:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OPrbaM3mrqAC1nNnvENsrDN4m0idp8X6G/f+VqXaiPErOlS/bzmxc2/Jy/hJnOf7BLwd4k50RiyRNfVr3TJURKwGRLof2Fwl5kOe5+mM15YfEGQPboIpl/ejkgtdbyeT1wKTizaYSRgLGNqjPLw0w0wzRSCNkzy0OkIjXcxOXt6YqKNZf/0M4jmJszzFudsP5p2oq31iXbcfxlz+/sg+kG68TPi5SK/ZBCb96WT7o6mhs52UkVEzgI72MMxcXuYWSCYPOEasAVVWjz4TI66ZdoiwtOfTZ5iJs0i3TJ/HXsLf51pDas33X/41ZO4YamVsH8NEXPegL83I2JwO49XaAg== 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=Joq1MpeL/M3MTw3n2G2qdHTH1jg0l5xsxmcsuqiUj54=; b=BGazth+u25vmWX/0++2mdwByf4foE2t2/VvpHSB0CfZdXIX3uDd0/Wh3khlt+1Rfjl3ULCIyI8rEe2E+A2PXegDgcHY80G6kNe1uHkPweKYjDMdIaqGbalrFbjKvkdLJHCqVmP3QGoonb2NR2esY4UteW0bx4v0SqomVJ5jogs74Gml8TFdd8K3c3eHnBC9iHn3uFL90J/q6l8cLQm8sPq9C/+nm/nAl0IEOLtYhgKA1TULu7GtBtqAlV0iKBG4n0+T/QdG64a8UIOGJg2Q1rvPIp8pvcYbEtilWsjtZH6Yd0fADt+ZIwHUTEa4SovqjF058gutCSbTr1U7CefcRBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=dpdk.org 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=Joq1MpeL/M3MTw3n2G2qdHTH1jg0l5xsxmcsuqiUj54=; b=LiohqwRT0BuZm09nYIrfMkYTS3YreXBBdb5usNHjHnakDesz+8VGN9gSjuYhiEF7uSoLL5yFjzG/Gj2vmw7VK4ISuccAcJlY8RUUDI0GvicOw/GJMKNDJKpjntFIxJbtYCP+UgvXeeLiv9F0my5MVBilCbdk4bXhvKPLB51ICMtm8jfSrnJvn+fYixhGa2LS3O+lUTQYKT1G4b5+/vgg0UVrk42FBqjutve3QXHg7c1pkOktubkOnQ2xf4kN8kK7efk8eh5sDeqrvmyFX7jDc+31t+YsRx2pPPrsDt9zPZwU7Gg3hO5HQjw6inNztZqEMinQmG0qrUSZ9fGpmrfs6w== Received: from MW4PR03CA0037.namprd03.prod.outlook.com (2603:10b6:303:8e::12) by DM4PR12MB6565.namprd12.prod.outlook.com (2603:10b6:8:8c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Wed, 26 Oct 2022 21:49:56 +0000 Received: from CO1NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8e:cafe::c5) by MW4PR03CA0037.outlook.office365.com (2603:10b6:303:8e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Wed, 26 Oct 2022 21:49:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CO1NAM11FT021.mail.protection.outlook.com (10.13.175.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.16 via Frontend Transport; Wed, 26 Oct 2022 21:49:55 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 26 Oct 2022 14:49:55 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Wed, 26 Oct 2022 14:49:54 -0700 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29 via Frontend Transport; Wed, 26 Oct 2022 14:49:53 -0700 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , "Ori Kam" , Andrew Rybchenko Subject: [PATCH v4 1/3] ethdev: add strict queue to pre-configuration flow hints Date: Thu, 27 Oct 2022 00:49:41 +0300 Message-ID: <20221026214943.3686635-2-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221026214943.3686635-1-michaelba@nvidia.com> References: <20221019144904.2543586-1-michaelba@nvidia.com> <20221026214943.3686635-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT021:EE_|DM4PR12MB6565:EE_ X-MS-Office365-Filtering-Correlation-Id: 8985fa42-a026-479b-1416-08dab79c0575 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6Zz+FqV5xrn/RmGqlYAvpJhqR/wS/Bun5+33fqEiwyMjWZSw+5N+qjzjK5x92+/aRBjjWHZqZLA8iJ+m4mCqox3iQki46GXpSrwuHmb+2/V5hDWh+Gqq73KdPDhl5heQ2vBGCKBYKeibH3b1myNDUTtCoyKqqZJZmgTga9uOAGyQ/lDFakJiWBkzKvi9fPhYOUarmW41t77Abrm4PpcRVZKjxaGP61RmnLCvQM9NwkySXJPkcTWIBdcDj7PzNjtnAfSqEqCEdHt2WvVF7I8ANyNPtRQ+/mmqFq1rn0/u7U9ISpC9hrXFVqE2jAEY3yL5mFP63D37mbyoJ0OoeGdFeqdh/88EX/A0eCKy5YfXrQ87pT2pM62P0SvXVqVCNWbosKNSYqlKjyIqToTcBe1GNSqc2/TggiTCG3TVRiyfAKbx3f0uGZLGo1XjNZbUlemHTfoziUkx8CYWRnOifxVty46vYxjkis3ek6IqHdWPjmPSjWM2xdivcQSHtDUWSp2+OLEH6z2Dpp97t2tTLoPuOKy91rezLtjtrOVAvpfk2QwngpPGbmdHc9pvMe7SWazjUELFzQrX3i4M9IoO2y+R7X1vzXVdUfbJv/CIOKrCkpfeA2B6obFBYbdwMWyx5uxX+31M621h0dBlPYMh6ZQUpDd9bcuqu+rKtnRJmOB38q3WTeeFIUillK/MZecu65DSWF/fY65xi06L/ceLpJL062Up/IImXKRaFPpWNJ0KrMTAPQhXuO9mnED5bRdm5xcHkIyGhF4P67Ozx6ZfD3qQQg== X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(376002)(136003)(39860400002)(346002)(396003)(451199015)(46966006)(40470700004)(36840700001)(55016003)(40480700001)(6666004)(54906003)(70206006)(7696005)(316002)(478600001)(6916009)(70586007)(4326008)(8676002)(26005)(36756003)(36860700001)(6286002)(8936002)(41300700001)(86362001)(5660300002)(2616005)(1076003)(186003)(2906002)(336012)(83380400001)(40460700003)(7636003)(47076005)(82310400005)(426003)(356005)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2022 21:49:55.9905 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8985fa42-a026-479b-1416-08dab79c0575 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6565 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 data-path focused flow rule management can manage flow rules in more optimized way than traditional one by using hints provided by application in initialization phase. In addition to the current hints we have in port attr, more hints could be provided by application about its behaviour. One example is how the application do with the same flow rule ? A. create/destroy flow on same queue but query flow on different queue or queue-less way (i.e, counter query) B. All flow operations will be exactly on the same queue, by which PMD could be in more optimized way then A because resource could be isolated and access based on queue, without lock, for example. This patch add flag about above situation and could be extended to cover more situations. Signed-off-by: Michael Baum Acked-by: Ori Kam Acked-by: Andrew Rybchenko --- app/test-pmd/cmdline_flow.c | 10 ++++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 ++-- lib/ethdev/rte_flow.h | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 810dfb9854..59829371d4 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -226,6 +226,7 @@ enum index { CONFIG_AGING_OBJECTS_NUMBER, CONFIG_METERS_NUMBER, CONFIG_CONN_TRACK_NUMBER, + CONFIG_FLAGS, /* Indirect action arguments */ INDIRECT_ACTION_CREATE, @@ -1092,6 +1093,7 @@ static const enum index next_config_attr[] = { CONFIG_AGING_OBJECTS_NUMBER, CONFIG_METERS_NUMBER, CONFIG_CONN_TRACK_NUMBER, + CONFIG_FLAGS, END, ZERO, }; @@ -2692,6 +2694,14 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY(struct buffer, args.configure.port_attr.nb_conn_tracks)), }, + [CONFIG_FLAGS] = { + .name = "flags", + .help = "configuration flags", + .next = NEXT(next_config_attr, + NEXT_ENTRY(COMMON_UNSIGNED)), + .args = ARGS(ARGS_ENTRY(struct buffer, + args.configure.port_attr.flags)), + }, /* Top-level command. */ [PATTERN_TEMPLATE] = { .name = "pattern_template", diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index d0fe73dff6..81e502b369 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -2891,7 +2891,7 @@ following sections. [queues_number {number}] [queues_size {size}] [counters_number {number}] [aging_counters_number {number}] - [meters_number {number}] + [meters_number {number}] [flags {number}] - Create a pattern template:: flow pattern_template {port_id} create [pattern_template_id {id}] @@ -3042,7 +3042,7 @@ for asynchronous flow creation/destruction operations. It is bound to [queues_number {number}] [queues_size {size}] [counters_number {number}] [aging_counters_number {number}] - [meters_number {number}] + [meters_number {number}] [flags {number}] If successful, it will show:: diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index cddbe74c33..a93ec796cb 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -4741,6 +4741,12 @@ rte_flow_flex_item_release(uint16_t port_id, const struct rte_flow_item_flex_handle *handle, struct rte_flow_error *error); +/** + * Indicate all operations for a given flow rule will _strictly_ + * happen on the same queue (create/destroy/query/update). + */ +#define RTE_FLOW_PORT_FLAG_STRICT_QUEUE RTE_BIT32(0) + /** * @warning * @b EXPERIMENTAL: this API may change without prior notice. @@ -4774,6 +4780,10 @@ struct rte_flow_port_info { * @see RTE_FLOW_ACTION_TYPE_CONNTRACK */ uint32_t max_nb_conn_tracks; + /** + * Port supported flags (RTE_FLOW_PORT_FLAG_*). + */ + uint32_t supported_flags; }; /** @@ -4848,6 +4858,10 @@ struct rte_flow_port_attr { * @see RTE_FLOW_ACTION_TYPE_CONNTRACK */ uint32_t nb_conn_tracks; + /** + * Port flags (RTE_FLOW_PORT_FLAG_*). + */ + uint32_t flags; }; /** -- 2.25.1