All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Fix eepro100 simple transmission, add i82559 chipset
@ 2017-10-31 15:54 Mike Nawrocki
  2017-10-31 15:54 ` [Qemu-devel] [PATCH 1/2] Fix eepro100 simple transmission mode Mike Nawrocki
  2017-10-31 15:54 ` [Qemu-devel] [PATCH 2/2] Add i82559a eepro100 interface Mike Nawrocki
  0 siblings, 2 replies; 7+ messages in thread
From: Mike Nawrocki @ 2017-10-31 15:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: jasowang, mst, marcel, Mike Nawrocki

This patch set does two things. First, it fixes the simple transmission mode
for the eepro100 chipset. Second, it adds and uses the PCI ID for the i82559
chipset, and enables selection of this chipset.

Mike Nawrocki (2):
  Fix eepro100 simple transmission mode
  Add i82559a eepro100 interface

 hw/net/eepro100.c    | 20 ++++----------------
 hw/pci/pci.c         |  2 ++
 include/hw/pci/pci.h |  1 +
 qemu-options.hx      |  2 +-
 4 files changed, 8 insertions(+), 17 deletions(-)

-- 
2.14.2

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 1/2] Fix eepro100 simple transmission mode
  2017-10-31 15:54 [Qemu-devel] [PATCH 0/2] Fix eepro100 simple transmission, add i82559 chipset Mike Nawrocki
@ 2017-10-31 15:54 ` Mike Nawrocki
  2017-10-31 15:54 ` [Qemu-devel] [PATCH 2/2] Add i82559a eepro100 interface Mike Nawrocki
  1 sibling, 0 replies; 7+ messages in thread
From: Mike Nawrocki @ 2017-10-31 15:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: jasowang, mst, marcel, Mike Nawrocki

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 <michael.nawrocki@gtri.gatech.edu>
---
 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 <= sizeof(buf));
     while (size < tcb_bytes) {
-        uint32_t tx_buffer_address = ldl_le_pci_dma(&s->dev, tbd_address);
-        uint16_t tx_buffer_size = lduw_le_pci_dma(&s->dev, tbd_address + 4);
-#if 0
-        uint16_t tx_buffer_el = lduw_le_pci_dma(&s->dev, tbd_address + 6);
-#endif
-        if (tx_buffer_size == 0) {
-            /* Prevent an endless loop. */
-            logout("loop in %s:%u\n", __FILE__, __LINE__);
-            break;
-        }
-        tbd_address += 8;
         TRACE(RXTX, logout
             ("TBD (simplified mode): buffer address 0x%08x, size 0x%04x\n",
-             tx_buffer_address, tx_buffer_size));
-        tx_buffer_size = MIN(tx_buffer_size, sizeof(buf) - size);
-        pci_dma_read(&s->dev, tx_buffer_address, &buf[size], tx_buffer_size);
-        size += tx_buffer_size;
+             tbd_address, tcb_bytes));
+        pci_dma_read(&s->dev, tbd_address, &buf[size], tcb_bytes);
+        size += tcb_bytes;
     }
     if (tbd_array == 0xffffffff) {
         /* Simplified mode. Was already handled by code above. */
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 2/2] Add i82559a eepro100 interface
  2017-10-31 15:54 [Qemu-devel] [PATCH 0/2] Fix eepro100 simple transmission, add i82559 chipset Mike Nawrocki
  2017-10-31 15:54 ` [Qemu-devel] [PATCH 1/2] Fix eepro100 simple transmission mode Mike Nawrocki
@ 2017-10-31 15:54 ` Mike Nawrocki
  2017-10-31 17:50   ` Dr. David Alan Gilbert
  1 sibling, 1 reply; 7+ messages in thread
From: Mike Nawrocki @ 2017-10-31 15:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: jasowang, mst, marcel, Mike Nawrocki

Signed-off-by: Mike Nawrocki <michael.nawrocki@gtri.gatech.edu>
---
 hw/net/eepro100.c    | 2 +-
 hw/pci/pci.c         | 2 ++
 include/hw/pci/pci.h | 1 +
 qemu-options.hx      | 2 +-
 4 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index 91dd058010..2c7c5cdeb9 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -1973,7 +1973,7 @@ static E100PCIDeviceInfo e100_devices[] = {
         .name = "i82559a",
         .desc = "Intel i82559A Ethernet",
         .device = i82559A,
-        .device_id = PCI_DEVICE_ID_INTEL_82557,
+        .device_id = PCI_DEVICE_ID_INTEL_82559,
         .revision = 0x06,
         .stats_size = 80,
         .has_extended_tcb_support = true,
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 5ed3c8dca4..1126ad1eb3 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1826,6 +1826,7 @@ static const char * const pci_nic_models[] = {
     "ne2k_pci",
     "i82551",
     "i82557b",
+    "i82559a",
     "i82559er",
     "rtl8139",
     "e1000",
@@ -1839,6 +1840,7 @@ static const char * const pci_nic_names[] = {
     "ne2k_pci",
     "i82551",
     "i82557b",
+    "i82559a",
     "i82559er",
     "rtl8139",
     "e1000",
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
 
 /* 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} = 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{i82559er},
 @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=help}
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] Add i82559a eepro100 interface
  2017-10-31 15:54 ` [Qemu-devel] [PATCH 2/2] Add i82559a eepro100 interface Mike Nawrocki
@ 2017-10-31 17:50   ` Dr. David Alan Gilbert
  2017-11-01 14:48     ` Nawrocki, Michael
  0 siblings, 1 reply; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2017-10-31 17:50 UTC (permalink / raw)
  To: Mike Nawrocki; +Cc: qemu-devel, marcel, jasowang, mst

* Mike Nawrocki (michael.nawrocki@gtri.gatech.edu) wrote:
> Signed-off-by: Mike Nawrocki <michael.nawrocki@gtri.gatech.edu>
> ---
>  hw/net/eepro100.c    | 2 +-
>  hw/pci/pci.c         | 2 ++
>  include/hw/pci/pci.h | 1 +
>  qemu-options.hx      | 2 +-
>  4 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
> index 91dd058010..2c7c5cdeb9 100644
> --- a/hw/net/eepro100.c
> +++ b/hw/net/eepro100.c
> @@ -1973,7 +1973,7 @@ static E100PCIDeviceInfo e100_devices[] = {
>          .name = "i82559a",
>          .desc = "Intel i82559A Ethernet",
>          .device = i82559A,
> -        .device_id = PCI_DEVICE_ID_INTEL_82557,
> +        .device_id = PCI_DEVICE_ID_INTEL_82559,

Doesn't that break migration/compatibility - if one side suddenly
sees a different device_id ?

Dave

>          .revision = 0x06,
>          .stats_size = 80,
>          .has_extended_tcb_support = true,
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 5ed3c8dca4..1126ad1eb3 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -1826,6 +1826,7 @@ static const char * const pci_nic_models[] = {
>      "ne2k_pci",
>      "i82551",
>      "i82557b",
> +    "i82559a",
>      "i82559er",
>      "rtl8139",
>      "e1000",
> @@ -1839,6 +1840,7 @@ static const char * const pci_nic_names[] = {
>      "ne2k_pci",
>      "i82551",
>      "i82557b",
> +    "i82559a",
>      "i82559er",
>      "rtl8139",
>      "e1000",
> 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
>  
>  /* 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} = 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{i82559er},
>  @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=help}
> -- 
> 2.14.2
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] Add i82559a eepro100 interface
  2017-10-31 17:50   ` Dr. David Alan Gilbert
@ 2017-11-01 14:48     ` Nawrocki, Michael
  2017-11-01 15:32       ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Nawrocki, Michael @ 2017-11-01 14:48 UTC (permalink / raw)
  To: Dr. David Alan Gilbert; +Cc: qemu-devel, marcel, jasowang, mst

On 10/31/17, 13:50, "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:

    * Mike Nawrocki (michael.nawrocki@gtri.gatech.edu) wrote:
    > Signed-off-by: Mike Nawrocki <michael.nawrocki@gtri.gatech.edu>
    > ---
    >  hw/net/eepro100.c    | 2 +-
    >  hw/pci/pci.c         | 2 ++
    >  include/hw/pci/pci.h | 1 +
    >  qemu-options.hx      | 2 +-
    >  4 files changed, 5 insertions(+), 2 deletions(-)
    > 
    > diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
    > index 91dd058010..2c7c5cdeb9 100644
    > --- a/hw/net/eepro100.c
    > +++ b/hw/net/eepro100.c
    > @@ -1973,7 +1973,7 @@ static E100PCIDeviceInfo e100_devices[] = {
    >          .name = "i82559a",
    >          .desc = "Intel i82559A Ethernet",
    >          .device = i82559A,
    > -        .device_id = PCI_DEVICE_ID_INTEL_82557,
    > +        .device_id = PCI_DEVICE_ID_INTEL_82559,
    
    Doesn't that break migration/compatibility - if one side suddenly
    sees a different device_id ?
    
    Dave

I’m not sure. I searched for code references to the i82559a interface and couldn’t find any outside of the driver itself; it wasn’t exported as a pci_nic_model before my patch, so I don’t think the i82559a device was being used, programmatically or via the command line, before this point. Perhaps there’s a different way to use the device that I’m not aware of?

I think the ID I’m using (0x8086 0x1030 – Intel Corporation 82559 InBusiness 10/100) is more accurate to the chipset, and a driver I’ve got explicitly searches for this ID. Most drivers seem to search for a number of PCI IDs in the eepro100 family, at any rate, so I think it should be okay. Let me know if another approach is preferable.

Thanks,
Mike
    
    >          .revision = 0x06,
    >          .stats_size = 80,
    >          .has_extended_tcb_support = true,
    > diff --git a/hw/pci/pci.c b/hw/pci/pci.c
    > index 5ed3c8dca4..1126ad1eb3 100644
    > --- a/hw/pci/pci.c
    > +++ b/hw/pci/pci.c
    > @@ -1826,6 +1826,7 @@ static const char * const pci_nic_models[] = {
    >      "ne2k_pci",
    >      "i82551",
    >      "i82557b",
    > +    "i82559a",
    >      "i82559er",
    >      "rtl8139",
    >      "e1000",
    > @@ -1839,6 +1840,7 @@ static const char * const pci_nic_names[] = {
    >      "ne2k_pci",
    >      "i82551",
    >      "i82557b",
    > +    "i82559a",
    >      "i82559er",
    >      "rtl8139",
    >      "e1000",
    > 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
    >  
    >  /* 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} = 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{i82559er},
    >  @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=help}
    > -- 
    > 2.14.2
    > 
    > 
    --
    Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
    


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] Add i82559a eepro100 interface
  2017-11-01 14:48     ` Nawrocki, Michael
@ 2017-11-01 15:32       ` Michael S. Tsirkin
  2017-11-06 20:23         ` Michael Nawrocki
  0 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2017-11-01 15:32 UTC (permalink / raw)
  To: Nawrocki, Michael; +Cc: Dr. David Alan Gilbert, qemu-devel, marcel, jasowang

On Wed, Nov 01, 2017 at 02:48:17PM +0000, Nawrocki, Michael wrote:
> On 10/31/17, 13:50, "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
> 
>     * Mike Nawrocki (michael.nawrocki@gtri.gatech.edu) wrote:
>     > Signed-off-by: Mike Nawrocki <michael.nawrocki@gtri.gatech.edu>
>     > ---
>     >  hw/net/eepro100.c    | 2 +-
>     >  hw/pci/pci.c         | 2 ++
>     >  include/hw/pci/pci.h | 1 +
>     >  qemu-options.hx      | 2 +-
>     >  4 files changed, 5 insertions(+), 2 deletions(-)
>     > 
>     > diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
>     > index 91dd058010..2c7c5cdeb9 100644
>     > --- a/hw/net/eepro100.c
>     > +++ b/hw/net/eepro100.c
>     > @@ -1973,7 +1973,7 @@ static E100PCIDeviceInfo e100_devices[] = {
>     >          .name = "i82559a",
>     >          .desc = "Intel i82559A Ethernet",
>     >          .device = i82559A,
>     > -        .device_id = PCI_DEVICE_ID_INTEL_82557,
>     > +        .device_id = PCI_DEVICE_ID_INTEL_82559,
>     
>     Doesn't that break migration/compatibility - if one side suddenly
>     sees a different device_id ?
>     
>     Dave
> 
> I’m not sure. I searched for code references to the i82559a interface and couldn’t find any outside of the driver itself; it wasn’t exported as a pci_nic_model before my patch, so I don’t think the i82559a device was being used, programmatically or via the command line, before this point. Perhaps there’s a different way to use the device that I’m not aware of?

the modern way to create devices is with -devices.

> I think the ID I’m using (0x8086 0x1030 – Intel Corporation 82559 InBusiness 10/100) is more accurate to the chipset, and a driver I’ve got explicitly searches for this ID. Most drivers seem to search for a number of PCI IDs in the eepro100 family, at any rate, so I think it should be okay. Let me know if another approach is preferable.
> 
> Thanks,
> Mike

You need a property and set it to a compat value for
old machine types.

>     >          .revision = 0x06,
>     >          .stats_size = 80,
>     >          .has_extended_tcb_support = true,
>     > diff --git a/hw/pci/pci.c b/hw/pci/pci.c
>     > index 5ed3c8dca4..1126ad1eb3 100644
>     > --- a/hw/pci/pci.c
>     > +++ b/hw/pci/pci.c
>     > @@ -1826,6 +1826,7 @@ static const char * const pci_nic_models[] = {
>     >      "ne2k_pci",
>     >      "i82551",
>     >      "i82557b",
>     > +    "i82559a",
>     >      "i82559er",
>     >      "rtl8139",
>     >      "e1000",
>     > @@ -1839,6 +1840,7 @@ static const char * const pci_nic_names[] = {
>     >      "ne2k_pci",
>     >      "i82551",
>     >      "i82557b",
>     > +    "i82559a",
>     >      "i82559er",
>     >      "rtl8139",
>     >      "e1000",

There's no need to add more nic names here. Just create with -device.


>     > 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
>     >  
>     >  /* 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} = 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{i82559er},
>     >  @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=help}
>     > -- 
>     > 2.14.2
>     > 
>     > 
>     --
>     Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
>     
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] Add i82559a eepro100 interface
  2017-11-01 15:32       ` Michael S. Tsirkin
@ 2017-11-06 20:23         ` Michael Nawrocki
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Nawrocki @ 2017-11-06 20:23 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Dr. David Alan Gilbert, qemu-devel, marcel, jasowang


On 11/01/2017 11:32 AM, Michael S. Tsirkin wrote:
> On Wed, Nov 01, 2017 at 02:48:17PM +0000, Nawrocki, Michael wrote:
>> On 10/31/17, 13:50, "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
>>
>>      * Mike Nawrocki (michael.nawrocki@gtri.gatech.edu) wrote:
>>      > Signed-off-by: Mike Nawrocki <michael.nawrocki@gtri.gatech.edu>
>>      > ---
>>      >  hw/net/eepro100.c    | 2 +-
>>      >  hw/pci/pci.c         | 2 ++
>>      >  include/hw/pci/pci.h | 1 +
>>      >  qemu-options.hx      | 2 +-
>>      >  4 files changed, 5 insertions(+), 2 deletions(-)
>>      >
>>      > diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
>>      > index 91dd058010..2c7c5cdeb9 100644
>>      > --- a/hw/net/eepro100.c
>>      > +++ b/hw/net/eepro100.c
>>      > @@ -1973,7 +1973,7 @@ static E100PCIDeviceInfo e100_devices[] = {
>>      >          .name = "i82559a",
>>      >          .desc = "Intel i82559A Ethernet",
>>      >          .device = i82559A,
>>      > -        .device_id = PCI_DEVICE_ID_INTEL_82557,
>>      > +        .device_id = PCI_DEVICE_ID_INTEL_82559,
>>      
>>      Doesn't that break migration/compatibility - if one side suddenly
>>      sees a different device_id ?
>>      
>>      Dave
>>
>> I’m not sure. I searched for code references to the i82559a interface and couldn’t find any outside of the driver itself; it wasn’t exported as a pci_nic_model before my patch, so I don’t think the i82559a device was being used, programmatically or via the command line, before this point. Perhaps there’s a different way to use the device that I’m not aware of?
> 
> the modern way to create devices is with -devices.
> 

Gotcha. I've updated my usage to reflect this.


>> I think the ID I’m using (0x8086 0x1030 – Intel Corporation 82559 InBusiness 10/100) is more accurate to the chipset, and a driver I’ve got explicitly searches for this ID. Most drivers seem to search for a number of PCI IDs in the eepro100 family, at any rate, so I think it should be okay. Let me know if another approach is preferable.
>>
>> Thanks,
>> Mike
> 
> You need a property and set it to a compat value for
> old machine types.

I've added a "use-alt-device-id" boolean property, an "alt_device_id" 
field in the info struct, and reverted the device_id to the 82557 one. 
I'll push the v2 patches shortly.

> 
>>      >          .revision = 0x06,
>>      >          .stats_size = 80,
>>      >          .has_extended_tcb_support = true,
>>      > diff --git a/hw/pci/pci.c b/hw/pci/pci.c
>>      > index 5ed3c8dca4..1126ad1eb3 100644
>>      > --- a/hw/pci/pci.c
>>      > +++ b/hw/pci/pci.c
>>      > @@ -1826,6 +1826,7 @@ static const char * const pci_nic_models[] = {
>>      >      "ne2k_pci",
>>      >      "i82551",
>>      >      "i82557b",
>>      > +    "i82559a",
>>      >      "i82559er",
>>      >      "rtl8139",
>>      >      "e1000",
>>      > @@ -1839,6 +1840,7 @@ static const char * const pci_nic_names[] = {
>>      >      "ne2k_pci",
>>      >      "i82551",
>>      >      "i82557b",
>>      > +    "i82559a",
>>      >      "i82559er",
>>      >      "rtl8139",
>>      >      "e1000",
> 
> There's no need to add more nic names here. Just create with -device.

Gotcha. I've removed these in the upcoming patches.

Thanks,
Mike
> 
> 
>>      > 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
>>      >
>>      >  /* 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} = 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{i82559er},
>>      >  @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=help}
>>      > --
>>      > 2.14.2
>>      >
>>      >
>>      --
>>      Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
>>      
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-06 20:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-31 15:54 [Qemu-devel] [PATCH 0/2] Fix eepro100 simple transmission, add i82559 chipset Mike Nawrocki
2017-10-31 15:54 ` [Qemu-devel] [PATCH 1/2] Fix eepro100 simple transmission mode Mike Nawrocki
2017-10-31 15:54 ` [Qemu-devel] [PATCH 2/2] Add i82559a eepro100 interface Mike Nawrocki
2017-10-31 17:50   ` Dr. David Alan Gilbert
2017-11-01 14:48     ` Nawrocki, Michael
2017-11-01 15:32       ` Michael S. Tsirkin
2017-11-06 20:23         ` Michael Nawrocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.