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 8C07345AD9; Mon, 7 Oct 2024 21:41:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC40642D8C; Mon, 7 Oct 2024 21:36:20 +0200 (CEST) Received: from egress-ip42a.ess.de.barracuda.com (egress-ip42a.ess.de.barracuda.com [18.185.115.201]) by mails.dpdk.org (Postfix) with ESMTP id 6BBE240ED6 for ; Mon, 7 Oct 2024 21:35:51 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2104.outbound.protection.outlook.com [104.47.17.104]) by mx-outbound9-155.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 07 Oct 2024 19:35:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=f03WAgMt5IL3aoH4tiGsfoUb6rLOz6NqSCO9kNCjtqG1Ts7ShlEEbaAo8gOaWyV0d7o2nCm5uek/pHYShXrKw1AGi/BS3HCeJNOQ0wPUeTyTqYmoIHA2Dq8SL+VB73DjOfaQ9Enoa93/OCH5SlaPDUUX0Eb0Yn2TouoL4BMpiXevvvGp8sOUEAjmTANQwPbIVUSMuRluHj0bLE05ZT8vh++3RBalcHhDclyuZjduAQgxo4Mj5HPeVFKIc7KxOYMRxV6cJaa9RDLXrx2iGmpf7YbzLk6dnOIu+2LeicJm3CSiUbTsns583dweFRK9WaakVB0dtBBL6X40NZPSsrkpZQ== 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=+1/jsoeqG0AN6eAimEkATT/lMADoMIERuSTiFPSE9hY=; b=EiJcBXmHKNvAvf3qtLEyXWtIBv2ac0kE+13dh+itAxeNLED/3DNQjXy8NTSFUHd6/VYDTF9nevRsQp02+FZC8WZDBUo4Z6hyYgM7fVAFlr+VdjMAm+j/pEa+3v/asQWhZjuHoZQ+p/xNVue03B7m8W6hdpBxHj0EMlkaQvuBzlZYufA9LZ4YFu//LIL26swTx3Lk5AXjETw3rlNnJ8yjRcQPWY2u+lBb8dun3MsBmYIbatWTv6fid5D2aaJqqHMxRA81OXZ6lapSS3DJhT0/DOe8b+MDDe3NX4uoYUGCFZ066sx5FDX5hLMs+Cy9MzhEikW6O89f6V9qZDLkKcGFxw== 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=+1/jsoeqG0AN6eAimEkATT/lMADoMIERuSTiFPSE9hY=; b=gV8PtLeVd/1t+kMadxlcf8GlxLT4w1jhSIwIP93W1IAIxe5lb8uQrKBL22hL3YifR0oBKrrjrZQTeVkTxdjrUfesH8lEBFQg98ouheoa8GlMsH1lQ60wJDnGmUpOxMsNRpo0H7VBAGtpBRnUrhfMZbUErSeeIG7pwyLv+Johqhc= Received: from DB9PR05CA0007.eurprd05.prod.outlook.com (2603:10a6:10:1da::12) by GVXP190MB1845.EURP190.PROD.OUTLOOK.COM (2603:10a6:150:3f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.22; Mon, 7 Oct 2024 19:35:42 +0000 Received: from DB1PEPF000509EC.eurprd03.prod.outlook.com (2603:10a6:10:1da:cafe::f6) by DB9PR05CA0007.outlook.office365.com (2603:10a6:10:1da::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.34 via Frontend Transport; Mon, 7 Oct 2024 19:35:42 +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 DB1PEPF000509EC.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server id 15.20.8048.13 via Frontend Transport; Mon, 7 Oct 2024 19:35:41 +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 v2 48/50] net/ntnic: virtqueue setup managed packed-ring was added Date: Mon, 7 Oct 2024 21:34:24 +0200 Message-ID: <20241007193436.675785-49-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241007193436.675785-1-sil-plv@napatech.com> References: <20241006203728.330792-2-sil-plv@napatech.com> <20241007193436.675785-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB1PEPF000509EC:EE_|GVXP190MB1845:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 12c086f5-a88f-49cb-10c7-08dce7073b1c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?1qWqgPy/7wxyvM4t5j986iqcjiHgwkv+TE386iRd6gu3ZC3gm8LGiN3SosCA?= =?us-ascii?Q?npnS3OcuBEzd8hZq8/F2gVHAmK2bRgbiRYspqtE0fS0K76CI1JmyCAw8S/kC?= =?us-ascii?Q?oZtxUu7/BbXc/LsvyXlkdDwzWTAJic1skZ4TTnXjPsNJNmdxCEnjVwZ2dv5M?= =?us-ascii?Q?2rWftE75tl9rxVEwvxN7cPj7V2G+yunyXH9zVQRVPIiQ2tjxNZWbIco4tKcY?= =?us-ascii?Q?4jtuwKe/p0NqPcUPvkv3czcxqiFNqCYfbUsK1cuWavTaOGODjVNTL37uLwsg?= =?us-ascii?Q?yPETFiBHkgqyiaXH/Nk7nBMxCuajmFPlcoOeQxDiHyFlFUlqS5TwcbhdSRgA?= =?us-ascii?Q?pFEnCAvjKlM3bi95EPZ0tF764Jk+g7EnqhtnnZ/11ZpdfIZLHDcu8uwzE3vQ?= =?us-ascii?Q?8u3kQQ+JvcfGp+jPLHTGgN1M04eoFZXCEHqIbxL+XGoyJFjtnMxb29aRB5XL?= =?us-ascii?Q?2BTicIKujdKyl1V7VwEm3JDk/vxudaYdV/vIJs3wXrsSz+SAF0p+LKIl8nhu?= =?us-ascii?Q?sFwHYlIEOau9mUXjH2jQt81CnER/csdJKIq4GyQCu+NES6sfupuuhqSd9f1G?= =?us-ascii?Q?AOzJcckDTYUcGdA6DxaHaFuK3wT2IALCOGWiaAVtkFbtFTtktqyim7SfTcAB?= =?us-ascii?Q?mklO7vl1Ujl28Ar5GGuHbKrXFTiYY2saZUIWvHCrBgoFz1wxOfwomsaNopSD?= =?us-ascii?Q?tTptHzxptdChup9/qfKpGtNex9ysN+y+9gAL1OR6E6sqgSkNM2i7dvubpDeg?= =?us-ascii?Q?YIKAc1UP3018EXcKilwWtAwSV7aiysN7EuAag8HwenV/X7T54MHUei1/rHmF?= =?us-ascii?Q?0fBLyqDVzU9jtjmPgfcI2tzPOkz5FdVhXYbO1j3tH5qonD6Bo8+s8ohpPTMF?= =?us-ascii?Q?84olt7xPF7FVkariVz69N3RUuWHFmxRb/r7TofxlsUVsO+nMIoWOghyjHUs1?= =?us-ascii?Q?YBzkaOsQ/wHZXtZLv7nS3Ple1J5uUAtIVMm6xrREsA0BuLqCtWVa75zr2aXV?= =?us-ascii?Q?9K724HJpS6dBak7MF2uC49F6gj9WBDt+lasDoj1UIq89c56flUNf4sUZRVsg?= =?us-ascii?Q?3qkF75wD/EKNzOHkdHzAcWuvnKJ8fz3ig2xJ/+8lPD4v/EaK237kLayJGR11?= =?us-ascii?Q?kqPflUHI8m4HHmBP7F/aKVfDjzpnFsKRgUnLnKU84a0fH1FUMD34ONBdBkx/?= =?us-ascii?Q?eQNrK1eaA0d7Nud5NZLN53mROW5GIUwxex1vK1mvG0XzlrXHd6BDTv2ofWZy?= =?us-ascii?Q?oVIqWEuNPqRyfKeHDXyuCm0yR7Oy9sSIwGNgjZa+c7W90nk44DDyn5WbzrgE?= =?us-ascii?Q?ELz+Mp7byt4WGrpWYABUuO0aOiF80FG+BzuSRvroGpVntNb3OiLwgpdOvWrz?= =?us-ascii?Q?FYg7mLpVYxQOPusYbqwfQl/1DYrt?= 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)(376014)(1800799024)(36860700013)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: kBl0kj4fwwXVjFJivFbEDSW6wiQpQ2giD3ReHzUu3MC9RpFJx92cxd4AX/RHCI2yKMqqrxUZhkNb9rOISKqTHv58+N4FRlSDpJBdnw27lkwNK0mQvx8CCVXQBeiHV+xZwyC64KvCEunNX8cFvQdVjAmASuaQzqfuK2n7PAR/01H/KFYDoHGxKG/KTC5aqwQPP9jK0bgVhFZuqL1h7g0vbQA36TxVWUN73Md28a9Fbl6Hsodl6BR46zat7ZF2xcK+crp703xCfiyDHN7Dlumh9xC4L6/JrywSz3BOmDS0Q/4nCC7O7XAEU/95sbp+Vs2yQoHiKsal9laO39LRYVi18/+ydO7OmlmkKCffftXKmPMAk2HEfvmrn4P3dBrrklUfKi7RimWLk1fTnTu0AXl5epBY6AfLRjph9mKoG7e+z7VwcOaz00R3uVJ9Aq8cdmRlX1Y7vb34rG+dHm1LcfEi2d6MHJoWLz3PLYDrVUxd6eIJcg0QbbE3O0noqd8IZNGqR87PRSYZij4rjifLJeWvBDniZZtP0AEQUEwPAaisxjlm3Lcvy/4DjvtLmevceTKKIuQv0QWVi0+dS65jgIlQuODb669a5YbHci0l67pC6f2nx2cyrV8cnUm2d8d9Gvq2AvS45gPFQBgA7VyXIDOXsw== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2024 19:35:41.9593 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12c086f5-a88f-49cb-10c7-08dce7073b1c 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: DB1PEPF000509EC.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXP190MB1845 X-BESS-ID: 1728329746-302459-3375-3631-2 X-BESS-VER: 2019.1_20241004.2057 X-BESS-Apparent-Source-IP: 104.47.17.104 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVhZmliZAVgZQMMnAMjEpMc3QzM Q42SzJPC3Z0MwozTjFwMQ40dzAIM1YqTYWAPqyOFRBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259566 [from cloudscan13-113.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 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 5232a95eaa..46b4c4415c 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