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 5E67145BA3; Tue, 22 Oct 2024 18:57:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3FDC40DD1; Tue, 22 Oct 2024 18:56:25 +0200 (CEST) Received: from egress-ip11a.ess.de.barracuda.com (egress-ip11a.ess.de.barracuda.com [18.184.203.234]) by mails.dpdk.org (Postfix) with ESMTP id B2715406A2 for ; Tue, 22 Oct 2024 18:56:16 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2107.outbound.protection.outlook.com [104.47.17.107]) by mx-outbound15-54.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 22 Oct 2024 16:56:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DUQ1uGm4hO1SQd7kOTY9ewa8JrkQ1TpG9KkUxkrqVlhe7YTmH1CvCdiYgBbXKkt+By/Wdta+6ZNxWFDsYQaydDQ7tuDcJTk6IEyVP4An8YV6J2mJvUeZSlDDoh6iN5TlFqv2FXwth5aeEH7JpKa/Tz0v9fuJTtxDb4mV0l5yMDcZo9AuOcvsA0VR3F/dBUpHBoY9sWxxHDds0f4xj7PP240mMh9Ic6HsBw/xymsRKJMF1pn04o+12Dks15b1KLrSclpZwsz0a2HQfUSDBoXqKNWVyNCvz+mhw0BEJ6+9PA3jCfGUBmOZLJpZaaq9lOgw41WU1xpe2vi0/270Wg6KiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=AaJuj1wNbEG/IsPq4NrQUTqwIAeTi0jRNKgtlaFugLk=; b=lRNFhkTQEyIJLbAp3N9h5XL8SVJb8ci/nxCOWrKFCDs+kqYXi2WEpPL64F8KXTqWoBvlmUlWgQORcXqa+PW4m9SezhpdIOAbIpypNUTDZML9MQ+1tVkbmArGzKbJmJET2gVtwt1NF83gd2q84Cdr4IH5TqlwdMJaWODPoP35p32yZSP3t/JwORavZnQM9smhwcWvXksDIRUps53RmjfSNg9xXe8R1JhouryaH+lJPzYfVcln6hNU5wnMJf0JEZvz0TiExcuzaIqLXeKCzoNNCs0I7MtDLm3kUPwDSUld0Z8tqFAvcqBvRqtoFV8VDInP8sL5bXNoZgQRhRR8wkQsYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 178.72.21.4) smtp.rcpttodomain=dpdk.org smtp.mailfrom=napatech.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=napatech.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AaJuj1wNbEG/IsPq4NrQUTqwIAeTi0jRNKgtlaFugLk=; b=D1XgO3RIIG3micfSyJDJizvxjl3FhyfYq0MqPJc6C4CU7bhL42f93Z5tSct3HnrQcwp/7K6wbVJRklRl7LrYOmza4tPVk7+q1h5dDns7zup2EzD7ll/Q3nXtNApYLKaD5Vzmcrby5f96i4DbGYINJZ4ngoyWEFi4SZt6m47sPP4= Received: from DB9PR06CA0027.eurprd06.prod.outlook.com (2603:10a6:10:1db::32) by AM9P190MB1140.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:26d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.26; Tue, 22 Oct 2024 16:56:10 +0000 Received: from DU2PEPF0001E9C2.eurprd03.prod.outlook.com (2603:10a6:10:1db:cafe::5) by DB9PR06CA0027.outlook.office365.com (2603:10a6:10:1db::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Tue, 22 Oct 2024 16:56:07 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 178.72.21.4) smtp.mailfrom=napatech.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=napatech.com; Received-SPF: Fail (protection.outlook.com: domain of napatech.com does not designate 178.72.21.4 as permitted sender) receiver=protection.outlook.com; client-ip=178.72.21.4; helo=localhost.localdomain; Received: from localhost.localdomain (178.72.21.4) by DU2PEPF0001E9C2.mail.protection.outlook.com (10.167.8.71) with Microsoft SMTP Server id 15.20.8093.14 via Frontend Transport; Tue, 22 Oct 2024 16:56:07 +0000 From: Serhii Iliushyk To: dev@dpdk.org Cc: mko-plv@napatech.com, sil-plv@napatech.com, ckm@napatech.com, andrew.rybchenko@oktetlabs.ru, ferruh.yigit@amd.com, stephen@networkplumber.org Subject: [PATCH v2 10/73] net/ntnic: add action queue Date: Tue, 22 Oct 2024 18:54:27 +0200 Message-ID: <20241022165541.3186140-11-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241022165541.3186140-1-sil-plv@napatech.com> References: <20241021210527.2075431-1-sil-plv@napatech.com> <20241022165541.3186140-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PEPF0001E9C2:EE_|AM9P190MB1140:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 61f09a36-f4e8-4d3d-1dd9-08dcf2ba6c93 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?zbd68mf6ubOIxbUYmLuxmVZOUMWHiFi00eE1aGV7xxqPPMr1uVCT+vWysCbV?= =?us-ascii?Q?xMs7KxGrFGYaSQlBWss24PmMm2kEaL+GR34cimIOTClcqJFnWPT7gdk4NERA?= =?us-ascii?Q?xX0nbknkcmqeWMpBQ21V0d2B7yhV20r4iGaSSAI5W7NSpmbzUxU3AATQDO+8?= =?us-ascii?Q?0Ivd8C0djW6y7zkcPGp+jrjCIU6lBeube5w1hcz3DjObCH5WQtRY+BmSjUhd?= =?us-ascii?Q?QiMbqZJ/AWuHfaH2Uxy/VhiZlF18M7u5+R1KtVbStmP5f74LHo/DRltxbrEZ?= =?us-ascii?Q?GOsqGMSzvmYlYKK1M3tE6IgQoZV651oL+BpUYqL9RRNdxiMbGNwTQKTErMX3?= =?us-ascii?Q?dzjVebEoZWcJK7o/gEmuGjg73eWw+puAlwvuf/KCqrA+WWemGmAarhzY2Nnq?= =?us-ascii?Q?EdSQOgegmyjw1oF+e18kYooHBjBONAx8bSq8jWgWKRmj5AzUbehlqIiO0+8/?= =?us-ascii?Q?Ww4rDONcqxBya2WJotvYdd51U0y3GRYvy4nJI4RFRGW1q1P3ByQ/atZFbnUb?= =?us-ascii?Q?RjioZ1wKABIPYwy8VpmsWEDJ2mlV/fb25rxJOLoDwOlPENAx96SmfO0o1E6G?= =?us-ascii?Q?7mOxpxelC+xw4IHVmtzke9uqFPjd5qqvZzb7hL4mM+Pz5y/9U4i5S6ga70z9?= =?us-ascii?Q?b85tPUvBJX0bix5Qp9ZkWfL19KSMyqtzrGru8pQQS3TKJ5NHML4IXc8clPyf?= =?us-ascii?Q?bMDcUAl/CRdIBkvPJCWlT9hC1t3ZSS6PcpGQdV1BVLfSd6mN17SmHgXlfSYF?= =?us-ascii?Q?TENYlX2zi8AYPkPpafb9mttWW8JvcM3jkArK5S/z4FaBLJrfcP3KAWjaH8MU?= =?us-ascii?Q?SlySHovz0Fp3QgbCzqDOJfoO39YVdTH5NzFE7SIR6SQAariDLrE/K/SKhLWJ?= =?us-ascii?Q?I5mDUpJPBwZGyfN0B7mjyIonD5VRtuaW7cPWEEaFKu5zCy/G29PEvRrRf7UC?= =?us-ascii?Q?4gGg/oEF7qKuZPfrB5BCCxWysfGf7swPdNnhaU5NN22C9ydc5UQS1YXS4Qgw?= =?us-ascii?Q?E2PQgYU51mhIMb5p9DDXlP6YU3fRLAP2ZUDsF5QPDoaq7AvoevH6f/LrnZCv?= =?us-ascii?Q?EPAdWtqhq3CHWdMV0YQB/Yh8QNJXe2U4t1KI47kvG8gqfiu8cnkWlO3xMYc3?= =?us-ascii?Q?LkoYpbqW82n7A4M4656AYiIVmq41WA8wr9xUKg1HwByx7aHz5oJHGt5ijVD9?= =?us-ascii?Q?QENppkXvsn73Crr6XcHIwJ/kYDSBHeoxcSCyefvkq0O/XBVHync/Z+gYYAP3?= =?us-ascii?Q?NK9wT7ELgTS4SBNgyWspPFoqor1y5eUvFPkdQW8WFtKeuodeIIDzKNgPpFpN?= =?us-ascii?Q?pQwMFmYSGPKG06LgyqOe4hYx1Agl5SuYTOp2ITD/fPnM9zwNK7nSUbgnyYjK?= =?us-ascii?Q?/YCWd4G4vVsT0J74X/Rv/YNoCHUtiL1mjO9scSerd5p2lW36Pg=3D=3D?= X-Forefront-Antispam-Report: CIP:178.72.21.4; CTRY:DK; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:localhost.localdomain; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: xwSkjNoQ5DBQcJrAJvJn6RRFcvzeyo8R8UoCc8eHhNUQ8tKZF2ksdyCxoJN8NM7tYbz8U9TQVJbTOrZZDaCI4IgrXVaN6+SkctnH9tCUf9m1eC4dKYfBYpwxif/K5h2yVPsPY+HeBKn74Aft2JaS/2I6hABBCufDGhu12bCATD0MJQzUhOKDTBAZrq62lEpRH4iB+sP3NDQJgBVHTYxXC6ERblhhEf7I330uQTBjBYOdNUswb0QpRgjTXZ6Q95QN3xRtNScMyjIH/BUzrXCsfQiqV3ZoAFZr2ie4pCU/2ujd5TgIENZCtgsSsMN4kuW1DD/h5smlRUW9QGOzBxi17rWkbNwwSqlsTNN1TEvakY2MEzJ7c/zUQM97PnOErNA412ng8VIA0vsZXepydG1+Ueas/AdNatbowzqEdHi9HbX7bL+4b6H/CBjirD6U1Ame6UfYKCNnwrornhQ4fqgZR1GCBn2P8LX/PaYfb0kaW1d3gc9NweGlDgIWBR11S0AykEf6/E4uILqEAhttvVh3pqbBNE6EsFadB27QUSuxGDbnZDJffthZvB5WyRX74jY+plCLUZE+w/9r2tbf5boGt/+r9jOIOHRATQ+zDZGnwhDBt9cu0TmKYCIHWArXDPvSsHM6Yis7LhygAXcgvPxFyJUAD/YudSqHtJ2wmfd0Nv8= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 16:56:07.6374 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61f09a36-f4e8-4d3d-1dd9-08dcf2ba6c93 X-MS-Exchange-CrossTenant-Id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c4540d0b-728a-4233-9da5-9ea30c7ec3ed; Ip=[178.72.21.4]; Helo=[localhost.localdomain] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF0001E9C2.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P190MB1140 X-BESS-ID: 1729616173-303894-12664-13507-2 X-BESS-VER: 2019.1_20241018.1852 X-BESS-Apparent-Source-IP: 104.47.17.107 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVkbGFpZAVgZQMDE5NcXSyCQpLc U0Jc0oJTE5JcXSNNkgySzRzDQxzTBZqTYWAHVOz+1BAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259901 [from cloudscan12-68.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 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 Add possibility to use RTE_FLOW_ACTION_TYPE_QUEUE Signed-off-by: Serhii Iliushyk --- doc/guides/nics/features/ntnic.ini | 1 + .../profile_inline/flow_api_profile_inline.c | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/doc/guides/nics/features/ntnic.ini b/doc/guides/nics/features/ntnic.ini index 1c653fd5a0..5b3c26da05 100644 --- a/doc/guides/nics/features/ntnic.ini +++ b/doc/guides/nics/features/ntnic.ini @@ -18,3 +18,4 @@ any = Y [rte_flow actions] port_id = Y +queue = Y diff --git a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c index 0f136ee164..a3fe2fe902 100644 --- a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c @@ -23,6 +23,15 @@ static void *flm_lrn_queue_arr; +static int rx_queue_idx_to_hw_id(const struct flow_eth_dev *dev, int id) +{ + for (int i = 0; i < dev->num_queues; ++i) + if (dev->rx_queue[i].id == id) + return dev->rx_queue[i].hw_id; + + return -1; +} + struct flm_flow_key_def_s { union { struct { @@ -349,6 +358,34 @@ static int interpret_flow_actions(const struct flow_eth_dev *dev, break; + case RTE_FLOW_ACTION_TYPE_QUEUE: + NT_LOG(DBG, FILTER, "Dev:%p: RTE_FLOW_ACTION_TYPE_QUEUE", dev); + + if (action[aidx].conf) { + struct rte_flow_action_queue queue_tmp; + const struct rte_flow_action_queue *queue = + memcpy_mask_if(&queue_tmp, action[aidx].conf, + action_mask ? action_mask[aidx].conf : NULL, + sizeof(struct rte_flow_action_queue)); + + int hw_id = rx_queue_idx_to_hw_id(dev, queue->index); + + fd->dst_id[fd->dst_num_avail].owning_port_id = dev->port; + fd->dst_id[fd->dst_num_avail].id = hw_id; + fd->dst_id[fd->dst_num_avail].type = PORT_VIRT; + fd->dst_id[fd->dst_num_avail].active = 1; + fd->dst_num_avail++; + + NT_LOG(DBG, FILTER, + "Dev:%p: RTE_FLOW_ACTION_TYPE_QUEUE port %u, queue index: %u, hw id %u", + dev, dev->port, queue->index, hw_id); + + fd->full_offload = 0; + *num_queues += 1; + } + + break; + default: NT_LOG(ERR, FILTER, "Invalid or unsupported flow action received - %i", action[aidx].type); -- 2.45.0