From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baPIM-0002Qr-5P for qemu-devel@nongnu.org; Thu, 18 Aug 2016 11:31:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1baPIG-0003xq-U5 for qemu-devel@nongnu.org; Thu, 18 Aug 2016 11:31:49 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:32778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baPIG-0003xl-Lk for qemu-devel@nongnu.org; Thu, 18 Aug 2016 11:31:44 -0400 Received: by mail-wm0-x243.google.com with SMTP id o80so137028wme.0 for ; Thu, 18 Aug 2016 08:31:44 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) From: Dmitry Fleytman In-Reply-To: <1471529754-29690-1-git-send-email-caoj.fnst@cn.fujitsu.com> Date: Thu, 18 Aug 2016 18:31:41 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <73BF031C-2ED4-421C-AFFA-00B8FA3811ED@daynix.com> References: <1471529754-29690-1-git-send-email-caoj.fnst@cn.fujitsu.com> Subject: Re: [Qemu-devel] [PATCH] e1000e: remove internal interrupt flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cao jin Cc: qemu-devel@nongnu.org, Jason Wang , Markus Armbruster , Marcel Apfelbaum , "Michael S. Tsirkin" , Paolo Bonzini > On 18 Aug 2016, at 17:15, Cao jin wrote: >=20 > 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 a= lso > can be removed now. >=20 > CC: Dmitry Fleytman > CC: Jason Wang > CC: Markus Armbruster > CC: Marcel Apfelbaum > CC: Michael S. Tsirkin > CC: Paolo Bonzini > Signed-off-by: Cao jin > --- > hw/net/e1000e.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) >=20 > diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c > index 82a7be1..72aad21 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; >=20 > - uint32_t intr_state; > bool disable_vnet; >=20 > E1000ECore core; > @@ -89,8 +88,6 @@ typedef struct E1000EState { > #define E1000E_MSIX_TABLE (0x0000) > #define E1000E_MSIX_PBA (0x2000) >=20 > -#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 |=3D E1000E_USE_MSIX; So you are removing error handling here. But what if e1000e_use_msix_vectors= fails? > } > } > } > @@ -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 =3D { > VMSTATE_MSIX(parent_obj, E1000EState), >=20 > 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, > --=20 > 2.1.0 >=20 >=20 >=20