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 B2F8845AAF; Fri, 4 Oct 2024 17:16:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B87642EC1; Fri, 4 Oct 2024 17:09:22 +0200 (CEST) Received: from egress-ip42b.ess.de.barracuda.com (egress-ip42b.ess.de.barracuda.com [18.185.115.246]) by mails.dpdk.org (Postfix) with ESMTP id 59F2E42DD1 for ; Fri, 4 Oct 2024 17:08:46 +0200 (CEST) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03lp2168.outbound.protection.outlook.com [104.47.51.168]) by mx-outbound22-159.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 04 Oct 2024 15:08:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TGiaS1zEFIRA3sjy+0QKc0LV2u+mvuZGEY4ZnS2Yd9jmXIY62/IbYAQ6jBZlxagDsPoZfcZlCQ+y7z2ZxWmzPAtCnMydXLQEyprujSidn608+yiPrsSp/ZyG/Bcm5OFEMUtwXvSByM+UIOYhallTBRmQA29SBEjrqjFsiprDG1JPXW7Risy2r1kG3f7zUKWyRTrlppj8RgqtIgt5YNlFs4vscozbmFxXNWUZM78JYOBI9/sun9xmZdtdS6V1QBDOUQpB2VTLIAsVt5KQ335FhcpRdxxHsX9dUMEoYunBM3d3xC0AD6rStesGjGq1wEsQGTDUMOqqMyYeYxffxGpO9Q== 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=jfVhOJAvqgETIwM6Elj5nKAGhyEAE0n4dQzuYjL6unngGa8nhTB7t+WVArkbyH3PhJHdamPZa+Ebo6r9tIUIHAiSccLelWx6AIr1iyUKP3Bzwq8LPi1nxCq5tyr2zw68eYW7ptM0UKzpxmSCLSmrlUvgseC0vt8Y6pnPdV2GT9tuxYKdOU5WNnprDfKp9lKOayPGDTlT8xtUz5ZoCUQkmSXIJKNm0syAHfKcyXo81iaAKK0BShTkk68EpdAAibxReR/Tl0NUHN1dUAm6zGXt4Ac1Xug1PzOih3iVm34DBLt2h78ybvQVYRMo46x0YylhVH1tTfivj5s+F38d10BRtg== 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=Q2U2EmONpneLc/wtjdiq+AC/dydiwIStFOIqrEoGPIOqo1AQGXSwpIyuO8ZQR7LqMt1ehlKSgeMvNiFa70COSD26IUKtO9olybCBdIalhva9DNJiKx9dE8JXGgkQDbDImFJ1h67ayWd5FEDqTnYaZu5ZWlYgMnn8lLVgiJVsRFY= Received: from AM0PR02CA0035.eurprd02.prod.outlook.com (2603:10a6:208:3e::48) by VI0P190MB2163.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:254::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.18; Fri, 4 Oct 2024 15:08:40 +0000 Received: from AMS0EPF000001AC.eurprd05.prod.outlook.com (2603:10a6:208:3e:cafe::bb) by AM0PR02CA0035.outlook.office365.com (2603:10a6:208:3e::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.18 via Frontend Transport; Fri, 4 Oct 2024 15:08:40 +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 AMS0EPF000001AC.mail.protection.outlook.com (10.167.16.152) with Microsoft SMTP Server id 15.20.7918.13 via Frontend Transport; Fri, 4 Oct 2024 15:08:40 +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 v1 12/14] net/ntnic: virtqueue setup managed packed-ring was added Date: Fri, 4 Oct 2024 17:07:37 +0200 Message-ID: <20241004150749.261020-51-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241004150749.261020-1-sil-plv@napatech.com> References: <20241004150749.261020-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF000001AC:EE_|VI0P190MB2163:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 53122c2b-6cca-4d9a-5520-08dce4866e05 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?YIP4GMKgkYoTMl5zXJOm72bNWGgEDkojmmVIWdh4CTFew4GSJW5SqAOQrMcM?= =?us-ascii?Q?h2ZaRRA7o88qighZCgTvE1SWZcXgU4Y3uUIqxapfv2vcNoR64ysFFHX1i61Y?= =?us-ascii?Q?XEDDHJS7FsAJ1yA0Ri5DqmiwK0wXggLTD/ObI//JB5uUY8RrHpoxrh15ia1R?= =?us-ascii?Q?zHHzm6nPbxPf5fnsM9jhlUbPsQUH0Lqy7PZ0Lh8VkYGgNFD2LpzzNjHvJ0Wh?= =?us-ascii?Q?RrGcH9KpX8IR23s5z3nzXcjNcXqZ8Nh8iKmNK6O6bMrhqlyiO3lHrXiyflBD?= =?us-ascii?Q?ogobGQMaIn7i02VBhCork/4Ta9fshA28gvN7OmkY4jHNyBhDEQXu93tlfkw7?= =?us-ascii?Q?ReXNCT6cXnmSzpsLAavw2g+FRbcVGplFRmuH4FZU4HdtOSZrLZE/IbLJyd5b?= =?us-ascii?Q?Wcp+Bfx0jEsA5SobbzdSNgzgzhZvvZM1xiAJyiTTVlGo8uMH2NJMjSyS6kDo?= =?us-ascii?Q?ZHsSKGAIBZoARyDlG1RXsnu81dbfMXOwUP5smNiNqIRYsOv6DK983BFdKrsC?= =?us-ascii?Q?RRR/35m1u+IuzwNgx8fbyxkCO7ruUvDoWgqbrdUZtMhhhssKyFFIRwh9yKQ3?= =?us-ascii?Q?JXuRbIaJBdfgmSps7V0X+JdcLFNp6QsDU90T/fuMEQLc2U/RP585RByIY9m1?= =?us-ascii?Q?D3MRqPqL7fT2FLaP4eTgNJ2VvSDRixl0EPiFSZcCMY7hhuC2yf9UoB0TB3xO?= =?us-ascii?Q?tNN6qMZaiTIlMsqxeIN3K176Fh91WWnhSo6SLHILlhUBfebXR9PSWM9Dch3d?= =?us-ascii?Q?jM1nsZzPnLIJ40JAX4XTVgGC/FIGZPPBh5MT4eEnY3uMOe3k1w20OyhcVVGj?= =?us-ascii?Q?qLd06OyvzcnGykecfrtfg1vFHrlPcIyxEhTJYhzrb0uUBLdorahIcarWcwoh?= =?us-ascii?Q?sP7VMX6SZB29v++DqtqTYVTAkH9mPk12aPB30SWAPkxiZa9takhgD7FGPfLw?= =?us-ascii?Q?ee1AlWG2sKs90ZLBswS+cfy790jxzV1U7eVo3Hg6u2PERY5FtelWXQ6C1ziN?= =?us-ascii?Q?jnBn/bNbhyuf9qaR/zAYJPKXP0e/DJiPinrIm8vQnSFrF61/DBx16RlnM9CD?= =?us-ascii?Q?aGByuMPALFlAO+YhkvKeqdPXUeMrq6sZ5MmunyVfUH+I6Wrw6L7Iv/Yye0mI?= =?us-ascii?Q?H6a/PoZv8NepkAauAC/f+hatojpBg9R35OxyNZAL21mShVMW632qWEdl5/Ir?= =?us-ascii?Q?WVXL87HUmIs4jKUBlmhcnD2yh9XO7g7jEWMAaa8KiEa/kdnO4ofwE3W7HlVI?= =?us-ascii?Q?zkX/z/6HaD4XOOJYzpreUkBHDBkv8ve1vwqOiZQgpchM6mr9W7NKSzue5/hx?= =?us-ascii?Q?2PUvYw0xfNL/hswpklW9myaGztJ/DMxJzOhz7vOnMfw0SHz/lH6SP8e/0o1p?= =?us-ascii?Q?bmTEt5UhBM7LzR7Z2LsAjWBEMAte?= 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)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: PKfVAx/SdKdHhuJSUbEDamVZtZXiONm0awg51C6OuoHTwmhjMg6jlgg6TI1ocYLb/79qTvppv1LsgDPfO0KjjhYpc1SaDkfrNQDB4DI7kmlU2xJkk4Cea47oe3ZlmEqJQeheh0cYELaTc71rOIggxwaTRI0/pGxMPXnjKv6n2duDSMEoTwbSE/53gwcLOyEnf1QjoicIlK6h9IBKtvrMAX0TChaBAR0F6qdoBY5EWE8wZrhCSq/S36g/+wxn7/BdY0WJkoD5w2gRB5lwh0C5uw338bGnAO536SxnzP52QeAZAbhw4t+Wy53E6w7bErXxQ+smOFwixWhBQwE9qrGIN3NPeWWOlBS567ztPPG/8RLmb7b1CcoBj2L0Ug6S6rDLO7apq1D/Wc97oGSzXqS1kv5nZnZ3qiRPi5qVGp8VB/a4oztzJtJS/MhN9oUzUJFFjpOa/WBmOVoVazka+56wfjDDwQ2RfAUyTk0lwYd3VkBV9ALZ+TZdemUC0Ofo30bcFCdoYAgg8/ViUT7OkcVMPWRDg892/dN7gXKiUXBR0p2Sacri+fsjgO9abmX+I0u73bSojGJNyVPNsB4/5e4vQw5QY/qCMpmTrliM7BYhfKb0tTZF1jp+qYFtrNEFyLiW/GFrD0opjMAYlZJXjKFZbg== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2024 15:08:40.0642 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53122c2b-6cca-4d9a-5520-08dce4866e05 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: AMS0EPF000001AC.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0P190MB2163 X-BESS-ID: 1728054523-305791-12644-33587-2 X-BESS-VER: 2019.1_20240924.1654 X-BESS-Apparent-Source-IP: 104.47.51.168 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.259494 [from cloudscan20-7.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 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