From nobody Sun Apr 28 22:25:12 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510079842477350.46580482522813; Tue, 7 Nov 2017 10:37:22 -0800 (PST) Received: from localhost ([::1]:55304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC8k9-0000Fs-Lu for importer@patchew.org; Tue, 07 Nov 2017 13:37:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC8il-00087N-Fd for qemu-devel@nongnu.org; Tue, 07 Nov 2017 13:35:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC8ig-0003CZ-Qp for qemu-devel@nongnu.org; Tue, 07 Nov 2017 13:35:35 -0500 Received: from relay2.gtri.gatech.edu ([130.207.199.168]:43732) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eC8ig-0003BW-BW for qemu-devel@nongnu.org; Tue, 07 Nov 2017 13:35:30 -0500 Received: from kiawah.core.gtri.org (kiawah.core.gtri.org [10.41.31.71]) by relay2.gtri.gatech.edu with ESMTP id BN8dT6YCPyX3fAsH (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Tue, 07 Nov 2017 13:35:28 -0500 (EST) Received: from tybee.core.gtri.org (10.41.1.49) by kiawah.core.gtri.org (10.41.31.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Tue, 7 Nov 2017 13:35:28 -0500 Received: from tia-mxn-d01.ctisl.gtri.org (130.207.205.130) by tybee.core.gtri.org (10.41.1.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Tue, 7 Nov 2017 13:35:28 -0500 X-ASG-Debug-ID: 1510079728-0768e41b31724ab0001-jgbH7p X-Barracuda-Envelope-From: Michael.Nawrocki@gtri.gatech.edu From: Mike Nawrocki To: Date: Tue, 7 Nov 2017 13:35:02 -0500 X-ASG-Orig-Subj: [PATCH v3 1/2] Fix eepro100 simple transmission mode Message-ID: <20171107183503.6800-2-michael.nawrocki@gtri.gatech.edu> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107183503.6800-1-michael.nawrocki@gtri.gatech.edu> References: <20171107183503.6800-1-michael.nawrocki@gtri.gatech.edu> MIME-Version: 1.0 X-Originating-IP: [130.207.205.130] X-ClientProxiedBy: apatlisdmfe4.core.gtri.org (10.41.47.104) To tybee.core.gtri.org (10.41.1.49) X-Barracuda-Connect: kiawah.core.gtri.org[10.41.31.71] X-Barracuda-Start-Time: 1510079728 X-Barracuda-Encrypted: ECDHE-RSA-AES128-SHA256 X-Barracuda-URL: https://130.207.199.168:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at gtri.gatech.edu X-Barracuda-Scan-Msg-Size: 1788 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=1000.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.44584 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 130.207.199.168 Subject: [Qemu-devel] [PATCH v3 1/2] Fix eepro100 simple transmission mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcel@redhat.com, jasowang@redhat.com, Mike Nawrocki , mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The simple transmission mode was treating the area immediately after the transmit command block (TCB) as if it were a transmit buffer descriptor, when in reality it is simply the packet data. This change simply copies the data following the TCB into the packet buffer. Signed-off-by: Mike Nawrocki Reviewed-by: Michael S. Tsirkin --- hw/net/eepro100.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 80b8f47c4b..91dd058010 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -774,23 +774,11 @@ static void tx_command(EEPRO100State *s) } assert(tcb_bytes <=3D sizeof(buf)); while (size < tcb_bytes) { - uint32_t tx_buffer_address =3D ldl_le_pci_dma(&s->dev, tbd_address= ); - uint16_t tx_buffer_size =3D lduw_le_pci_dma(&s->dev, tbd_address += 4); -#if 0 - uint16_t tx_buffer_el =3D lduw_le_pci_dma(&s->dev, tbd_address + 6= ); -#endif - if (tx_buffer_size =3D=3D 0) { - /* Prevent an endless loop. */ - logout("loop in %s:%u\n", __FILE__, __LINE__); - break; - } - tbd_address +=3D 8; TRACE(RXTX, logout ("TBD (simplified mode): buffer address 0x%08x, size 0x%04x\n", - tx_buffer_address, tx_buffer_size)); - tx_buffer_size =3D MIN(tx_buffer_size, sizeof(buf) - size); - pci_dma_read(&s->dev, tx_buffer_address, &buf[size], tx_buffer_siz= e); - size +=3D tx_buffer_size; + tbd_address, tcb_bytes)); + pci_dma_read(&s->dev, tbd_address, &buf[size], tcb_bytes); + size +=3D tcb_bytes; } if (tbd_array =3D=3D 0xffffffff) { /* Simplified mode. Was already handled by code above. */ --=20 2.14.2 From nobody Sun Apr 28 22:25:12 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510079929177381.6889273079513; Tue, 7 Nov 2017 10:38:49 -0800 (PST) Received: from localhost ([::1]:55311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC8lY-00017p-Cu for importer@patchew.org; Tue, 07 Nov 2017 13:38:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eC8il-00087M-FW for qemu-devel@nongnu.org; Tue, 07 Nov 2017 13:35:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eC8ig-0003CU-QI for qemu-devel@nongnu.org; Tue, 07 Nov 2017 13:35:35 -0500 Received: from relay2.gtri.gatech.edu ([130.207.199.168]:43739) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eC8ig-0003Bk-BX for qemu-devel@nongnu.org; Tue, 07 Nov 2017 13:35:30 -0500 Received: from kiawah.core.gtri.org (kiawah.core.gtri.org [10.41.31.71]) by relay2.gtri.gatech.edu with ESMTP id GRUDogNlTPFTEZti (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Tue, 07 Nov 2017 13:35:28 -0500 (EST) Received: from tybee.core.gtri.org (10.41.1.49) by kiawah.core.gtri.org (10.41.31.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Tue, 7 Nov 2017 13:35:28 -0500 Received: from tia-mxn-d01.ctisl.gtri.org (130.207.205.130) by tybee.core.gtri.org (10.41.1.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Tue, 7 Nov 2017 13:35:28 -0500 X-ASG-Debug-ID: 1510079728-0768e41b31724ab0002-jgbH7p X-Barracuda-Envelope-From: Michael.Nawrocki@gtri.gatech.edu From: Mike Nawrocki To: Date: Tue, 7 Nov 2017 13:35:03 -0500 X-ASG-Orig-Subj: [PATCH v3 2/2] Add new PCI ID for i82559a Message-ID: <20171107183503.6800-3-michael.nawrocki@gtri.gatech.edu> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107183503.6800-1-michael.nawrocki@gtri.gatech.edu> References: <20171107183503.6800-1-michael.nawrocki@gtri.gatech.edu> MIME-Version: 1.0 X-Originating-IP: [130.207.205.130] X-ClientProxiedBy: apatlisdmfe4.core.gtri.org (10.41.47.104) To tybee.core.gtri.org (10.41.1.49) X-Barracuda-Connect: kiawah.core.gtri.org[10.41.31.71] X-Barracuda-Start-Time: 1510079728 X-Barracuda-Encrypted: ECDHE-RSA-AES128-SHA256 X-Barracuda-URL: https://130.207.199.168:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at gtri.gatech.edu X-Barracuda-Scan-Msg-Size: 4026 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=1000.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.44584 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 130.207.199.168 Subject: [Qemu-devel] [PATCH v3 2/2] Add new PCI ID for i82559a X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcel@redhat.com, jasowang@redhat.com, Mike Nawrocki , mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Adds a new PCI ID for the i82559a (0x8086 0x1030) interface. The "x-use-alt-device-id" property controls whether this new ID is to be used, and is true by default, and set to false in a compat entry. Signed-off-by: Mike Nawrocki Reviewed-by: Michael S. Tsirkin --- hw/net/eepro100.c | 13 +++++++++++++ include/hw/compat.h | 4 ++++ include/hw/pci/pci.h | 1 + qemu-options.hx | 2 +- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 91dd058010..a63ed2ca3b 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -132,6 +132,7 @@ typedef struct { const char *name; const char *desc; uint16_t device_id; + uint16_t alt_device_id; uint8_t revision; uint16_t subsystem_vendor_id; uint16_t subsystem_id; @@ -276,6 +277,7 @@ typedef struct { /* Quasi static device properties (no need to save them). */ uint16_t stats_size; bool has_extended_tcb_support; + bool use_alt_device_id; } EEPRO100State; =20 /* Word indices in EEPROM. */ @@ -1855,6 +1857,14 @@ static void e100_nic_realize(PCIDevice *pci_dev, Err= or **errp) =20 TRACE(OTHER, logout("\n")); =20 + /* By default, the i82559a adapter uses the legacy PCI ID (for the + * i82557). This allows the PCI ID to be changed to the alternate + * i82559 ID if needed. + */ + if (s->use_alt_device_id && strcmp(info->name, "i82559a") =3D=3D 0) { + pci_config_set_device_id(s->dev.config, info->alt_device_id); + } + s->device =3D info->device; =20 e100_pci_reset(s, &local_err); @@ -1974,6 +1984,7 @@ static E100PCIDeviceInfo e100_devices[] =3D { .desc =3D "Intel i82559A Ethernet", .device =3D i82559A, .device_id =3D PCI_DEVICE_ID_INTEL_82557, + .alt_device_id =3D PCI_DEVICE_ID_INTEL_82559, .revision =3D 0x06, .stats_size =3D 80, .has_extended_tcb_support =3D true, @@ -2067,6 +2078,8 @@ static E100PCIDeviceInfo *eepro100_get_class(EEPRO100= State *s) =20 static Property e100_properties[] =3D { DEFINE_NIC_PROPERTIES(EEPRO100State, conf), + DEFINE_PROP_BOOL("x-use-alt-device-id", EEPRO100State, use_alt_device_= id, + true), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/compat.h b/include/hw/compat.h index cf389b4e85..f96212c49c 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -10,6 +10,10 @@ .driver =3D "virtio-tablet-device",\ .property =3D "wheel-axis",\ .value =3D "false",\ + },{\ + .driver =3D "i82559a",\ + .property =3D "x-use-alt-device-id",\ + .value =3D "false",\ }, =20 #define HW_COMPAT_2_9 \ diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 8d02a0a383..f30e2cfb72 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -70,6 +70,7 @@ extern bool pci_available; /* Intel (0x8086) */ #define PCI_DEVICE_ID_INTEL_82551IT 0x1209 #define PCI_DEVICE_ID_INTEL_82557 0x1229 +#define PCI_DEVICE_ID_INTEL_82559 0x1030 #define PCI_DEVICE_ID_INTEL_82801IR 0x2922 =20 /* Red Hat / Qumranet (for QEMU) -- see pci-ids.txt */ diff --git a/qemu-options.hx b/qemu-options.hx index 3728e9b4dd..a39c7e44b3 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2047,7 +2047,7 @@ that the card should have; this option currently only= affects virtio cards; set @var{v} =3D 0 to disable MSI-X. If no @option{-net} option is specified, a= single NIC is created. QEMU can emulate several different models of network card. Valid values for @var{type} are -@code{virtio}, @code{i82551}, @code{i82557b}, @code{i82559er}, +@code{virtio}, @code{i82551}, @code{i82557b}, @code{i82559a}, @code{i82559= er}, @code{ne2k_pci}, @code{ne2k_isa}, @code{pcnet}, @code{rtl8139}, @code{e1000}, @code{smc91c111}, @code{lance} and @code{mcf_fec}. Not all devices are supported on all targets. Use @code{-net nic,model=3D= help} --=20 2.14.2