From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZG8yZ-0007fI-Bt for mharc-grub-devel@gnu.org; Fri, 17 Jul 2015 12:59:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZG8yW-0007fA-H4 for grub-devel@gnu.org; Fri, 17 Jul 2015 12:59:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZG8yT-0002x2-9p for grub-devel@gnu.org; Fri, 17 Jul 2015 12:59:04 -0400 Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:34877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZG8yT-0002wY-1Q for grub-devel@gnu.org; Fri, 17 Jul 2015 12:59:01 -0400 Received: by lahh5 with SMTP id h5so64445739lah.2 for ; Fri, 17 Jul 2015 09:58:59 -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:content-transfer-encoding; bh=Urd5tm5piZ7X2Li5aPjA9sntSZNzassZITI40cn6BSA=; b=I6+bqV5yCrky4upU8xld8Z1wgavkqBoEPD0zSTmWn3SuL13pjQ8ltC5pe2uz+V/w1x rtja265amDEul/xUL+4PCFzLsnYlF1r/33Q8d/wQeVjSUnj/uSDuuz/hBTSHHHXqj8wJ IFBth4k2vgYNoOylzNhkEcr5I9JI4g75Yap4hQcQOtVJ36jct9hHXQyaBQWEZZlY/ojd CYbwDJR6AHiIWrrbEXIBQPVcKT/x9jEvHsIao3fLNvUFXWBx9bbc+VmrvOMH5NefInTt 4cfgGDVzFKd865KEDURfPpIrX4FEW41gPI5FCmnDTiB741/QthXCzEYOrPMQzcj4l4jf JT5g== X-Received: by 10.152.6.130 with SMTP id b2mr15791556laa.78.1437152339172; Fri, 17 Jul 2015 09:58:59 -0700 (PDT) Received: from opensuse.site (ppp91-76-6-204.pppoe.mtu-net.ru. [91.76.6.204]) by smtp.gmail.com with ESMTPSA id l5sm2952047lal.29.2015.07.17.09.58.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jul 2015 09:58:58 -0700 (PDT) Date: Fri, 17 Jul 2015 19:58:57 +0300 From: Andrei Borzenkov To: Stanislav Kholmanskikh Subject: Re: [PATCH] ofnet: Do not set SUFFIX for sun4v network devices Message-ID: <20150717195857.631614ed@opensuse.site> In-Reply-To: <1437031301-28898-1-git-send-email-stanislav.kholmanskikh@oracle.com> References: <1437031301-28898-1-git-send-email-stanislav.kholmanskikh@oracle.com> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.28; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22d Cc: vasily.isaenko@oracle.com, grub-devel@gnu.org, allen.pais@oracle.com 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: Fri, 17 Jul 2015 16:59:05 -0000 =D0=92 Thu, 16 Jul 2015 10:21:41 +0300 Stanislav Kholmanskikh =D0=BF=D0=B8=D1= =88=D0=B5=D1=82: > sun4v vnet devices do not implement the support of duplex and speed > instance attributes. An attempt to open such a device with > the attributes will fail: >=20 > ok select net:speed=3Dauto,duplex=3Dauto > Unknown key 'speed' > Unknown key 'duplex' > Manual Configuration: Host IP, boot server and filename must be specified > WARNING: /virtual-devices@100/channel-devices@200/network@0: Can't open O= BP standard TFTP package >=20 > Can't open device > ok >=20 > Therefore, let's not set SUFFIX for such devices. >=20 > Signed-off-by: Stanislav Kholmanskikh > --- > grub-core/net/drivers/ieee1275/ofnet.c | 23 +++++++++++++++++++++-- > 1 files changed, 21 insertions(+), 2 deletions(-) >=20 > diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drive= rs/ieee1275/ofnet.c > index eea8e71..dbcf337 100644 > --- a/grub-core/net/drivers/ieee1275/ofnet.c > +++ b/grub-core/net/drivers/ieee1275/ofnet.c > @@ -305,6 +305,7 @@ search_net_devices (struct grub_ieee1275_devalias *al= ias) > grub_uint64_t prop; > grub_uint8_t *pprop; > char *shortname; > + char need_suffix =3D 1; > =20 > if (grub_strcmp (alias->type, "network") !=3D 0) > return 0; > @@ -325,7 +326,25 @@ search_net_devices (struct grub_ieee1275_devalias *a= lias) > =20 > #define SUFFIX ":speed=3Dauto,duplex=3Dauto,1.1.1.1,dummy,1.1.1.1,1.1.1.= 1,5,5,1.1.1.1,512" > =20 > - if (!grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX)) > + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX)) > + need_suffix =3D 0; > + > + /* sun4v vnet devices do not support setting duplex/speed */ > + { > + char tmp[24]; > + > + grub_ieee1275_finddevice (alias->path, &devhandle); > + > + if (!grub_ieee1275_get_property (devhandle, "compatible", > + (grub_uint8_t *)tmp, sizeof(tmp), NULL)) > + { > + if (!grub_strncmp (tmp, "SUNW,sun4v-network", > + sizeof("SUNW,sun4v-network"))) > + need_suffix =3D 0; > + } > + } > + =20 Can it have devices that do support suffix? If no, it is better to extend grub-core/kern/ieee1275/cmain.c:grub_ieee1275_find_options() and set GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX for the platform. > + if (need_suffix) > ofdata->path =3D grub_malloc (grub_strlen (alias->path) + sizeof (SU= FFIX)); > else > ofdata->path =3D grub_malloc (grub_strlen (alias->path) + 1); > @@ -335,7 +354,7 @@ search_net_devices (struct grub_ieee1275_devalias *al= ias) > return 0; > } > ofdata->suffix =3D grub_stpcpy (ofdata->path, alias->path); > - if (!grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX)) > + if (need_suffix) > grub_memcpy (ofdata->suffix, SUFFIX, sizeof (SUFFIX)); > else > *ofdata->suffix =3D '\0';