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 B9F8945B96; Mon, 21 Oct 2024 23:06:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 101D840B90; Mon, 21 Oct 2024 23:05:55 +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 A117C4067B for ; Mon, 21 Oct 2024 23:05:42 +0200 (CEST) Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03lp2104.outbound.protection.outlook.com [104.47.30.104]) by mx-outbound46-162.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 21 Oct 2024 21:05:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Kucmn2UJEmpfywoc7P7e8PB1tlY7O/d5haQuyXmHP2ENnHOnORPorlyXvDI1tGIKlc2B+HnSaIkeSRr44g9/7DexIDERfIZ3w9GLID3hWtN4CI1d+smJ0g8eKFr/YvmCHD7WD6a5WWoHP68t4yulgCMjZgzq0yeu8OyapRLm8YUG8kwgNbSSRR4fxFfsf7yqsnu0gclITEPG9aIcIXIHcl9+feBJy5fd107sqjYmuEZ03d2dHZBS2zGwm/4kygB2GxYFUYlA9zxc602UbYAt6KFf7G7t8Kck9G3HOJxelwbQ4FEAm+4sLUjGvF8UBIheu2S4WFlKdaJmhx0BM1XdfA== 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=JixVWIgTPj2MXQfU5talhUVbsVe80Uhp7V0/4c97DAk=; b=r7jV9/qk7ew/o+9QuDBNLi6Wyw57tXghPkAcWDKaUbgOrri4J4iXNv0XKxGPr82x05C2JUfY0Or/HLCcf7YvQMLHXTCL4SURHPRxyguJdJRzJ0e3U5Lo/am4wJ5x7XVcqs5NWCsFWe+5kE/nirWp8xMKCzWMg4LsNMlhPFJm6snlw/ZrJ7Ss3rvVx0NQhnjGQqpSFx1fmqL+wCc8KXUS57gF6BI+9sniwxSRmPIy9p5NYdKBRkZzY45vhxL98AGH6+4VURLM91cFIiw9dP15HGcWzz6EYjZWikQCyFGOzTinWZIxkWdWkG8G1nzd0N4NH1inv1EGYfc22HNRjBHqcQ== 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=JixVWIgTPj2MXQfU5talhUVbsVe80Uhp7V0/4c97DAk=; b=T0C6CpVGzBPi4zCGqW7bLsw1hAftZsb6/gbGkFtBe3SFTIP8IdC7phSACYBmE6VIiq4pejBe/IOU0po1Mn46462Ut64MEVobyg0nCOilQHQtPbIHcbETUoeFHrRI3+CcnswH5NnZXYQJ0Zy2sB+nnn4B804+2jhNyCSOT18gkv0= Received: from AS9PR04CA0152.eurprd04.prod.outlook.com (2603:10a6:20b:48a::26) by VE1P190MB0831.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:1b2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Mon, 21 Oct 2024 21:05:38 +0000 Received: from AMS0EPF000001A8.eurprd05.prod.outlook.com (2603:10a6:20b:48a:cafe::cf) by AS9PR04CA0152.outlook.office365.com (2603:10a6:20b:48a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Mon, 21 Oct 2024 21:05:38 +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 AMS0EPF000001A8.mail.protection.outlook.com (10.167.16.148) with Microsoft SMTP Server id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:05:38 +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 v1 10/73] net/ntnic: add action queue Date: Mon, 21 Oct 2024 23:04:12 +0200 Message-ID: <20241021210527.2075431-11-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241021210527.2075431-1-sil-plv@napatech.com> References: <20241021210527.2075431-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF000001A8:EE_|VE1P190MB0831:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 80bb3a8a-66a5-49d2-b29f-08dcf2141d79 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?YhLBDFMntqjhuRfmG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5p4wGbC0it4M?= =?us-ascii?Q?GNXGOt6UpMpzac+ay7eTgT1q59Can8stdTz/xDwp366dEcPpXBIewXaHywZk?= =?us-ascii?Q?lcDfcBB3vZMMY8aYg6zdWMrel4sWv1E/bs012rR7ySjQAY4iP3VcENlBIOvj?= =?us-ascii?Q?QLh+VXvywMbxU6UTCmTZPJD07vlVdEVgYYOjwCq8zLNjsN2/rt+L+p5CchxF?= =?us-ascii?Q?Gj1mm6OZl2MWtlC4QSe1dwhcxS2++j5Gcr81d6zGC9caD0/djzuGXNuCOKUg?= =?us-ascii?Q?xN0uJCJoQfa3o4ASrr3Y/c8MDPnWCROidmqzz5cv1E7c5Guc4W0n4ZRt3yRL?= =?us-ascii?Q?vozOEodtQ+N8RVoYGpoDRyZ9FtV0Izu06Ygpunl954Vlq2Ms1UYLpJ6nEDBX?= =?us-ascii?Q?DtfQ97fgvA/RplLQ97kHPFS/kiadpyPSO/aou5C3MqpSvmHq5PgBPRCmXRwH?= =?us-ascii?Q?cqyLruUzXyLWhtAHJVG3jHKXQ33d8OFBoFCAMFY7zr89s8DXvVy0W5iGVdww?= =?us-ascii?Q?pBGnLCQnEDC69kgslbJxh64G4v/y5QIevvL/lMX+bdWi6BVdpg=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)(36860700013)(376014)(82310400026)(1800799024); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: g13KOWJ2+y7lsQILN3k5IiD7DMKUXkiMrycgP2OzPTzOug+4k5nSZzomZ5ynNxzswE7OiNXMh7tS/GphWJy+Vgytj0mi2cghZ5f+/LkRUnF/JUxSSst0+O8+gEM4aBUHd6/GrkS/HjZx5mMD7QlTxvL5rDt/lT85HpE+MfdpwvsxavaGIAub1U4MtRs4Qa9FXZLdRcqHeksfCBQiLO2orZdG0jzv0K87fTZVz8hq5XgAFVv60kUEGxxFpmnmzlLfZXx8bmUHyk3wnJKxxkdmmE9R900c9lniig7hnybTyP8sJnvyIYdS6cN6Eb306w0gjPuseNi11DcLkbynoeAit7E2+NoOUCNhexe2bUy+5Po/AfB1Dlp/PDH0WfJbD+dU09OmgOXL8axlX61kN7MTgmvP85EOMsFv8aND+DgRgOOHHN2jWQaLom/0t/+J4HafFQDwqazqAQHu1Dw4tkCccnnGeBl43nLyGFO40Je6ABHe2vEnmO7+JRM9eE+VM/br0rpSeWHVErhCzU28bRpbISrEwMqtxZqtkPNecpTqEKNQU/iKFHndWcmFGIPnKVfnLzKHrkrb+Q2bdC+yXA4tIGFKenCF9Ifx4ypXbxZRE0EFfWGE39/UetKZ4FDS8BUV6acEJUi4YZPAyvT+vc6wkWoq69JHeme8GPtRRJOaN4U= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:05:38.6144 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 80bb3a8a-66a5-49d2-b29f-08dcf2141d79 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: AMS0EPF000001A8.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1P190MB0831 X-BESS-ID: 1729544741-311938-13027-41076-1 X-BESS-VER: 2019.1_20241018.1852 X-BESS-Apparent-Source-IP: 104.47.30.104 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVkbGFpZAVgZQ0CzZ0tjQ1MwsLT nRzDTF2DIxNdXC3BBEJ5klppgZKNXGAgAzer8QQQAAAA== X-BESS-Outbound-Spam-Score: 0.50 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259883 [from cloudscan9-212.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.50 BSF_RULE7568M META: Custom Rule 7568M 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.50 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_RULE7568M, 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 fa40f15c0c..ec22c63b85 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 @@ -22,6 +22,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 { @@ -348,6 +357,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