From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YqPmD-0005Ty-GO for mharc-grub-devel@gnu.org; Thu, 07 May 2015 13:40:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqPmB-0005Th-GK for grub-devel@gnu.org; Thu, 07 May 2015 13:40:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqPm7-0007SK-55 for grub-devel@gnu.org; Thu, 07 May 2015 13:39:59 -0400 Received: from mail-la0-x22f.google.com ([2a00:1450:4010:c03::22f]:34606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqPm6-0007S5-T8 for grub-devel@gnu.org; Thu, 07 May 2015 13:39:55 -0400 Received: by laat2 with SMTP id t2so36020385laa.1 for ; Thu, 07 May 2015 10:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; bh=/1C1S9Kdu6KBYQDPmGVDaz59iy3cZQpnSeFZGfa6PZc=; b=ewV42Zxt/BjyWV6DPsKj4o4/rpg9/aj4kmcZfufgxZZUPRdzobsbo2cjLNLES1kkBY MtuGulOAqNIbcxTWcR0YCldj54dQUJr1lPPXsdh91nOyLYfZ26nAHTPMO3wCieUyaodW 25Uc64Rke2XpJ8VAogKWeFVFNEm9laMFBeInNiC5hDyiandAECUk1O8XEG3zzEM8KIyy NwvuNayIysnAmSGWmLtexO8kC4U7sOK9P5qRMYo0ELMDCV3j/bSV3O2TGQ/WOacWsFnO k4O+s+5u+EMspM599AaXE5nmR2s1i7/SkXJo2H5Mhp4/hJ67JpCfOG5+1x/rDT1U2abR GZUA== X-Received: by 10.152.197.2 with SMTP id iq2mr3955381lac.103.1431020394016; Thu, 07 May 2015 10:39:54 -0700 (PDT) Received: from opensuse.site (ppp91-76-14-38.pppoe.mtu-net.ru. [91.76.14.38]) by mx.google.com with ESMTPSA id z1sm586914laz.48.2015.05.07.10.39.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 10:39:52 -0700 (PDT) Date: Thu, 7 May 2015 20:39:51 +0300 From: Andrei Borzenkov To: Vladimir =?UTF-8?B?J8+GLWNvZGVyL3BoY29kZXIn?= Serbinenko Subject: Re: [edk2] [PATCH 2/2] efinet: fix lost packets due to active MNP instances Message-ID: <20150507203951.5fa7c3e4@opensuse.site> In-Reply-To: <5540E100.2000303@gmail.com> References: <1429430471-7229-1-git-send-email-arvidjaar@gmail.com> <1429430471-7229-2-git-send-email-arvidjaar@gmail.com> <20150420063000.GA19089@linux-dsax.tai.apac.novell.com> <20150421061254.GA19491@linux-dsax.tai.apac.novell.com> <20150425171233.19436c4e@opensuse.site> <5540E100.2000303@gmail.com> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.27; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/EyoPp3l+iF=_EUQM/Y5VE7B"; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22f Cc: The development of GNU GRUB X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2015 17:40:00 -0000 --Sig_/EyoPp3l+iF=_EUQM/Y5VE7B Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =D0=92 Wed, 29 Apr 2015 15:47:44 +0200 Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0=B8= =D1=88=D0=B5=D1=82: > On 25.04.2015 16:12, Andrei Borzenkov wrote: > > --- > > grub-core/net/drivers/efi/efinet.c | 101 +++++++++++++++++++++++++++++= +++++++- > > 1 file changed, 99 insertions(+), 2 deletions(-) > >=20 > > diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers= /efi/efinet.c > > index f171f20..46e337a 100644 > > --- a/grub-core/net/drivers/efi/efinet.c > > +++ b/grub-core/net/drivers/efi/efinet.c > > @@ -142,9 +142,52 @@ get_card_packet (struct grub_net_card *dev) > > return nb; > > } > > =20 > > +static grub_err_t > > +open_card (struct grub_net_card *dev) > > +{ > > + grub_efi_simple_network_t *net; > > + > > + /* Try to reopen SNP exlusively to close any active MNP protocol ins= tance > > + that may compete for packet polling > > + */ > > + net =3D grub_efi_open_protocol (dev->efi_handle, &net_io_guid, > > + GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE); > > + if (net) > > + { > > + if (net->mode->state =3D=3D GRUB_EFI_NETWORK_STOPPED > > + && efi_call_1 (net->start, net) !=3D GRUB_EFI_SUCCESS) > > + return GRUB_ERR_BAD_DEVICE; > > + > Please use proper grub_error. > > + if (net->mode->state =3D=3D GRUB_EFI_NETWORK_STOPPED) > > + return GRUB_ERR_BAD_DEVICE; > > + > Ditto > > + if (net->mode->state =3D=3D GRUB_EFI_NETWORK_STARTED > > + && efi_call_3 (net->initialize, net, 0, 0) !=3D GRUB_EFI_SUCCESS) > > + return GRUB_ERR_BAD_DEVICE; > > + > Ditto >=20 > Otherwise patch looks good. If you're comfortable with it, please > commit. Make sure to credit all relevant authors, feel free to use > Also-By to credit several authors (AFAIU Martin as main author and you > in Also-By) >=20 I'm not really comfortable with it, but it has been in distributions for quite some time so I expect it to work real life. I split it in two patches - for filtering out extra SNP devices and actual exclusive open. --Sig_/EyoPp3l+iF=_EUQM/Y5VE7B Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlVLo2cACgkQR6LMutpd94wmjgCgpA8PAIvvV7YPM4hLU4IsQzxg lxAAoLALG6ixioo0MrI+TcFF1tHvJEkH =zXs9 -----END PGP SIGNATURE----- --Sig_/EyoPp3l+iF=_EUQM/Y5VE7B--