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 A4F5E45B04; Thu, 10 Oct 2024 16:20:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F25FF427AA; Thu, 10 Oct 2024 16:15:46 +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 172B640ED1 for ; Thu, 10 Oct 2024 16:15:22 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2177.outbound.protection.outlook.com [104.47.17.177]) by mx-outbound11-198.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Oct 2024 14:15:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=juVwfnnYJRQbkVo5NPAhKQQzuU1O1rrgEbGY8+qBER5cFZiran/iTV0GH11F4R7g/T7JJ0ghPE2UgvohdlLNkXqlqNSJPDS27y/5tu8lbTgpUA/oMbl0bD8khjTNNBAqcar/iuQ6GsaL7eFuie69gJa4WTbz1LttxSknbkOZ1NCtazF0CJRKhwc4dsBrg/tqXEkilKtjZcliCBfkKI/oJGBRmem1ZyQdp16YtkQA1bqFwYe+1CeK8o+jOto5mDg8f5LVUEXGsi2YEL2l4t+r5IDdmLKF6W1DO8GW+fAtjxSjkpF14ZQfYqaTkX331xadRv+FVKoAd6rxtOnPDx4eoA== 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=4AApl7PaZ53oi1AVMGsGybMSUPl6WAYFfDt0CeC6ToA=; b=e31I2k6GC/GqOzTNHjlHU2WEJPr1CwNiWYA8J+Dsaw4Ob2zUREuPN4Ywwm9nHg4OquJrUR7Pt/7JXy7AC2/ErytX2gZVWJcNrkUQZ7kaU2gCmOHdGBnIfy6bQv4fwbqssi9u9PzI3akFVJ80rf7STd6OvcLfaqDFyxvUn3QBM420BLZ3A+wgEXqJ7lMcmEcGqfDT9HgEBLs6Y4wyOD2N/ecj0vb7fHZ6P+Q0Cn914zUNabjE//7lGUcbWsmdfOyoBZGRXGhb+qkQLMbHhYC4Ry1ar0a/P09rcXmD0N52e1BwPI11J8rFxVgXGae11ffojAGvJQsjhKVXza/Rc0mDOw== 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=4AApl7PaZ53oi1AVMGsGybMSUPl6WAYFfDt0CeC6ToA=; b=VDLHZsmUfNwtUEbEUCrSWmVX5egcDwo1GZor9xOSvtAMyLdfWSjSFLYyFZHI89YL3k5rBMt5aVYqgugPvlvF4l8nTZrXvmqRpcWdtwSCvvi0+PhpvNk0GtzxIpq44c3hFwbowL9mcYWEcD6rIyTNJm18TweyGoQov459QJkbrRY= Received: from DU2PR04CA0061.eurprd04.prod.outlook.com (2603:10a6:10:232::6) by PA4P190MB1344.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:10d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.27; Thu, 10 Oct 2024 14:15:14 +0000 Received: from DU6PEPF0000B61B.eurprd02.prod.outlook.com (2603:10a6:10:232:cafe::4f) by DU2PR04CA0061.outlook.office365.com (2603:10a6:10:232::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18 via Frontend Transport; Thu, 10 Oct 2024 14:15:14 +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 DU6PEPF0000B61B.mail.protection.outlook.com (10.167.8.132) with Microsoft SMTP Server id 15.20.8048.13 via Frontend Transport; Thu, 10 Oct 2024 14:15:14 +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, Danylo Vodopianov Subject: [PATCH v3 48/50] net/ntnic: virtqueue setup managed packed-ring was added Date: Thu, 10 Oct 2024 16:14:03 +0200 Message-ID: <20241010141416.4063591-49-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241010141416.4063591-1-sil-plv@napatech.com> References: <20241006203728.330792-2-sil-plv@napatech.com> <20241010141416.4063591-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B61B:EE_|PA4P190MB1344:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: c61c87d4-9ccf-431f-e701-08dce935f5bf 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: =?us-ascii?Q?ciRnI3EJxycBCSBQgPNqp5lD1JZS5IHYtz2nR0ORPPzjUqF6t9VDaaoeu4m6?= =?us-ascii?Q?NvM3OmcdbbeKNCqgv9Yk/3wi39qhqLhlEITx6Na3AGnJhPq7+1hv4bhJoxRv?= =?us-ascii?Q?88M7/o0zleoV2xdM+xuEdlLzNfot6P7YnjDqfhv2fhpN5XqPJ6RE8OLX+xIN?= =?us-ascii?Q?ctg3KGYH0TU4/Vc0cL0zhSRDr8+NVIJoH17eE2PnWQ4ZiQfRbZoE6VdP5I+1?= =?us-ascii?Q?OpfoNd9zsJcIrYiakmyHVlraJhXcO0hsRrm6dsDD8SYI7I0yqpDBUaCb8S1E?= =?us-ascii?Q?EqEZr7lZGOGg+9f0b7kI6vmZQbZqAAKTDudmsG6jpXGdRazEys4hHr1EHn0Z?= =?us-ascii?Q?frGjq+rp+XxUH8bGMzkOdEFtG0l9QqvZtkbyJBcN30JhuXSd6eK235VBfmsj?= =?us-ascii?Q?skDueN1b5Xl/TH8uXKu7LxZ9NdvHUe7k2QH9Xw9zdhmRus11q6ttE6WkBgbR?= =?us-ascii?Q?oIhNWZjc0SoSY9ogU9MIyTNKn/WTWQHkioo/l8FdLqkQe8A4T59A5SeCAGlT?= =?us-ascii?Q?HgrKlo6qa8keujwo/8FGFs6j+oNVmdDgymggSqO2de/yd+sCWv4UGKsfEdyi?= =?us-ascii?Q?YsKB9/KT7BulUSalv1Q1V5qKpZ/XybNP3FokkaNoG+EbsScbyzi55XfG/AlF?= =?us-ascii?Q?l90aI2onZk6koWO00FpK97Lts0HAwZFevwpEDanAknDDD2PFxSed8BIV94Fn?= =?us-ascii?Q?sEp/hDHCRrrynU54lqxDhForLGvHcfA/vph8qFj+lDUvHzHhdHbkc4KEeNEe?= =?us-ascii?Q?WYvr97OsBvoIcDIDeLEame0xmn/1RK+o4ptfX994/CY//V85COGql+HNLc/X?= =?us-ascii?Q?satWrL5tHzclOsYdS/g7R+ipixeXjLc4Y6giT7hl3q1HrFUeqF5DG+fzdfyu?= =?us-ascii?Q?ygcgpgyhaDKNCi8SBsdJH6aYZrOrexyDhUvtqogR0GRhcOmhmWM4Mw0csK1S?= =?us-ascii?Q?oKlXPVOLeY4RZ1cofXfec4KGgruStxGAgOuGjBKuTCNLY0ZZjEoYaKOAcGV+?= =?us-ascii?Q?BTzFtr770He3q5vSHQHT1kM31g/XMmxFf3na79Y0Int3c/JTnysVUU45LbIe?= =?us-ascii?Q?rbU3aKsh53Ad/1BHYHf2T2BbvY4dY79RzJCBEgEueX1agBiVRbRm5lDpmec+?= =?us-ascii?Q?JeFGWkWH0cOg+Abr8ovokC7PtDxXXh/9THRx060ER9Us+8pQvLaNp509leUc?= =?us-ascii?Q?/cVjfM0JY2+ynpRQUDtcfbp7F5RwBwQVnUAhS9zFbUZoxJ542MF9WHlFKWcw?= =?us-ascii?Q?65LHSDlV4VQjugWdNiKb/jzTsv6gVvjH7kr/VlTx095c8U4k+XCOY9SH9SCk?= =?us-ascii?Q?iOtHrmGKT1Gs0lHQlIkR4aDGducT8Cynh0WFFrhm3iRnwNZjfioBsAVylNF6?= =?us-ascii?Q?ipu+PmsJqPvbSzuNaZ+/1z+PisXs?= 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: 5vKGoOeocJbJ3hhl6pJrSgk8/EfK+JYbvjVLPoKeHP9Ao+dQosdWfyWijjDOXJnlMfuCMipZDev/zhCVt9FR5KSoUkI4mKGlm15+KfQfl9unb5N12RkWPxgtsf49Sqo3kZHr6sYlud+octZ7GuzlYhsZllozoMRXXQ6ylm61nkRb6y9Rwy4gohmJp79TBsBm2l/HqiOQt0Qf8s5DfX/eTa7ZWnMAUUiaQ8ixBEmfua+vFwzi2xpN53Qwk9961wD1/lXinG7BHtUVJr6RrS/bCy5jeX8dxwL4/83UkzQmP73En2g28NmlZE0y3gF2rrSL6biM+GSWRaorjmi0Xup1aiBEg93DuhU0pOk0TtAJO8ZTkyTEh4BYTrVakMYPFwF6UyxQ1ryRzmJauIlotGSNJdGb6+SiVOLw2i+WLt6Hbj+yyfUPRTwtXtm1JCNZcZwrhmHvocPP6ksstRxpsaG8uP8AApt1KA8GkdjO3jh/dia+0h02NHyRYAe0Pbjt65lm49/I+jlI98DB4aprbYpcTOLoAmEzV64js7Oup36VuR4+fwqiRXVyhozx6Xn+U7h/EGOo0txBjQSmXqU2IINyFtlpzRW9ZK9PjSsFvF3DPozMdv1SZBaPEWX42p3nqX5cwTE+QpTIB8RqO5vkpVFERIBF1235DHm8kBBJZzB0jgE= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 14:15:14.2488 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c61c87d4-9ccf-431f-e701-08dce935f5bf 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: DU6PEPF0000B61B.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4P190MB1344 X-BESS-ID: 1728569716-303014-12769-25666-2 X-BESS-VER: 2019.1_20241004.2057 X-BESS-Apparent-Source-IP: 104.47.17.177 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVhZmliZAVgZQMMXSxCzJwDjZ0M QkydDYNCnRJNHEJDUt2dIoNc3cMMVMqTYWAGDCKxpBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259630 [from cloudscan21-124.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 From: Danylo Vodopianov Structures were enhanced with PACKED virtqueue fields. Managed function was extended with packed ring configuration and initialization support. Signed-off-by: Danylo Vodopianov --- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 191 +++++++++++++++++- drivers/net/ntnic/include/ntnic_virt_queue.h | 27 +++ 2 files changed, 208 insertions(+), 10 deletions(-) diff --git a/drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c b/drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c index be241eb057..474138c3ca 100644 --- a/drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +++ b/drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c @@ -69,16 +69,33 @@ enum nthw_virt_queue_usage { struct nthw_virt_queue { /* Pointers to virt-queue structs */ - struct { - /* SPLIT virtqueue */ - struct virtq_avail *p_avail; - struct virtq_used *p_used; - struct virtq_desc *p_desc; - /* Control variables for virt-queue structs */ - uint16_t am_idx; - uint16_t used_idx; - uint16_t cached_idx; - uint16_t tx_descr_avail_idx; + union { + struct { + /* SPLIT virtqueue */ + struct virtq_avail *p_avail; + struct virtq_used *p_used; + struct virtq_desc *p_desc; + /* Control variables for virt-queue structs */ + uint16_t am_idx; + uint16_t used_idx; + uint16_t cached_idx; + uint16_t tx_descr_avail_idx; + }; + struct { + /* PACKED virtqueue */ + struct pvirtq_event_suppress *driver_event; + struct pvirtq_event_suppress *device_event; + struct pvirtq_desc *desc; + /* + * when in-order release used Tx packets from FPGA it may collapse + * into a batch. When getting new Tx buffers we may only need + * partial + */ + uint16_t next_avail; + uint16_t next_used; + uint16_t avail_wrap_count; + uint16_t used_wrap_count; + }; }; /* Array with packet buffers */ @@ -108,6 +125,11 @@ struct nthw_virt_queue { void *desc_struct_phys_addr; }; +struct pvirtq_struct_layout_s { + size_t driver_event_offset; + size_t device_event_offset; +}; + static struct nthw_virt_queue rxvq[MAX_VIRT_QUEUES]; static struct nthw_virt_queue txvq[MAX_VIRT_QUEUES]; @@ -606,6 +628,143 @@ nthw_setup_mngd_tx_virt_queue_split(nthw_dbs_t *p_nthw_dbs, return &txvq[index]; } +/* + * Packed Ring + */ +static int nthw_setup_managed_virt_queue_packed(struct nthw_virt_queue *vq, + struct pvirtq_struct_layout_s *pvirtq_layout, + struct nthw_memory_descriptor *p_virt_struct_area, + struct nthw_memory_descriptor *p_packet_buffers, + uint16_t flags, + int rx) +{ + /* page aligned */ + assert(((uintptr_t)p_virt_struct_area->phys_addr & 0xfff) == 0); + assert(p_packet_buffers); + + /* clean canvas */ + memset(p_virt_struct_area->virt_addr, 0, + sizeof(struct pvirtq_desc) * vq->queue_size + + sizeof(struct pvirtq_event_suppress) * 2 + sizeof(int) * vq->queue_size); + + pvirtq_layout->device_event_offset = sizeof(struct pvirtq_desc) * vq->queue_size; + pvirtq_layout->driver_event_offset = + pvirtq_layout->device_event_offset + sizeof(struct pvirtq_event_suppress); + + vq->desc = p_virt_struct_area->virt_addr; + vq->device_event = (void *)((uintptr_t)vq->desc + pvirtq_layout->device_event_offset); + vq->driver_event = (void *)((uintptr_t)vq->desc + pvirtq_layout->driver_event_offset); + + vq->next_avail = 0; + vq->next_used = 0; + vq->avail_wrap_count = 1; + vq->used_wrap_count = 1; + + /* + * Only possible if FPGA always delivers in-order + * Buffer ID used is the index in the p_packet_buffers array + */ + unsigned int i; + struct pvirtq_desc *p_desc = vq->desc; + + for (i = 0; i < vq->queue_size; i++) { + if (rx) { + p_desc[i].addr = (uint64_t)p_packet_buffers[i].phys_addr; + p_desc[i].len = p_packet_buffers[i].len; + } + + p_desc[i].id = i; + p_desc[i].flags = flags; + } + + if (rx) + vq->avail_wrap_count ^= 1; /* filled up available buffers for Rx */ + else + vq->used_wrap_count ^= 1; /* pre-fill free buffer IDs */ + + if (vq->queue_size == 0) + return -1; /* don't allocate memory with size of 0 bytes */ + + vq->p_virtual_addr = malloc(vq->queue_size * sizeof(*p_packet_buffers)); + + if (vq->p_virtual_addr == NULL) + return -1; + + memcpy(vq->p_virtual_addr, p_packet_buffers, vq->queue_size * sizeof(*p_packet_buffers)); + + /* Not used yet by FPGA - make sure we disable */ + vq->device_event->flags = RING_EVENT_FLAGS_DISABLE; + + return 0; +} + +static struct nthw_virt_queue * +nthw_setup_managed_rx_virt_queue_packed(nthw_dbs_t *p_nthw_dbs, + uint32_t index, + uint32_t queue_size, + uint32_t host_id, + uint32_t header, + struct nthw_memory_descriptor *p_virt_struct_area, + struct nthw_memory_descriptor *p_packet_buffers, + int irq_vector) +{ + struct pvirtq_struct_layout_s pvirtq_layout; + struct nthw_virt_queue *vq = &rxvq[index]; + /* Set size and setup packed vq ring */ + vq->queue_size = queue_size; + + /* Use Avail flag bit == 1 because wrap bit is initially set to 1 - and Used is inverse */ + if (nthw_setup_managed_virt_queue_packed(vq, &pvirtq_layout, p_virt_struct_area, + p_packet_buffers, + VIRTQ_DESC_F_WRITE | VIRTQ_DESC_F_AVAIL, 1) != 0) + return NULL; + + nthw_setup_rx_virt_queue(p_nthw_dbs, index, 0x8000, 0, /* start wrap ring counter as 1 */ + (void *)((uintptr_t)p_virt_struct_area->phys_addr + + pvirtq_layout.driver_event_offset), + (void *)((uintptr_t)p_virt_struct_area->phys_addr + + pvirtq_layout.device_event_offset), + p_virt_struct_area->phys_addr, (uint16_t)queue_size, host_id, + header, PACKED_RING, irq_vector); + + vq->usage = NTHW_VIRTQ_MANAGED; + return vq; +} + +static struct nthw_virt_queue * +nthw_setup_managed_tx_virt_queue_packed(nthw_dbs_t *p_nthw_dbs, + uint32_t index, + uint32_t queue_size, + uint32_t host_id, + uint32_t port, + uint32_t virtual_port, + uint32_t header, + int irq_vector, + uint32_t in_order, + struct nthw_memory_descriptor *p_virt_struct_area, + struct nthw_memory_descriptor *p_packet_buffers) +{ + struct pvirtq_struct_layout_s pvirtq_layout; + struct nthw_virt_queue *vq = &txvq[index]; + /* Set size and setup packed vq ring */ + vq->queue_size = queue_size; + + if (nthw_setup_managed_virt_queue_packed(vq, &pvirtq_layout, p_virt_struct_area, + p_packet_buffers, 0, 0) != 0) + return NULL; + + nthw_setup_tx_virt_queue(p_nthw_dbs, index, 0x8000, 0, /* start wrap ring counter as 1 */ + (void *)((uintptr_t)p_virt_struct_area->phys_addr + + pvirtq_layout.driver_event_offset), + (void *)((uintptr_t)p_virt_struct_area->phys_addr + + pvirtq_layout.device_event_offset), + p_virt_struct_area->phys_addr, (uint16_t)queue_size, host_id, + port, virtual_port, header, PACKED_RING, irq_vector, in_order); + + vq->usage = NTHW_VIRTQ_MANAGED; + return vq; +} + /* * Create a Managed Rx Virt Queue * @@ -630,6 +789,11 @@ nthw_setup_mngd_rx_virt_queue(nthw_dbs_t *p_nthw_dbs, host_id, header, p_virt_struct_area, p_packet_buffers, irq_vector); + case PACKED_RING: + return nthw_setup_managed_rx_virt_queue_packed(p_nthw_dbs, index, queue_size, + host_id, header, p_virt_struct_area, + p_packet_buffers, irq_vector); + default: break; } @@ -666,6 +830,13 @@ nthw_setup_mngd_tx_virt_queue(nthw_dbs_t *p_nthw_dbs, p_virt_struct_area, p_packet_buffers); + case PACKED_RING: + return nthw_setup_managed_tx_virt_queue_packed(p_nthw_dbs, index, queue_size, + host_id, port, virtual_port, header, + irq_vector, in_order, + p_virt_struct_area, + p_packet_buffers); + default: break; } diff --git a/drivers/net/ntnic/include/ntnic_virt_queue.h b/drivers/net/ntnic/include/ntnic_virt_queue.h index 97cb474dc8..d4c9a9835a 100644 --- a/drivers/net/ntnic/include/ntnic_virt_queue.h +++ b/drivers/net/ntnic/include/ntnic_virt_queue.h @@ -45,6 +45,9 @@ struct __rte_aligned(8) virtq_desc { uint16_t next; }; +/* additional packed ring flags */ +#define VIRTQ_DESC_F_AVAIL (1 << 7) + /* descr phys address must be 16 byte aligned */ struct __rte_aligned(16) pvirtq_desc { /* Buffer Address. */ @@ -57,6 +60,30 @@ struct __rte_aligned(16) pvirtq_desc { uint16_t flags; }; +/* Disable events */ +#define RING_EVENT_FLAGS_DISABLE 0x1 + +struct __rte_aligned(16) pvirtq_event_suppress { + union { + struct { + /* Descriptor Ring Change Event Offset */ + uint16_t desc_event_off : 15; + /* Descriptor Ring Change Event Wrap Counter */ + uint16_t desc_event_wrap : 1; + }; + /* If desc_event_flags set to RING_EVENT_FLAGS_DESC */ + uint16_t desc; + }; + + union { + struct { + uint16_t desc_event_flags : 2; /* Descriptor Ring Change Event Flags */ + uint16_t reserved : 14; /* Reserved, set to 0 */ + }; + uint16_t flags; + }; +}; + /* * Common virtq descr */ -- 2.45.0