From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1W1Iwr-0002ij-B1 for mharc-grub-devel@gnu.org; Thu, 09 Jan 2014 11:59:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1Iwh-0002Tz-Su for grub-devel@gnu.org; Thu, 09 Jan 2014 11:59:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1Iwa-0004Y8-AE for grub-devel@gnu.org; Thu, 09 Jan 2014 11:59:03 -0500 Received: from e24smtp03.br.ibm.com ([32.104.18.24]:54947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1IwZ-0004Xt-Vb for grub-devel@gnu.org; Thu, 09 Jan 2014 11:58:56 -0500 Received: from /spool/local by e24smtp03.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 9 Jan 2014 14:58:53 -0200 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp03.br.ibm.com (10.172.0.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 9 Jan 2014 14:58:51 -0200 Received: from d24relay02.br.ibm.com (d24relay02.br.ibm.com [9.13.184.26]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id 592183520064 for ; Thu, 9 Jan 2014 11:58:49 -0500 (EST) Received: from d24av03.br.ibm.com (d24av03.br.ibm.com [9.8.31.95]) by d24relay02.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s09GwK2749676476 for ; Thu, 9 Jan 2014 14:58:21 -0200 Received: from d24av03.br.ibm.com (localhost [127.0.0.1]) by d24av03.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s09GwocN021484 for ; Thu, 9 Jan 2014 14:58:50 -0200 Received: from beren.br.ibm.com (beren.br.ibm.com [9.18.239.228] (may be forged)) by d24av03.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s09Gwgvq021365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 9 Jan 2014 14:58:50 -0200 Date: Thu, 9 Jan 2014 14:58:42 -0200 From: Paulo Flabiano Smorigo To: The development of GNU GRUB Subject: Re: Request a freeze exception for vlantag feature Message-ID: <20140109165841.GA20105@beren.br.ibm.com> References: <20131223113410.Horde.LfYohJir309SuGYCUmW1mHA@imap.linux.ibm.com> <1387818177.918.31.camel@opensuse.site> <20131226172524.GA8868@beren.lan> <20140108185727.GA15022@beren.br.ibm.com> <20140109070516.668ad4ba@opensuse.site> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20140109070516.668ad4ba@opensuse.site> User-Agent: Mutt/null+5621 (d3096e8796e7) (2012-12-30) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14010916-9254-0000-0000-00000EB31F60 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.104.18.24 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, 09 Jan 2014 16:59:12 -0000 Thu, Jan 09, 2014 at 07:05:16AM +0400, Andrey Borzenkov wrote: > В Wed, 8 Jan 2014 16:57:28 -0200 > Paulo Flabiano Smorigo пишет: > > > + > > + inter->vlantag.pcp = vlantag >> 12; > > + inter->vlantag.dei = (vlantag >> 11) & 0x1; > > + inter->vlantag.vid = vlantag & 0x1fff; > > That's 13 bits, not 12, right? And this really looks like > overengeneering - do you really want to be able to set static VLAN > priority bits? I do not think it belongs to grub. > > > + > > + if (grub_strcmp (args[3], "vlan") == 0) > > + vlan_pos = 3; > > + > > + if (grub_strcmp (args[4], "vlan") == 0) > > + vlan_pos = 4; > You're right, thanks. I fixed: diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c index ffcb943..72359c3 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -213,13 +213,12 @@ grub_ieee1275_parse_bootargs (const char *devpath, char *bootpath, inter = grub_net_add_addr ((*card)->name, *card, &client_addr, &hw_addr, flags); - inter->vlantag.pcp = vlantag >> 12; - inter->vlantag.dei = (vlantag >> 11) & 0x1; - inter->vlantag.vid = vlantag & 0x1fff; + inter->vlantag.pcp = vlantag >> 13; + inter->vlantag.dei = (vlantag >> 12) & 0x1; + inter->vlantag.vid = vlantag & 0xfff; grub_net_add_ipv4_local (inter, __builtin_ctz (~grub_le_to_cpu32 (subnet_mask.ipv4))); - } if (gateway_addr.ipv4 != 0) diff --git a/grub-core/net/ethernet.c b/grub-core/net/ethernet.c index ae195bc..7ca14e9 100644 --- a/grub-core/net/ethernet.c +++ b/grub-core/net/ethernet.c @@ -88,8 +88,8 @@ send_ethernet_packet (struct grub_net_network_level_interface *inf, if (inf->vlantag.vid != 0) { grub_uint32_t vlantag; - vlantag = (VLANTAG_IDENTIFIER << 16) + (inf->vlantag.pcp << 12) + - (inf->vlantag.dei << 11) + inf->vlantag.vid; + vlantag = (VLANTAG_IDENTIFIER << 16) | (inf->vlantag.pcp << 13) | + (inf->vlantag.dei << 12) | inf->vlantag.vid; /* Move eth type to the right */ grub_memcpy ((char *) nb->data + etherhdr_size - 2, Virtual lan priority is an option in PowerPC SMS: PowerPC Firmware Version ZM770_024 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved. ------------------------------------------------------------------------------- Advanced Setup: BOOTP Interpartition Logical LAN: U9109.RMD.10F037P-V4-C3-T1 1. Bootp Retries 5 2. Bootp Blocksize 512 3. TFTP Retries 5 4. VLAN Priority 0 5. VLAN ID 0 (default - not configured) Maybe we can use the priority and DEI of incoming package as the values for the following packages. What do you think? > May be it should really start using proper options at this point > keeping existing three argument form as legacy. > > net_add_addr --if=... --addr=... --mask=... --vlan=... --hw=... card I prefer the current format but we can switch to another if it's more suitable. Andrey, ping me in IRC so we can talk about it. > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel I ask this patch as a freeze exception. This feature will only add a option for vlan tag and will not change the default grub workflow. Can I push the current version in master so it can be included in 2.02? Anyone against? Thanks! -- Paulo Flabiano Smorigo IBM Linux Technology Center