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 B816345BB4; Wed, 23 Oct 2024 19:02:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92B0542F53; Wed, 23 Oct 2024 19:01:06 +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 AA76542EF2 for ; Wed, 23 Oct 2024 19:00:55 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2110.outbound.protection.outlook.com [104.47.17.110]) by mx-outbound42-14.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 23 Oct 2024 17:00:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Q3iyP+UMFaOgdVm9mUM3afpMkn4dTFtDvZyavbZmmSrSvUL8gO659tD5juK1Df3Yaviiu6cX0NkN6TX8Qgi2wtm/4HGXO9uRGfkctt1IXcBVvFs6s9/Nt2UdizHUX7YqTCKcqId1lZv4N0oWkwyzI5YIynGY4/GSAJVfzt0vcu9GO4+mx4MYS2Vp1tPwbxACcEo/Nhp/DG25n9yz4SdvxnEUemuMuWTwYBjWSqHirYmignWKvjIJhBsijXgk1Z/mNW21l2lscXnYTF9Kw3uofV7bHakREhNXxuTG3eTHhELEPEGJJPLlxxa4B7+mi9EvbiyQdC5scC72LEj4GJAgOg== 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=Fey7Glyf4cabYh1rhqUoMkTXf5xvTsq+Vxnv4tYqimEh6AM+T9HJauUt+Pied/68ldU3yKsW0AmtoWVRDAn/wpiniIikMJRc8VvrmAWPDyckosibVr5n/VI7FU4nNvrl1O0pyUevEy8le0OQGYf/GDhhQltbk/RzsweuqQqQA9iyTZpwrtlzrm0WU5mbeb9xj6Ces3JZCrA3B8tXkM7dQd9eSXhnXMlla2VnETe92NGF7bwCjxB/3YQUiUx3LFbnZRCQbvmbfAOjvKOoxXEA2X+km9JMLow9ZNZG2fSCfBKLAVjKKeRi06VgsLq6j/AsaLDKCa6DqtMYgY3xRN9Z7w== 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=U5W9mcva89nQV9AbiwvBajfIAS2Y3gVVCOIfwyQ5zNjhAQkgoOk//g2zgCmLz/FeHyA9JNhZsXMpMAtSQX6linTCMez6hzn0DNpKjgiayaX9C/3grOEkIhrnx+REqKw2K69TPtyHbBon1tJ2//1h0VHL6dBPnkaxzy+cUpJs2mM= Received: from DU7PR01CA0015.eurprd01.prod.exchangelabs.com (2603:10a6:10:50f::13) by GV1P190MB1969.EURP190.PROD.OUTLOOK.COM (2603:10a6:150:55::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Wed, 23 Oct 2024 17:00:50 +0000 Received: from DB5PEPF00014B9E.eurprd02.prod.outlook.com (2603:10a6:10:50f:cafe::67) by DU7PR01CA0015.outlook.office365.com (2603:10a6:10:50f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17 via Frontend Transport; Wed, 23 Oct 2024 17:00:49 +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 DB5PEPF00014B9E.mail.protection.outlook.com (10.167.8.171) with Microsoft SMTP Server id 15.20.8093.14 via Frontend Transport; Wed, 23 Oct 2024 17:00:49 +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 Subject: [PATCH v3 10/73] net/ntnic: add action queue Date: Wed, 23 Oct 2024 18:59:18 +0200 Message-ID: <20241023170032.314155-11-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241023170032.314155-1-sil-plv@napatech.com> References: <20241021210527.2075431-1-sil-plv@napatech.com> <20241023170032.314155-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5PEPF00014B9E:EE_|GV1P190MB1969:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 9771b1b8-e0a1-4a95-8276-08dcf3843f1b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info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/j+QgHTA5lzsLjVehpSVnNlwXmvj618wriaRy1jaYF?= =?us-ascii?Q?/KkXREWcFgqEDkwL0jQjb9zqy+kFTK1ygwEA0bTyGofTQ1y22vJWiM4G1P/n?= =?us-ascii?Q?pKNbyPIe0vToLPCIzlcdLuxNEuZ6ZNOMNDDxGm4idjIi4o0sUvz3iBOX+7QT?= =?us-ascii?Q?RM7kCklHNGyJRgKkI84jC1lBzkCXY0RzLVXM+QR9kXvJ5t3LBhiKyOT8jzLI?= =?us-ascii?Q?OsUtaPRbKpzAV1eKWHazc7dX37K0ReYZteCjTo0zX2ki9FGRZzfE54wlHMf1?= =?us-ascii?Q?AMHXpP+324cdrfGcgYOj+HfFKzu7f2FT6qeP9M/UyZGlld+Q8OJaFJLzVp8p?= =?us-ascii?Q?37SXG+1MfJf51t9S1zJNjg2CtG3UgD9qsqadGCE458zkbfO6DHbL2bxXaezA?= =?us-ascii?Q?2Iwfco7jTOpm5HqeLiWpCjzbcWjQ0tU3FUzjILSJWAIqXISGtqIf0XrHMHel?= =?us-ascii?Q?rvnbxfLOnektqtv72/4rSNcLkQGotM7iaNEiwp2VaIdJ1l3EOZEN3c0Koq5+?= =?us-ascii?Q?ZGHmowFM36Q/HfY2pGhz83cuAOCxCQhok9dnHKVTknEdKkGI8g=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)(36860700013)(376014)(1800799024); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: VKMq94dnGRhnVoF8r8Mh0tmK245j8cU7Mrk987y+Uh5h3uyq7q0E6pn3hAV5CcAKjac9x9GHxCmuk+Rw/Ho4WoBqaaJDwFraPTPLRxqpslgUJPDOs9NLsG2gTl7aAJgFdt1P6OIX38+OqwwU7j0QZ4CSzuv656txCszdaevABTwsNkcCRfSd/ul+1GjrSeqCBrXfsVjGZb7LCMPDx623gyA48WbLVCLtC/rhs16GvEuj6sqRFoggBnriyr37/WhKbbCT9F7euY3UYl2SV3PxvGyZTqdabTiPMfY63CiqwPqfnBuehH/fea8fsH2D7aJtudY2Nk3qJmNAy5qxzJ0Vh+W4hohB92fWsYQ1t8CxD5smFldsk2tCo3O6/5sfhmb7xfTLXLMjLtE8b0PHnED2ie+o61OAW9IJ96EwjbFGuCNittagZmenPn/CHEHR4/MCtaWuk39SJpNAtCKbcIclGCO2uZdYRhPtNYsOarpNg81Cniqlx3DMuqnlKa2576K4t+WerJE/Q9PqruI2IrJu0R1KZMxdDmhGitEHnK8J/dKTqjucqCFoXIv1fvuNr1SYtEDxbvYUPzy3/ujWXyfRna1iVyfyZPFZ3s0tirq7I3G+8kabDeraSrNa4q6gmp6f/I0II/pc5CtHVKxx9gX2GJqbD7e8IR/y3tg2jwJqxHY= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2024 17:00:49.7424 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9771b1b8-e0a1-4a95-8276-08dcf3843f1b 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: DB5PEPF00014B9E.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1P190MB1969 X-BESS-ID: 1729702853-310766-12807-42079-2 X-BESS-VER: 2019.1_20241018.1852 X-BESS-Apparent-Source-IP: 104.47.17.110 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.259925 [from cloudscan19-22.eu-central-1b.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