From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZKOKQ-0004mJ-SV for mharc-grub-devel@gnu.org; Wed, 29 Jul 2015 06:11:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKOKO-0004kr-5D for grub-devel@gnu.org; Wed, 29 Jul 2015 06:11:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKOKK-0000He-Ni for grub-devel@gnu.org; Wed, 29 Jul 2015 06:11:12 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:39002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKOKK-0000H3-Ap for grub-devel@gnu.org; Wed, 29 Jul 2015 06:11:08 -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 t6TAB6BW019620 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 29 Jul 2015 10:11:06 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t6TAB55T019658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 29 Jul 2015 10:11:05 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t6TAB5i0019835 for ; Wed, 29 Jul 2015 10:11:05 GMT Received: from [10.162.81.212] (/10.162.81.212) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 29 Jul 2015 03:11:05 -0700 Message-ID: <55B8A69C.7050603@oracle.com> Date: Wed, 29 Jul 2015 13:10:36 +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> <55ADF94A.5080100@oracle.com> In-Reply-To: <55ADF94A.5080100@oracle.com> 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 t6TAB6BW019620 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: Wed, 29 Jul 2015 10:11:13 -0000 Hi! On 07/21/2015 10:48 AM, Stanislav Kholmanskikh wrote: > > > 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 >>> 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 >>> >>> --- >>> 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/drivers/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() an= d >> set GRUB_IEEE1275_FLAG_NO_OFNET_SUFFIX for the platform. > > A ldom may have both virtual an physical network devices at the same > time. One can assign entire PCIE root complexes, individual cards or > SR-IOV virtual functions to a ldom. More details are: > > https://docs.oracle.com/cd/E38405_01/html/E38406/usingpcibuseswithldoms= .html#scrolltoc So a ldom may have devices that do support the suffix and that do not=20 support the suffix. > > > Thanks. > >> >>> + if (need_suffix) >>> ofdata->path =3D grub_malloc (grub_strlen (alias->path) + sizeo= f >>> (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 >> > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel