From nobody Tue Feb 10 05:26:25 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1674041719; cv=none; d=zohomail.com; s=zohoarc; b=Dp9/xcrHKvZh9sVK1strAmpm560mk94aedLDmPspI0sw7KwmZ0PLNfN9OKtK9SnAmnW9NbUpvY5IwRy4WGAozwC+Boy+Eg6njeOZXni8x0738RBlW2tMjtmStn2H6KlqevltNS6LBHCOKBLvqYXVdcHlGwwiOUpK/1bA4pjmuyE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674041719; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dYNMcfAX0BLL+XCo/BYEEwgqgUcrj4uRnGWW+k846rA=; b=Qc4IxrSt/Islpxd3mcURLToZHVIz6b4CPLPKnYYwxYLqIZEuiQoxeKPAvwqvPm/T7liD02FEBE5hP4E3P103L7oOqhBETGYmmY3xG9uhyxoiKe/aFTpKnVtBJa45Tpg2ADFApsu8bJUWWYRNkuytsLtuMfL+oZPfocOFNjN6nKQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674041719525217.81410172054018; Wed, 18 Jan 2023 03:35:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pI6il-0004c0-Ue; Wed, 18 Jan 2023 06:35:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI6iE-0004WC-8N for qemu-devel@nongnu.org; Wed, 18 Jan 2023 06:34:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI6iB-0007Wo-8N for qemu-devel@nongnu.org; Wed, 18 Jan 2023 06:34:37 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-619-iTLMDCYsOXmhXaDXp3jQ_g-1; Wed, 18 Jan 2023 06:34:30 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B2F461C08974; Wed, 18 Jan 2023 11:34:29 +0000 (UTC) Received: from thuth.com (unknown [10.39.194.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id B52EF492B00; Wed, 18 Jan 2023 11:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674041673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dYNMcfAX0BLL+XCo/BYEEwgqgUcrj4uRnGWW+k846rA=; b=IKYVV5/TG0q5WcMv482gFKiU0xdEfkHMmfzoQmE7/bxua3nHuYwXQhY+h4R7y1brCtA4n+ gNVsQoetxjhk6soNvY/Ou8Wt0y58+fF87EG+JZUbWJIXV9BB9zT6MtLchDJTV02dixGkmu eK8aK5jXE2mV379UD92qmU0/05bV2uY= X-MC-Unique: iTLMDCYsOXmhXaDXp3jQ_g-1 From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Cc: Akihiko Odaki , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 7/9] tests/qtest/libqos/e1000e: Remove duplicate register definitions Date: Wed, 18 Jan 2023 12:34:16 +0100 Message-Id: <20230118113418.1650416-8-thuth@redhat.com> In-Reply-To: <20230118113418.1650416-1-thuth@redhat.com> References: <20230118113418.1650416-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1674041720209100003 From: Akihiko Odaki The register definitions in tests/qtest/libqos/e1000e.h had names different from hw/net/e1000_regs.h, which made it hard to understand what test codes corresponds to the implementation. Use hw/net/e1000_regs.h from tests/qtest/libqos/e1000e.c to remove these duplications. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230114035919.35251-20-akihiko.odaki@daynix.com> Signed-off-by: Thomas Huth --- tests/qtest/libqos/e1000e.h | 5 ----- tests/qtest/libqos/e1000e.c | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/tests/qtest/libqos/e1000e.h b/tests/qtest/libqos/e1000e.h index 3bf285af42..091ce139da 100644 --- a/tests/qtest/libqos/e1000e.h +++ b/tests/qtest/libqos/e1000e.h @@ -25,11 +25,6 @@ #define E1000E_RX0_MSG_ID (0) #define E1000E_TX0_MSG_ID (1) =20 -#define E1000E_TDLEN (0x3808) -#define E1000E_TDT (0x3818) -#define E1000E_RDLEN (0x2808) -#define E1000E_RDT (0x2818) - typedef struct QE1000E QE1000E; typedef struct QE1000E_PCI QE1000E_PCI; =20 diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest/libqos/e1000e.c index b90eb2d5e0..28fb3052aa 100644 --- a/tests/qtest/libqos/e1000e.c +++ b/tests/qtest/libqos/e1000e.c @@ -51,13 +51,13 @@ static uint32_t e1000e_macreg_read(QE1000E *d, uint32_t= reg) void e1000e_tx_ring_push(QE1000E *d, void *descr) { QE1000E_PCI *d_pci =3D container_of(d, QE1000E_PCI, e1000e); - uint32_t tail =3D e1000e_macreg_read(d, E1000E_TDT); - uint32_t len =3D e1000e_macreg_read(d, E1000E_TDLEN) / E1000_RING_DESC= _LEN; + uint32_t tail =3D e1000e_macreg_read(d, E1000_TDT); + uint32_t len =3D e1000e_macreg_read(d, E1000_TDLEN) / E1000_RING_DESC_= LEN; =20 qtest_memwrite(d_pci->pci_dev.bus->qts, d->tx_ring + tail * E1000_RING_DESC_LEN, descr, E1000_RING_DESC_LEN); - e1000e_macreg_write(d, E1000E_TDT, (tail + 1) % len); + e1000e_macreg_write(d, E1000_TDT, (tail + 1) % len); =20 /* Read WB data for the packet transmitted */ qtest_memread(d_pci->pci_dev.bus->qts, @@ -68,13 +68,13 @@ void e1000e_tx_ring_push(QE1000E *d, void *descr) void e1000e_rx_ring_push(QE1000E *d, void *descr) { QE1000E_PCI *d_pci =3D container_of(d, QE1000E_PCI, e1000e); - uint32_t tail =3D e1000e_macreg_read(d, E1000E_RDT); - uint32_t len =3D e1000e_macreg_read(d, E1000E_RDLEN) / E1000_RING_DESC= _LEN; + uint32_t tail =3D e1000e_macreg_read(d, E1000_RDT); + uint32_t len =3D e1000e_macreg_read(d, E1000_RDLEN) / E1000_RING_DESC_= LEN; =20 qtest_memwrite(d_pci->pci_dev.bus->qts, d->rx_ring + tail * E1000_RING_DESC_LEN, descr, E1000_RING_DESC_LEN); - e1000e_macreg_write(d, E1000E_RDT, (tail + 1) % len); + e1000e_macreg_write(d, E1000_RDT, (tail + 1) % len); =20 /* Read WB data for the packet received */ qtest_memread(d_pci->pci_dev.bus->qts, @@ -145,8 +145,8 @@ static void e1000e_pci_start_hw(QOSGraphObject *obj) (uint32_t) d->e1000e.tx_ring); e1000e_macreg_write(&d->e1000e, E1000_TDBAH, (uint32_t) (d->e1000e.tx_ring >> 32)); - e1000e_macreg_write(&d->e1000e, E1000E_TDLEN, E1000E_RING_LEN); - e1000e_macreg_write(&d->e1000e, E1000E_TDT, 0); + e1000e_macreg_write(&d->e1000e, E1000_TDLEN, E1000E_RING_LEN); + e1000e_macreg_write(&d->e1000e, E1000_TDT, 0); e1000e_macreg_write(&d->e1000e, E1000_TDH, 0); =20 /* Enable transmit */ @@ -156,8 +156,8 @@ static void e1000e_pci_start_hw(QOSGraphObject *obj) (uint32_t)d->e1000e.rx_ring); e1000e_macreg_write(&d->e1000e, E1000_RDBAH, (uint32_t)(d->e1000e.rx_ring >> 32)); - e1000e_macreg_write(&d->e1000e, E1000E_RDLEN, E1000E_RING_LEN); - e1000e_macreg_write(&d->e1000e, E1000E_RDT, 0); + e1000e_macreg_write(&d->e1000e, E1000_RDLEN, E1000E_RING_LEN); + e1000e_macreg_write(&d->e1000e, E1000_RDT, 0); e1000e_macreg_write(&d->e1000e, E1000_RDH, 0); =20 /* Enable receive */ --=20 2.31.1