From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Zk89o-0003Sn-2r for mharc-grub-devel@gnu.org; Thu, 08 Oct 2015 06:10:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zjs6H-0005n6-MS for grub-devel@gnu.org; Wed, 07 Oct 2015 13:01:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zjs6B-0001sJ-T4 for grub-devel@gnu.org; Wed, 07 Oct 2015 13:01:57 -0400 Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]:35732) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zjs6B-0001rx-7w for grub-devel@gnu.org; Wed, 07 Oct 2015 13:01:51 -0400 Received: by lbwr8 with SMTP id r8so18494219lbw.2 for ; Wed, 07 Oct 2015 10:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=AHPJxdC9KRNlL3uLlNtsFmLZNAN7tklwXH+TBnoiXrc=; b=Pv81YJc/8GCVGmZRnyohBcGL33aLNGz0lhEra/NOm/lgbNJfPE+9bwxAxVSUEVbFbw fhumQaIqYKO1tgFjw0xfeJj6iPuGghluq5sucpSFxzmsDo18i36qhvISJqB131t4xwXu vGHA+qlrEs1cuMMFYYVmtEgTts6olPN73GPG/8wOBUSrR1NEXaDwIRXUp4dz7Xu/Bgsa de6fQa6jc6hqTieiS54YDZ6qlXG1KIZb3rL9eaKBq2jhlKNq9i6b+r/0gxcfUJuSKKRr GnoLwQAu8Hb67chn6lDaHZkS6jd73UBx04sR2kNRJdQzaioV165A1K1pf9eD/oQVb66g iK9Q== X-Received: by 10.112.131.8 with SMTP id oi8mr1001360lbb.99.1444237310502; Wed, 07 Oct 2015 10:01:50 -0700 (PDT) Received: from [192.168.1.43] (ppp91-76-142-206.pppoe.mtu-net.ru. [91.76.142.206]) by smtp.gmail.com with ESMTPSA id x128sm6509933lfd.26.2015.10.07.10.01.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Oct 2015 10:01:49 -0700 (PDT) Subject: Re: [PATCH V2] ofnet: Do not set SUFFIX for sun4v network devices To: The development of GNU GRUB References: <55ED6F8A.7050904@oracle.com> <1441624391-27379-1-git-send-email-stanislav.kholmanskikh@oracle.com> <5615319D.50008@oracle.com> From: Andrei Borzenkov Message-ID: <56154FFC.708@gmail.com> Date: Wed, 7 Oct 2015 20:01:48 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5615319D.50008@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::231 Cc: vasily.isaenko@oracle.com, 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: Wed, 07 Oct 2015 17:01:59 -0000 07.10.2015 17:52, Stanislav Kholmanskikh пишет: > Hi! > > On 09/07/2015 02:13 PM, Stanislav Kholmanskikh wrote: >> 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: >> >> ok select net:speed=auto,duplex=auto >> 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 OBP standard TFTP package >> >> Can't open device >> ok >> >> Therefore, let's not set SUFFIX for such devices. >> >> Signed-off-by: Stanislav Kholmanskikh >> --- >> Changes since V1: >> * handle "compatible" property as an array of strings > > Could anybody look at it, please? > I was hoping you lost patience and fixed FCODE :) Sorry for delay, applied. > Thanks. > > >> >> >> grub-core/net/drivers/ieee1275/ofnet.c | 41 >> ++++++++++++++++++++++++++++++- >> 1 files changed, 39 insertions(+), 2 deletions(-) >> >> diff --git a/grub-core/net/drivers/ieee1275/ofnet.c >> b/grub-core/net/drivers/ieee1275/ofnet.c >> index eea8e71..13970bd 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 >> *alias) >> grub_uint64_t prop; >> grub_uint8_t *pprop; >> char *shortname; >> + char need_suffix = 1; >> >> if (grub_strcmp (alias->type, "network") != 0) >> return 0; >> @@ -325,7 +326,43 @@ search_net_devices (struct grub_ieee1275_devalias >> *alias) >> >> #define SUFFIX >> ":speed=auto,duplex=auto,1.1.1.1,dummy,1.1.1.1,1.1.1.1,5,5,1.1.1.1,512" >> >> - if (!grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX)) >> + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX)) >> + need_suffix = 0; >> + >> + /* sun4v vnet devices do not support setting duplex/speed */ >> + { >> + char *ptr; >> + >> + grub_ieee1275_finddevice (alias->path, &devhandle); >> + >> + grub_ieee1275_get_property_length (devhandle, "compatible", >> &prop_size); >> + if (prop_size > 0) >> + { >> + pprop = grub_malloc (prop_size); >> + if (!pprop) >> + { >> + grub_free (card); >> + grub_free (ofdata); >> + grub_print_error (); >> + return 1; >> + } >> + >> + if (!grub_ieee1275_get_property (devhandle, "compatible", >> + pprop, prop_size, NULL)) >> + { >> + for (ptr = (char *) pprop; ptr - (char *) pprop < prop_size; >> + ptr += grub_strlen (ptr) + 1) >> + { >> + if (!grub_strcmp(ptr, "SUNW,sun4v-network")) >> + need_suffix = 0; >> + } >> + } >> + >> + grub_free (pprop); >> + } >> + } >> + >> + if (need_suffix) >> ofdata->path = grub_malloc (grub_strlen (alias->path) + sizeof >> (SUFFIX)); >> else >> ofdata->path = grub_malloc (grub_strlen (alias->path) + 1); >> @@ -335,7 +372,7 @@ search_net_devices (struct grub_ieee1275_devalias >> *alias) >> return 0; >> } >> ofdata->suffix = 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 = '\0'; >> > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel