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 4F02F45BC0; Tue, 29 Oct 2024 17:44:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A64642F0C; Tue, 29 Oct 2024 17:43:13 +0100 (CET) Received: from egress-ip11b.ess.de.barracuda.com (egress-ip11b.ess.de.barracuda.com [18.185.115.215]) by mails.dpdk.org (Postfix) with ESMTP id E498542EB8 for ; Tue, 29 Oct 2024 17:43:01 +0100 (CET) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02lp2240.outbound.protection.outlook.com [104.47.11.240]) by mx-outbound17-86.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 29 Oct 2024 16:42:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jZ4IJ+NdR8llW0vMODJXdq7llWI8BgFmBmyJ4yDSUeGqU5wCjsMqYEUf3gM5y7VuOqCIApsnqoo7PDBxpjKAoLEEK2SLZ2eRT4Z7KYgzhr/GHK5XOvjOxbg5sPUaGzcBx2E4ua38AJYOTJak1SR2i+VySx96XOvvwQGmw0FRi/4ITzQ6qKn775szwqPp3+4oGYfgPcyBr5mhnJA3o6Fgcf0WurpUTq0V/4SciId3pxl3YNKjK7gkKSQxchFpUfiBNJE5RJ5I6BBYizsMjmGqMftHX5ZX8IeFAnADTRPM7+PhBl2mtU6L+urAK8f2CNrwZkdfViDT/gZY7Y6Lvw9+HQ== 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=Ex5NqMwuAS4+JdavRrx0HsEr5GhfliN8AjioQDp+60dxDnbHDlflLRn91WLiGgbkxyo/zy1uB1PHkZI7pgjRiw0ujp9CBDsJpkF431QjcH3ALgqrS5hhzNIgxsQCnOjdvu56LhRfc048NStVVdp8ukqhqpkH5iHjmaRYmDPBuLNvCG+MIb4FPvR1n2nkhP9trx+Z815qrgL0UVpL4DxgRHmIOOf+WIuRxF56lYNpv0s3tm24ocU9iO2hQBBskDzQXopD/TBbiojWmVJDx7d4Nu3mqEz1SRcNvcmVp0Vv1a/TQJg6qksw7jEztiBZkDZckOolE8G+efBOgYnORKRTfg== 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=XI/DYt4aAvsZmat6ZSninQqbNf6HgsC9D8wk8Y8/1sf90ScWIatoJ4tK836HTpU4BctDNzP+ESPQlhT9jdRNU3VLJG5OiAj40NFeP1JiyoBPrIQAupdicT0lPmYxEP8Hy7ZGnRGW6Vsc1hZWbjLfZ83BLzSaKgdNvAZZWzhUOgc= Received: from DUZPR01CA0191.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b6::20) by AM9P190MB1106.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:270::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 16:42:56 +0000 Received: from DU2PEPF00028D06.eurprd03.prod.outlook.com (2603:10a6:10:4b6:cafe::b9) by DUZPR01CA0191.outlook.office365.com (2603:10a6:10:4b6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.29 via Frontend Transport; Tue, 29 Oct 2024 16:42:56 +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 DU2PEPF00028D06.mail.protection.outlook.com (10.167.242.166) with Microsoft SMTP Server id 15.20.8114.16 via Frontend Transport; Tue, 29 Oct 2024 16:42:56 +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 v4 10/86] net/ntnic: add action queue Date: Tue, 29 Oct 2024 17:41:14 +0100 Message-ID: <20241029164243.1648775-11-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241029164243.1648775-1-sil-plv@napatech.com> References: <20241021210527.2075431-1-sil-plv@napatech.com> <20241029164243.1648775-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PEPF00028D06:EE_|AM9P190MB1106:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: e329cc84-610c-4162-a96d-08dcf838bdd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|36860700013|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wu7jNZAJFT4i2jdI6JC+z8cE8kP+2RGyuc5vxqR5wgZj7ntSEXcr2EuVXT?= =?us-ascii?Q?I56kZyrRRUdUbEvzhnIuUFStxz9Yn5G0tv6zKLLYoIBb6WxSdZCM7URQ02aN?= =?us-ascii?Q?6TBeK+FBP8WVakapyBv5268XgwFgnXxU1hB+heOklV42bDmKvUCm+Q1faRId?= =?us-ascii?Q?UG1ybnjK8e3GMF270m/f7KFtKoVW226Caipjb56XYAM671QlFlNAHeelWWDv?= =?us-ascii?Q?+C7q93PKcKvr8iqBN4hbfbfRfX1SHDXHdNvMiC5YVHXO2HUtBdLNuTIN956K?= =?us-ascii?Q?LMJ8Pi2ZKBrgyQ0DJp4DjgCsBfnsHqMrC6Chw8Lo7/1iNx+vo6NXksEiROJ+?= =?us-ascii?Q?B9Ip913Szc83CPHM0L+Zp3yagJUqfgbWmHj3BIOJ39nBHzdKKwyN0CnaNqow?= =?us-ascii?Q?shY9Q8CcUvY6P2SF/IMbfDQmXPPggIy8RTgfkh9i0VMxEd4cYsk/n4t+Boks?= =?us-ascii?Q?sZ8Qm0byfNM00SMKu9oPTmHn1IOw49soRLXxtdPtyTkdYbYufi6+GEK76ZBW?= =?us-ascii?Q?h7hG5JLcULwxa8SvwV9cTiTKuPfuwqjx377ejMcUr76zdZeEEA=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)(376014)(36860700013)(1800799024); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: q1UgSVwGiNoTEWEitwqknqJCGeflKnQio4DcrO31tTXxn1A7SQu2KO1hMk42FH7VB6mAniry/YIvyuE5url2/GU6EGWev2p5hFKrTCMMrdRuAvWZKfSzgHRYWN3dR0CMUHxugSFvVrdaiuH52GZxzQDdSqiyyNQzWdq/qTzrEFPurwTWJMupoSusm1N0Evpwm+Eyt8PekfJ9f3XW4FlWMkkFqXqeILmFerDF/AgQ3QPnvr5/Q59/U+yhVPO7WpHCIzsTMIJJu/J7P+Zvy7elTTFEuAG6zoDZ09mXR2hJcpRqq0lVgLnEfQMdmMZPmf1COITo8DSrgFwcSaW2t1Pert6QK2Fzag9UH+igg2QAWXDOolrxJK1xS1KAnh8qsP1bkcMPIIsBCzRku0mGug92RfZDAL8qaBgWJb/8bWYRRN+IdIcwC5+xW6m+eMK0e/56PgvCrR5zUb0bx2Be0vjGR7HxZ5VKJG6rR1z5VygJVGTUl+jDbh2/WCU3awEA7yedd4jgTyT1+vxqvJTC1LYVggNT94HLUVWdmUe+1MCdaAqiiYdZ3uXhLdWakUeh1KhoK3EoeQIC3Uowul9uwTdhHBhkkqFrei+QgP5+Ko1mAVT+DmlbjbuPEzFRAph63tBtKB9ans1ADi9mBKvi/jn34u/s9YbIP81FoGIFa0mf88Y= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 16:42:56.3864 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e329cc84-610c-4162-a96d-08dcf838bdd5 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: DU2PEPF00028D06.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P190MB1106 X-BESS-ID: 1730220179-304438-12708-29921-1 X-BESS-VER: 2019.1_20241018.1852 X-BESS-Apparent-Source-IP: 104.47.11.240 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.260063 [from cloudscan19-202.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