More Info:
'-s SourceIp' operation is not defined in shell Spec 2.1 or any old version, 
but for ping usage convenience(like Bhupesh's case), the code implementation 
added the additional option '-_s'. That is a non-standard option in shell Spec 
2.1 but it's allowed by the Shell Spec. Because the Spec declaims that 
command-line options that begin with the '_' character are implementation 
specific.

But in latest shell Spec version 2.2, '-s SourceIp' option has been 
standardized. So, we will create one patch to update the implementation to make 
it consistent with latest shell Spec. After that, I think Bhupesh's issue will 
be resolved. If there are multiple NICs existed in the platform, '-s SourceIp' 
can be used to specify any interface you want(Current implementation is '-_s 
SourceIp'), this similar like '-S SourceIp' in windows or '-I interface' in 
linux functionality. 

Considering the backward compatible issue, the patch will keep '-_s' command 
option unchanged, only add the new option '-s' and make the old option '-_s' 
function same as new one. 

Thanks.
Jiaxin

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> David Van Arnem
> Sent: Wednesday, April 6, 2016 1:34 AM
> To: Andrew Fish <af...@apple.com>; Bhupesh Sharma
> <bhupesh.sha...@nxp.com>
> Cc: Carsey, Jaben <jaben.car...@intel.com>; edk2-devel@lists.01.org
> <edk2-de...@ml01.01.org>; Laszlo Ersek <ler...@redhat.com>
> Subject: Re: [edk2] Using multiple SNP drivers on Shell
> 
> On 04/04/2016 10:30 PM, Andrew Fish wrote:
> >
> >> On Apr 4, 2016, at 9:17 PM, Bhupesh Sharma <bhupesh.sha...@nxp.com>
> wrote:
> >>
> >>
> >>
> >>> -----Original Message-----
> >>> From: Carsey, Jaben [mailto:jaben.car...@intel.com]
> >>> Sent: Monday, April 04, 2016 11:28 PM
> >>> To: Laszlo Ersek; Bhupesh Sharma
> >>> Cc: edk2-devel@lists.01.org; David Van Arnem; Carsey, Jaben
> >>> Subject: RE: [edk2] Using multiple SNP drivers on Shell
> >>>
> >>>
> >>>
> >>>> -----Original Message-----
> >>>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
> >>>> Of Laszlo Ersek
> >>>> Sent: Monday, April 04, 2016 10:47 AM
> >>>> To: Bhupesh Sharma <bhupesh.sha...@nxp.com>
> >>>> Cc: edk2-devel@lists.01.org <edk2-de...@ml01.01.org>; David Van
> >>>> Arnem <dvanar...@cmlab.biz>
> >>>> Subject: Re: [edk2] Using multiple SNP drivers on Shell
> >>>> Importance: High
> >>>>
> >>>> On 04/04/16 19:38, Bhupesh Sharma wrote:
> >>>>>> From: Laszlo Ersek [mailto:ler...@redhat.com]
> >>>>>> Sent: Monday, April 04, 2016 11:06 PM
> >>>>>>
> >>>>>> On 04/04/16 19:24, David Van Arnem wrote:
> >>>>>>> On 04/04/2016 03:17 AM, Laszlo Ersek wrote:
> >>>>>>
> >>>>>>>> The most recent version (that I have) of the Shell Spec is 2.2.
> >>>>>>>> That version lists both "ping" and "ping6", and the synopsis
> >>>>>>>> for
> >>> "ping" is:
> >>>>>>>>
> >>>>>>>>    Ping [-n count] [-l size] [-s SourceIp] TargetIp
> >>>>>>>
> >>>>>>> Interesting, it looks like we each have a different "ping" command:
> >>>>>>> Bhupesh's requires "-_s [SourceIP]", Laszlo's uses "-s
> >>>>>>> [SourceIP]", and mine (not sure which commit it was build from,
> >>>>>>> I built it a while
> >>>>>>> ago) says to use "-s [interface name]" (this may work with the
> >>>>>>> Source IP also, but the "help" gave eth0 as an example).
> >>>>>>
> >>>>>> Note: I didn't test "my" ping command, only proved it right
> >>>>>> ^W^W^W
> >>>> quoted
> >>>>>> the shell spec. :)
> >>>>>>
> >>>>>>> But, I suppose that is a moot point, since I should be using an
> >>>>>>> up-to-date Shell as Laszlo recommended.
> >>>>>>
> >>>>>> The shell source code still uses L"-_s" for the ping (v4)
> >>>>>> command; only the ping6 command uses L"-s". Compare:
> >>>>>>
> >>>>>> - ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> >>>>>> - ShellPkg/Library/UefiShellNetwork2CommandsLib/Ping6.c
> >>>>>>
> >>>>>> And L"-_s" in the former dates back to this commit:
> >>>>>>
> >>>>>> commit 68fb05272b45b473fe030ac11dcb79d3f3c0aecd
> >>>>>> Author: jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
> >>>>>> Date:   Fri Mar 25 20:47:02 2011 +0000
> >>>>>>
> >>>>>>     Add Network1 profile.
> >>>>>>
> >>>>>>     git-svn-id:
> >>>>>> https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11423
> >>>>>> 6f19259b-4bc3-4df7-8a09-765794883524
> >>>>>>
> >>>>>> The following command:
> >>>>>>
> >>>>>>   git grep 'L"-_' -- ShellPkg
> >>>>>>
> >>>>>> returns a few more hits. I'm thinking the "-_option" pattern is
> >>>>>> for
> >>>>>> non- standard options, and the underscore is supposed to prevent
> >>>>>> conflicts with any future standardization.
> >>>>>>
> >>>>>> Maybe in the case of the Ping command, L"-_s" could now be simply
> >>>>>> replaced with L"-s".
> >>>>>
> >>>>> IMHO, -_s makes no sense. -s is definitely concise and more readable.
> >>>>
> >>>> Well, the question is whether the behavior of the historical "-_s"
> >>>> option matches that of the recently standardized "-s" option.
> >>>>
> >>>> If so, then it's a simple rename.
> >>>>
> >>>> If the behaviors are different, then "-s" should be implemented
> >>>> separately, and "-_s" might be preferable to preserve also, as a
> >>>> non-standard extension.
> >>>
> >>> All non-standard parameters are started with _ per shell specification.
> >>>
> >>> If the behaviors are different it's certainly worth discussing
> >>> making sure that needs are met.  The whole goal of making it an
> >>> official parameter was to make backwards compatibility guaranteed.
> >>>
> >>
> >> Well, I think if the SNP protocol stack cannot start a PING
> >> transmission when two or more Ethernet interfaces are available for
> >> usage, then PING '-_s' is no longer a non-standard extension.
> >>
> >> Presently and in future, we will have multiple Ethernet interfaces
> >> available on a x86 or ARM board and in that case PING -_s is simply a
> >> requirement to check if the connection to a host is alive.
> >>
> >> To look at it from the other perspective, a question could come to
> >> mind that if this a non-standard (which I read  as requirement not
> >> mandated by the specifications) requirement, then the SNP stack should
> be fixed to handle multiple Ethernet interfaces.
> >>
> >
> > The are both standards based. The -_* is the namespace for non standard
> shell commands so they will never conflict with an update to the shell spec.
> >
> 
> I think the concern here might be that ping will "not work" (from Bhupesh's
> results, I am unable to test on my end) without -_s when there is more than
> one active interface that uses SNP. In contrast, ping on Linux will choose an
> interface when there is more than one active and the interface is not
> specified with a flag in the ping command.
> 
> I think the Linux ping behavior could be replicated in the UEFI Shell ping, 
> but I
> don't know if it's something that would be desired.
> 
> David
> 
> > Thanks,
> >
> > Andrew Fish
> >
> >> Regards,
> >> Bhupesh
> >> _______________________________________________
> >> edk2-devel mailing list
> >> edk2-devel@lists.01.org
> >> https://lists.01.org/mailman/listinfo/edk2-devel
> >
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> >
> 
> 
> --
> Thanks,
> David Van Arnem

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to