From patchwork Fri Oct 4 15:35:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serhii Iliushyk X-Patchwork-Id: 145107 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7657945AAF; Fri, 4 Oct 2024 17:53:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30C1942E91; Fri, 4 Oct 2024 17:51:26 +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 11C2F427BC for ; Fri, 4 Oct 2024 17:51:21 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2104.outbound.protection.outlook.com [104.47.17.104]) by mx-outbound8-201.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 04 Oct 2024 15:51:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l6Z01j/Pg7xTtlrGLMSqsBEPocWoJV6pbGnte/WrN1Hm6LZdwLfw68EloqLKLUNobviCtLYWtX4Jsizzdk8INRKeh9zs3O3F5IXaudVNd0S18cCgG/LwK3Mdr/jLAu2buHeYuCpt2aXAslzxkkBjDhBUOb15JkKFt8/g9qFN28NwVZ1aNom5IXUdYxpfxl/3xEnxDjPqPSu7BYHGVBveCZPQF1fj7flffeTLJIpXi1mXEyFOjb5b9VY+Tj7lUl8MfQoW1u9HeeRSQ3oJr8DZenHyxbt8ie3cOntyLmH1BVDFIR+CJsGoXa2aFB6ZjS6cQTXySNpqujQn9g2+zYti9w== 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=wjDCOFHpsQ1tpwwz7vrWPb8p2TbAiNfO3/+1XZ5wr13MSGsNpPhpWayweEtMxrvzhe2kgfkkM/BbbOrRGmBXy7syVlb4OQystGcUjqC3ebuFjzeIVocpk55i6F0q9cPXN+Av9FiShGMcd52WK8JPnYmhBNJ80XO7u3KcHtDSkLzECSJbDzX1b3MArXbHH9GV34Dcxkvfe2ZwG6T6UNAzIZ0G7hu6m/7oTx91o0lbrZpL6EmoR0z0cJvQ2BK80928Qqe0m2BQTHr/NuFxAmtEWWSCdXeMPz68fxzafrWUfpvGW24CypaW1ikd9aF/g6r6E0SSVtm9PwkObhD5T/mi2A== 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=kBuRBjHSAaUHO4fkPSUJnEzfXNkP98AQ5DNA7hzpnCMJl2Xdb6gJLHq19izJ1fy86ky3l0MUj1ADiiYCxa/uq7NfV9lzqwpKkUwpjogQwKCGPdgnbquibbIYJFggabyaiQ78fOSf6WgvaiC2WwVmEkRrBhDqVr9WY62gUMxS8As= Received: from AM0PR10CA0103.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:e6::20) by AS1P190MB1701.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:4ad::13) 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:36:38 +0000 Received: from AM2PEPF0001C715.eurprd05.prod.outlook.com (2603:10a6:208:e6:cafe::e4) by AM0PR10CA0103.outlook.office365.com (2603:10a6:208:e6::20) 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:36: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 AM2PEPF0001C715.mail.protection.outlook.com (10.167.16.185) with Microsoft SMTP Server id 15.20.7918.13 via Frontend Transport; Fri, 4 Oct 2024 15:36: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, Danylo Vodopianov Subject: [PATCH v1 12/14] net/ntnic: virtqueue setup managed packed-ring was added Date: Fri, 4 Oct 2024 17:35:06 +0200 Message-ID: <20241004153551.267935-49-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241004153551.267935-1-sil-plv@napatech.com> References: <20241004153551.267935-1-sil-plv@napatech.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM2PEPF0001C715:EE_|AS1P190MB1701:EE_ X-MS-Office365-Filtering-Correlation-Id: 1bc5617d-10fc-4d87-7c8f-08dce48a568a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: t2ZmbLFYB/AucOoNxObhNOGT0pH8zfTL6VUK8rBx6a1BoIoecDZ4pNcOHl5a38wFdLeatZpmwE+QubIcMdbbHPSNuxzKuAu1euvvscZ2vFRocdiJaIG64uZ3t/rxoEC+d+paGxRD79QoS67OXVLAmV7A+1Ym5BCMB6c3gM0/2phheBUvhVrl1M63bpy3ppLZiGd2xFtdX7Qbnjm2KUp4qutlwwhtOCF1Pq3zH514xx8IjahFM0rstG515IA+j+feEiNc1BM7LAW/3hPKXqsgKCedxzwht1IMDQvM03HX+goQ29kS53xS6pMEx+Tyq/cnzgf0AAjUg6FMAJVOZXfVQCmOm4CmOcwbXeJhgyfJLGA6s6tJMR8Fq0jbsngQusdur3sV1DPBTI0kYSiWjHhk8OvUR4lSxKJL4HUy4llz+/I0QkKA+TJZwc9P4pm6oK4RViD7Z1+uJOy0lE/mKZtKXB1LL+R2hXtQRFhGbFE30w8Oi97bScKd14yfRE7C+NJbgL/LQoAUd0FuYit4GQRz1NVj+nSTF2LxUj6dnZsu+wZMP/JFSC+Q0J2zP3s6y7DnTym817HTV3LR728M0fOG7eHlQg2DyTGQfZ5yQShv/kHzCI5OffZqjxPUP2ntcXWSMJtK66zWaUq74ox3v67CdhHMuJwqLDHgJYBAYbLKkrIYPYqXiXx9VStNR6ZHLHjdaYuJ/iWzWtASR7yb6ts/y4LyxRvJuRzMjg4U+a9Y13vwEEc4YqBwE0yYbGYSTftCSAvqD+tVQqwcamWCJBjUFIQ6qidblq8pLpXZazmQhZBg0uS7k0dniOPE/qXSMWChyhXUCg03/WVcL3p3pttbfGg2scIuzU3qgoTpfNjHOvUZpZeDIwkt7Pv5VgoU4ZgGOJy5S6xrdiTPrUhxjXZOKvimVG/kNaYmqSthJg4QA/KY84jb/IS6rjbmRHErsXSvHzP9cL8XUZr0BQSDwocC46g5ATuzm7v5FhooIH6m2S8TpP3k9Jbn2fdP3jtXuVNszRtxWD6F2zoN+cX8MrD9Kh6a+/g3INWHIS7GxfBp0nMFD3SmulgbjoNE2tWDPv2AXkpvNuHj87/Hs+CktC1vAACsQNprBzA847vBwMgiJgEVBtJwSGd8JrYENTCBp9Memwb567ZylDHk6Tp96xR8Qh6ahbsArXC4s6TZrE+T8sJWBMsGgCmNM8f9MAIbCeaamhIuYT1XTgE4ezH7VIrdWrg0UKQjmnHNQdxRJ1BAfBdsepjyMLRtBF4flnYc9pExlZaABRk/3ZCaOCVtWyRxZmwq0ipwLRGuJsNk/hXHhxqjm/tospdHfO/Cxj/FvrUAoEVONOMmI8Ii/5wJLM26sEzdKRMA6f7HgGaw8MVw1gZ0XgwXxUHpGnCxzMRd71eK 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)(1800799024)(36860700013)(376014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: oz8nqYpOQQvAoxEDBYZUGihZzSYNeLwSX3ROn9vlh9/uvE9qRU+1lBBjynUDH5CSYIdYmIBxbT+smzqqkGhoK5fm0FyS6SnSxHisv3568tBeYQTcWYRLmXRJnCEOnCyNvgNmXNNimdfLd8LofDhdUvQaIXWco5gAa9Aumxe+aJ3qdvnqbmYpwC3DTvvoQO8xOo/WkYyJUZfaGNiX2svrEPi2fri1J7UwxQHpThI5GxuDgqkJkvO8mr0JI5sojR4FDTF0mZC41TGQGyaA72m83P254CUb1p+qaRIo1RUxozQMRTHYgo66wBbxC/2ZONVCjtRpyLQPPVk2YMYoyHkK/asHjWFZyd5R/mxaLAJQFvTjoWAqwysmsT9vKWW2fDqKlpPBUTl1yzb/dQi4KOd/Iz3sFjGaSgdfkzG2L+YuxkmA6wN0/aDq0dcmk8rBXdg2fPL9tCmBFANPhbgg+OEfagWX9ibSV+Fqfa1mZpaDE+L1JYUwzALk6bN2FQ2E5qww6Kx4CqRyI3DG7U9zdVcSj8VdnitmkfJN9yxdsGwsNkmeJ1EfjzYDrXQUPV0z0aQw+cn1z4A80OS4T8oOGRzbp+rrKFAZZL19hiVs+Rw1Sl4eY6eFLT2l18TfMG1F7JEttMYHGSnxFx+FW73C5fKOeA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2024 15:36:38.6429 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1bc5617d-10fc-4d87-7c8f-08dce48a568a 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: AM2PEPF0001C715.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1P190MB1701 X-OriginatorOrg: napatech.com X-BESS-ID: 1728057076-302249-12643-33880-2 X-BESS-VER: 2019.1_20240924.1654 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.259494 [from cloudscan9-172.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 */