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 35C7345ACC; Sun, 6 Oct 2024 22:43:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9053B40EE1; Sun, 6 Oct 2024 22:38:56 +0200 (CEST) Received: from egress-ip11b.ess.de.barracuda.com (egress-ip11b.ess.de.barracuda.com [18.185.115.215]) by mails.dpdk.org (Postfix) with ESMTP id F393E40671 for ; Sun, 6 Oct 2024 22:38:12 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2104.outbound.protection.outlook.com [104.47.17.104]) by mx-outbound22-159.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 06 Oct 2024 20:38:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aOi/ipwHBGPf5lhI7nFnvDW6JBEWLKyUs04z/ewiWVn9GblySs42EZLD7X6zFZFfb3snb3T5AycF6AMrCHRD14S3ZL79XdHgich20cplYWW+HRsGBoNiUMqUjOSJcsDcQoWoqhkdtDYu25IlUCG3Dy7lE9ET0zC6cJNGgvhr8x5yLcTi4J/UY3+q51e3ogPMJCNbXEIMe9WimFlNVvbdXjE2JobylwHqq0EKFrJ9FoKQTM+ZeW4xYcll4ejT2E5rMu7+5FSKkDJ35sbBwiajuYyf9yYRjrW9B0WANAupkYP4A9YMyFslF0uR08Ng29EVClrCznl/W5i4GIItVR4eYQ== 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=N7nqulHVDqSoDzi9/8ohtPNNK/TKgvYQrTFEM2eU9NAT/2J4vknPLVaLbcXCUNMHMAKDSNtQIOkt2BYZE2umHv1/XegTOppRAtNAqQiP0WhPU5T+a5hBqymIDIONTANAmO88iRk2aoGsN7xa4dDkTkvU3j1DC/bSi1NVVYpmXIkpWe8f2DjnQhPUsdj19joG/VwCF8PfPuN5ZYRhHNsPcu42iVpJ+2OUUo/IvRuD8dDXfSfbGlLOWe2+Zpl7OEQbjtvWsusC7kBnQHl13ntZPMP1kNkmPWAIPWiZ5EiRHQSJwFRBNGsZYF6GkgU/bFlpkPjjyjIc1YN3bfQQU840WA== 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=Jkr/HaEkDUtsUK2vFzDpK0epDia7gY2JEWvHL41CrDvm4kIxglwXtGB1YgEiQ9ln5/RAnQ2H3lyQFPdRDL3wx8PegaFi+i2z3YECQJONn94OqjZCMcSITtNK9ZV8ONSPm/BOH8pUfksZdCsdzewgKI/MGk485uVA+rdQNC5S87s= Received: from AM6P191CA0009.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::22) by PAXP190MB1720.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:288::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.20; Sun, 6 Oct 2024 20:38:10 +0000 Received: from AMS0EPF00000190.eurprd05.prod.outlook.com (2603:10a6:209:8b:cafe::64) by AM6P191CA0009.outlook.office365.com (2603:10a6:209:8b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.20 via Frontend Transport; Sun, 6 Oct 2024 20:38:09 +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 AMS0EPF00000190.mail.protection.outlook.com (10.167.16.213) with Microsoft SMTP Server id 15.20.7918.13 via Frontend Transport; Sun, 6 Oct 2024 20:38:09 +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 48/50] net/ntnic: virtqueue setup managed packed-ring was added Date: Sun, 6 Oct 2024 22:37:15 +0200 Message-ID: <20241006203728.330792-49-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241006203728.330792-1-sil-plv@napatech.com> References: <20241006203728.330792-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF00000190:EE_|PAXP190MB1720:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: a4478841-c553-408e-69ce-08dce646ca7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?sdvQLkfRFgicfNCcZOjCebY9Kww/6KfPd9PZza3xcn6+CdOT6uhUAFy3m+2U?= =?us-ascii?Q?ekSGQKjfF8cDU37Akt/eFJE3QUSJqg/oUCR2JgSU3mhmGCg/Q88aRYhhuupP?= =?us-ascii?Q?JPrGtAC6STgLfpWE+446j3thyGMHPhxmU6xRGxTvFdFOR3fUPHfumMkA6IK6?= =?us-ascii?Q?oOqZ4/fS+oyeOlOE6kIEFxxF/K40MmTEnq9D9V+S5LLtJeKq8yyFslKtJsG4?= =?us-ascii?Q?jm/pDaoTVGKgxOd6GSZCtk/VXu8c+vhZvK1fjxCAGPZ8py6WqDxzryYQiWS3?= =?us-ascii?Q?wo7ULpnfJRGfRP9voITAXHc5sWZbcYuTJ6dGNBDBqO/9Gi4p5R6S3pyB3q7+?= =?us-ascii?Q?RdignJj2+xwRaf6aN35mi+bt8ccBCzKBF+/mLohq+lsS4Jh5dR2CGIFDSDac?= =?us-ascii?Q?LaJIqdA9Dzaqw8pN0gWXzLvTHz38R8mJx284mUo4CkUrreg7/wiuvgJn5sMS?= =?us-ascii?Q?FLs/iZJMu57bz/ygWZrdfhGlchDqRGp940BIOgGrDfMXurIyTahUwbhciWp+?= =?us-ascii?Q?5IO6zseY/y7aqY+GcmAZEmX9Pvrxt43EOq0enp2S7QSghBwvKZqO9Re5aeMy?= =?us-ascii?Q?o4ZNKahACnoCan0lLPrzve0++5DbVLCFiHw11jUMBnOtImj+hZHknSBAeDnX?= =?us-ascii?Q?3/fczLrluv3Cpz7WrleW+ALfrla4pd4s5G0bv6fmfBeNr3Atwq182JqRfJUS?= =?us-ascii?Q?04TA9x3zW2VAC/gSG+LE3FHRM/Xn0s1c+ItMEjatnNZPgl0EvmnGfKe+nxap?= =?us-ascii?Q?IybfAAirvorc18BbYj6IYZ5u2FJ2lpqQ8s8901/wGLFzzxZpYkvPTfzqUbcA?= =?us-ascii?Q?ZbzUpeqPZlfyVggpgJZ/r/ZFQfv8dezR45GJIxikncmrYZ0uLxzpoPBNwiaU?= =?us-ascii?Q?5BC39WXCi9e77qERr77mEQC4RCbnPM1swALQk7M1Jqmuv3dVoC9DejZfr3CZ?= =?us-ascii?Q?oa/ktpp3afjciP5nSQEGIn5mgmBH848HgKSmaefaaa8F6ux2tYMcTKysXb8N?= =?us-ascii?Q?Nb4DEfXYHsP7cseQCUl9ToBSIWS4RAu4afi+WZuyn0vJBxHjrFLhT1CzwRko?= =?us-ascii?Q?P/YS0dlhKT2/izto3qV03gJswl6HZ/o1gzwWwIVEXBMQFMXoV3fYHkkkMrY/?= =?us-ascii?Q?bVSW3EzQmTG8SdLocQwGim0jJjzBQVZO0b1LuQiwq/Q8o/xxVGv7lbJ+SR2U?= =?us-ascii?Q?6nCJOOfbcWlDkMut5i/lcUHcgHk/FQ34zbO/zTnZnyY7nFKfr8jMwfDVWi1D?= =?us-ascii?Q?3GLnWbMcbaC0ZnSmHgUpd4XXbG4hV2lxzNC8EwhEWn7gUcD3hKJ1MByqilRZ?= =?us-ascii?Q?t+CBjAyTnLAqqDnWtyy7+UEqZJJkPQH8Qmo7WxEocVOSjGAAYWArXBe420aG?= =?us-ascii?Q?Z6gqDfvrAsWRNTBXZ7xlien9xEyO?= 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)(1800799024)(36860700013)(376014)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: X0US5Xu0NdubEcQC1JGiDcbFHn5M9QRllnHiaCta2RxFnk8e3oOIbDfEE7/vZvzddPEmqyjmuOVM1mZXRo2hrLFiGN+a8+07o7yvHVb8EkSr6T4K7z1aemMlwU0Nu8NiuuIoV5YNIHV8UtCAriirpYSwNdSf1rYOKXD/OqYNaAypQPxvPQA0bo98rMG+/MDg5x1kB689rq1K7BGllV6Izm/C+puRqhMqyGOmKISkXnEoyAJF5ktndE5f6by19yvl46jwkgEgTsOq+MYc5lLiyZ61lHkGy4h4Xpz9HvskQm1NWHpQX7om9O1ftFpCCTLhNdp2p3wBVy4XT3d5pTLkoYEwCqvlLkJay7KZI6ACkgHg8iUL6pKZ4T/6lnK1cxcKE1REAkx1NOHJEa+MIiJvuncR2nqBVSGGrvKSQ2LLeErcaYuvgfjTOJiR92lUg2wHO4CIUdTVKa43bKGcm64Jb35iuxUmIPnaAIJ+LQJ7l/JL+jlwPnXfXuV8dcWG6pQ7W0A/DTgshGFsi72TdHch8ZUnJh9dzbN2eB1CMQe4eImQ/xzW97MjNx9HvGrFntoaG/MfhYwVNbcxZEFAGCoUTf9jz/tQOLruDah4s0Dr9hA3spvEbqd+DRJBpEOR21eTZsrIDr1D+o4lPeG/7ZXxmQ== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2024 20:38:09.7808 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4478841-c553-408e-69ce-08dce646ca7f 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: AMS0EPF00000190.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXP190MB1720 X-BESS-ID: 1728247091-305791-12648-147771-1 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.259547 [from cloudscan23-175.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