diff mbox

[PULL,2/2] e1000e: remove internal interrupt flag

Message ID 1471853367-18474-3-git-send-email-jasowang@redhat.com
State New
Headers show

Commit Message

Jason Wang Aug. 22, 2016, 8:09 a.m. UTC
From: Cao jin <caoj.fnst@cn.fujitsu.com>

Commit 66bf7d58 removed internal msi state flag E1000E_USE_MSI, E1000E_USE_MSIX
is not necessary too, remove it now. And interrupt flag field intr_state also
can be removed now.

CC: Dmitry Fleytman <dmitry@daynix.com>
CC: Jason Wang <jasowang@redhat.com>
CC: Markus Armbruster <armbru@redhat.com>
CC: Marcel Apfelbaum <marcel@redhat.com>
CC: Michael S. Tsirkin <mst@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Dmitry Fleytman <dmitry@daynix.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/e1000e.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Amit Shah Aug. 23, 2016, 7:16 p.m. UTC | #1
On (Mon) 22 Aug 2016 [16:09:27], Jason Wang wrote:
> From: Cao jin <caoj.fnst@cn.fujitsu.com>
> 
> Commit 66bf7d58 removed internal msi state flag E1000E_USE_MSI, E1000E_USE_MSIX
> is not necessary too, remove it now. And interrupt flag field intr_state also
> can be removed now.
> 
> CC: Dmitry Fleytman <dmitry@daynix.com>
> CC: Jason Wang <jasowang@redhat.com>
> CC: Markus Armbruster <armbru@redhat.com>
> CC: Marcel Apfelbaum <marcel@redhat.com>
> CC: Michael S. Tsirkin <mst@redhat.com>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> Acked-by: Dmitry Fleytman <dmitry@daynix.com>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  hw/net/e1000e.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)


> @@ -601,7 +596,6 @@ static const VMStateDescription e1000e_vmstate = {
>          VMSTATE_MSIX(parent_obj, E1000EState),
>  
>          VMSTATE_UINT32(ioaddr, E1000EState),
> -        VMSTATE_UINT32(intr_state, E1000EState),
>          VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
>          VMSTATE_UINT8(core.rx_desc_len, E1000EState),
>          VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,

This breaks migration - please mark that field 'unused'.
Michael S. Tsirkin Aug. 23, 2016, 8:12 p.m. UTC | #2
On Mon, Aug 22, 2016 at 04:09:27PM +0800, Jason Wang wrote:
> From: Cao jin <caoj.fnst@cn.fujitsu.com>
> 
> Commit 66bf7d58 removed internal msi state flag E1000E_USE_MSI, E1000E_USE_MSIX
> is not necessary too, remove it now. And interrupt flag field intr_state also
> can be removed now.
> 
> CC: Dmitry Fleytman <dmitry@daynix.com>
> CC: Jason Wang <jasowang@redhat.com>
> CC: Markus Armbruster <armbru@redhat.com>
> CC: Marcel Apfelbaum <marcel@redhat.com>
> CC: Michael S. Tsirkin <mst@redhat.com>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> Acked-by: Dmitry Fleytman <dmitry@daynix.com>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>

We really shouldn't merge cleanups at this stage, imho.

> ---
>  hw/net/e1000e.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
> index d001c96..bad43f4 100644
> --- a/hw/net/e1000e.c
> +++ b/hw/net/e1000e.c
> @@ -69,7 +69,6 @@ typedef struct E1000EState {
>      uint16_t subsys_ven_used;
>      uint16_t subsys_used;
>  
> -    uint32_t intr_state;
>      bool disable_vnet;
>  
>      E1000ECore core;
> @@ -89,8 +88,6 @@ typedef struct E1000EState {
>  #define E1000E_MSIX_TABLE   (0x0000)
>  #define E1000E_MSIX_PBA     (0x2000)
>  
> -#define E1000E_USE_MSIX    BIT(0)
> -
>  static uint64_t
>  e1000e_mmio_read(void *opaque, hwaddr addr, unsigned size)
>  {
> @@ -302,8 +299,6 @@ e1000e_init_msix(E1000EState *s)
>      } else {
>          if (!e1000e_use_msix_vectors(s, E1000E_MSIX_VEC_NUM)) {
>              msix_uninit(d, &s->msix, &s->msix);
> -        } else {
> -            s->intr_state |= E1000E_USE_MSIX;
>          }
>      }
>  }
> @@ -311,7 +306,7 @@ e1000e_init_msix(E1000EState *s)
>  static void
>  e1000e_cleanup_msix(E1000EState *s)
>  {
> -    if (s->intr_state & E1000E_USE_MSIX) {
> +    if (msix_enabled(PCI_DEVICE(s))) {
>          e1000e_unuse_msix_vectors(s, E1000E_MSIX_VEC_NUM);
>          msix_uninit(PCI_DEVICE(s), &s->msix, &s->msix);
>      }
> @@ -601,7 +596,6 @@ static const VMStateDescription e1000e_vmstate = {
>          VMSTATE_MSIX(parent_obj, E1000EState),
>  
>          VMSTATE_UINT32(ioaddr, E1000EState),
> -        VMSTATE_UINT32(intr_state, E1000EState),
>          VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
>          VMSTATE_UINT8(core.rx_desc_len, E1000EState),
>          VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,
> -- 
> 2.7.4
Markus Armbruster Aug. 23, 2016, 9:12 p.m. UTC | #3
Amit Shah <amit.shah@redhat.com> writes:

> On (Mon) 22 Aug 2016 [16:09:27], Jason Wang wrote:
>> From: Cao jin <caoj.fnst@cn.fujitsu.com>
>> 
>> Commit 66bf7d58 removed internal msi state flag E1000E_USE_MSI, E1000E_USE_MSIX
>> is not necessary too, remove it now. And interrupt flag field intr_state also
>> can be removed now.
>> 
>> CC: Dmitry Fleytman <dmitry@daynix.com>
>> CC: Jason Wang <jasowang@redhat.com>
>> CC: Markus Armbruster <armbru@redhat.com>
>> CC: Marcel Apfelbaum <marcel@redhat.com>
>> CC: Michael S. Tsirkin <mst@redhat.com>
>> CC: Paolo Bonzini <pbonzini@redhat.com>
>> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
>> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>> Acked-by: Dmitry Fleytman <dmitry@daynix.com>
>> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>> ---
>>  hw/net/e1000e.c | 8 +-------
>>  1 file changed, 1 insertion(+), 7 deletions(-)
>
>
>> @@ -601,7 +596,6 @@ static const VMStateDescription e1000e_vmstate = {
>>          VMSTATE_MSIX(parent_obj, E1000EState),
>>  
>>          VMSTATE_UINT32(ioaddr, E1000EState),
>> -        VMSTATE_UINT32(intr_state, E1000EState),
>>          VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
>>          VMSTATE_UINT8(core.rx_desc_len, E1000EState),
>>          VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,
>
> This breaks migration - please mark that field 'unused'.

Does it matter?  The device hasn't been in any released version of
QEMU...
Michael S. Tsirkin Aug. 23, 2016, 9:34 p.m. UTC | #4
On Tue, Aug 23, 2016 at 11:12:21PM +0200, Markus Armbruster wrote:
> Amit Shah <amit.shah@redhat.com> writes:
> 
> > On (Mon) 22 Aug 2016 [16:09:27], Jason Wang wrote:
> >> From: Cao jin <caoj.fnst@cn.fujitsu.com>
> >> 
> >> Commit 66bf7d58 removed internal msi state flag E1000E_USE_MSI, E1000E_USE_MSIX
> >> is not necessary too, remove it now. And interrupt flag field intr_state also
> >> can be removed now.
> >> 
> >> CC: Dmitry Fleytman <dmitry@daynix.com>
> >> CC: Jason Wang <jasowang@redhat.com>
> >> CC: Markus Armbruster <armbru@redhat.com>
> >> CC: Marcel Apfelbaum <marcel@redhat.com>
> >> CC: Michael S. Tsirkin <mst@redhat.com>
> >> CC: Paolo Bonzini <pbonzini@redhat.com>
> >> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> >> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> >> Acked-by: Dmitry Fleytman <dmitry@daynix.com>
> >> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> >> Signed-off-by: Jason Wang <jasowang@redhat.com>
> >> ---
> >>  hw/net/e1000e.c | 8 +-------
> >>  1 file changed, 1 insertion(+), 7 deletions(-)
> >
> >
> >> @@ -601,7 +596,6 @@ static const VMStateDescription e1000e_vmstate = {
> >>          VMSTATE_MSIX(parent_obj, E1000EState),
> >>  
> >>          VMSTATE_UINT32(ioaddr, E1000EState),
> >> -        VMSTATE_UINT32(intr_state, E1000EState),
> >>          VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
> >>          VMSTATE_UINT8(core.rx_desc_len, E1000EState),
> >>          VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,
> >
> > This breaks migration - please mark that field 'unused'.
> 
> Does it matter?  The device hasn't been in any released version of
> QEMU...

Ah so that's why we are merging this patch before 2.7 - to keep
migration format clean.
I withdraw my objection.
Amit Shah Aug. 24, 2016, 7:01 p.m. UTC | #5
On (Tue) 23 Aug 2016 [23:12:21], Markus Armbruster wrote:
> Amit Shah <amit.shah@redhat.com> writes:
> 
> > On (Mon) 22 Aug 2016 [16:09:27], Jason Wang wrote:
> >> From: Cao jin <caoj.fnst@cn.fujitsu.com>
> >> 
> >> Commit 66bf7d58 removed internal msi state flag E1000E_USE_MSI, E1000E_USE_MSIX
> >> is not necessary too, remove it now. And interrupt flag field intr_state also
> >> can be removed now.
> >> 
> >> CC: Dmitry Fleytman <dmitry@daynix.com>
> >> CC: Jason Wang <jasowang@redhat.com>
> >> CC: Markus Armbruster <armbru@redhat.com>
> >> CC: Marcel Apfelbaum <marcel@redhat.com>
> >> CC: Michael S. Tsirkin <mst@redhat.com>
> >> CC: Paolo Bonzini <pbonzini@redhat.com>
> >> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> >> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> >> Acked-by: Dmitry Fleytman <dmitry@daynix.com>
> >> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> >> Signed-off-by: Jason Wang <jasowang@redhat.com>
> >> ---
> >>  hw/net/e1000e.c | 8 +-------
> >>  1 file changed, 1 insertion(+), 7 deletions(-)
> >
> >
> >> @@ -601,7 +596,6 @@ static const VMStateDescription e1000e_vmstate = {
> >>          VMSTATE_MSIX(parent_obj, E1000EState),
> >>  
> >>          VMSTATE_UINT32(ioaddr, E1000EState),
> >> -        VMSTATE_UINT32(intr_state, E1000EState),
> >>          VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
> >>          VMSTATE_UINT8(core.rx_desc_len, E1000EState),
> >>          VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,
> >
> > This breaks migration - please mark that field 'unused'.
> 
> Does it matter?  The device hasn't been in any released version of
> QEMU...

Oh, OK then.  The nightly script doesn't know about it and I just
forward its objections to the list.
diff mbox

Patch

diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index d001c96..bad43f4 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -69,7 +69,6 @@  typedef struct E1000EState {
     uint16_t subsys_ven_used;
     uint16_t subsys_used;
 
-    uint32_t intr_state;
     bool disable_vnet;
 
     E1000ECore core;
@@ -89,8 +88,6 @@  typedef struct E1000EState {
 #define E1000E_MSIX_TABLE   (0x0000)
 #define E1000E_MSIX_PBA     (0x2000)
 
-#define E1000E_USE_MSIX    BIT(0)
-
 static uint64_t
 e1000e_mmio_read(void *opaque, hwaddr addr, unsigned size)
 {
@@ -302,8 +299,6 @@  e1000e_init_msix(E1000EState *s)
     } else {
         if (!e1000e_use_msix_vectors(s, E1000E_MSIX_VEC_NUM)) {
             msix_uninit(d, &s->msix, &s->msix);
-        } else {
-            s->intr_state |= E1000E_USE_MSIX;
         }
     }
 }
@@ -311,7 +306,7 @@  e1000e_init_msix(E1000EState *s)
 static void
 e1000e_cleanup_msix(E1000EState *s)
 {
-    if (s->intr_state & E1000E_USE_MSIX) {
+    if (msix_enabled(PCI_DEVICE(s))) {
         e1000e_unuse_msix_vectors(s, E1000E_MSIX_VEC_NUM);
         msix_uninit(PCI_DEVICE(s), &s->msix, &s->msix);
     }
@@ -601,7 +596,6 @@  static const VMStateDescription e1000e_vmstate = {
         VMSTATE_MSIX(parent_obj, E1000EState),
 
         VMSTATE_UINT32(ioaddr, E1000EState),
-        VMSTATE_UINT32(intr_state, E1000EState),
         VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState),
         VMSTATE_UINT8(core.rx_desc_len, E1000EState),
         VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState,