From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZHSIN-00024R-Pl for mharc-grub-devel@gnu.org; Tue, 21 Jul 2015 03:48:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHSIL-00023d-3K for grub-devel@gnu.org; Tue, 21 Jul 2015 03:48:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHSIG-0006EO-UW for grub-devel@gnu.org; Tue, 21 Jul 2015 03:48:57 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:28760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHSIG-0006D2-Nu for grub-devel@gnu.org; Tue, 21 Jul 2015 03:48:52 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t6L7mowI003932 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 21 Jul 2015 07:48:50 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t6L7mnw0010909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 21 Jul 2015 07:48:50 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t6L7mnP9022235 for ; Tue, 21 Jul 2015 07:48:49 GMT Received: from [10.162.81.212] (/10.162.81.212) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 21 Jul 2015 00:48:49 -0700 Message-ID: <55ADF94A.5080100@oracle.com> Date: Tue, 21 Jul 2015 10:48:26 +0300 From: Stanislav Kholmanskikh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] ofnet: Do not set SUFFIX for sun4v network devices References: <1437031301-28898-1-git-send-email-stanislav.kholmanskikh@oracle.com> <20150717195857.631614ed@opensuse.site> In-Reply-To: <20150717195857.631614ed@opensuse.site> Content-Type: text/plain; charset=utf-8; format=flowed X-Source-IP: userv0022.oracle.com [156.151.31.74] Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by aserp1040.oracle.com id t6L7mowI003932 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 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: Tue, 21 Jul 2015 07:48:58 -0000 On 07/17/2015 07:58 PM, Andrei Borzenkov wrote: > =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: >> >> ok select net:speed=3Dauto,duplex=3Dauto >> Unknown key 'speed' >> Unknown key 'duplex' >> Manual Configuration: Host IP, boot server and filename must be specif= ied >> WARNING: /virtual-devices@100/channel-devices@200/network@0: Can't ope= n OBP standard TFTP package >> >> Can't open device >> ok >> >> Therefore, let's not set SUFFIX for such devices. >> >> Signed-off-by: Stanislav Kholmanskikh >> --- >> grub-core/net/drivers/ieee1275/ofnet.c | 23 +++++++++++++++++++++-= - >> 1 files changed, 21 insertions(+), 2 deletions(-) >> >> diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/dr= ivers/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 = *alias) >> grub_uint64_t prop; >> grub_uint8_t *pprop; >> char *shortname; >> + char need_suffix =3D 1; >> >> if (grub_strcmp (alias->type, "network") !=3D 0) >> return 0; >> @@ -325,7 +326,25 @@ search_net_devices (struct grub_ieee1275_devalias= *alias) >> >> #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" >> >> - 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; >> + } >> + } >> + > > 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. A ldom may have both virtual an physical network devices at the same=20 time. One can assign entire PCIE root complexes, individual cards or=20 SR-IOV virtual functions to a ldom. More details are: https://docs.oracle.com/cd/E38405_01/html/E38406/usingpcibuseswithldoms.h= tml#scrolltoc Thanks. > >> + if (need_suffix) >> ofdata->path =3D grub_malloc (grub_strlen (alias->path) + sizeof= (SUFFIX)); >> else >> ofdata->path =3D grub_malloc (grub_strlen (alias->path) + 1); >> @@ -335,7 +354,7 @@ search_net_devices (struct grub_ieee1275_devalias = *alias) >> 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'; > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >