[dpdk-dev] [PATCH] eal/bsd: reinitialize optind and optreset to 1

2015-10-15 Thread Tiwei Bie
Hi Don! I'm truly sorry for my misunderstanding. :-( Thank you so much for your detailed comments! I will update my patch! Thanks again! Best wishes, Tiwei Bie On Wed, Oct 14, 2015 at 05:54:14PM +, Don Provan wrote: > > > On Wed, Oct 14, 2015 at 10:28:44AM +0800, Tiwei Bie wrote: > > > > I

[dpdk-dev] [PATCH] eal/bsd: reinitialize optind and optreset to 1

2015-10-14 Thread Tiwei Bie
s limitation. > I'm considering updating optind to make it point to the option after '--' before eal_parse_args() returns, and eal_parse_args() will return 0 to avoid breaking the current applications which use the return value of rte_eal_init() to update argc/argv. Any comments? Tha

[dpdk-dev] [PATCH] eal/bsd: reinitialize optind and optreset to 1

2015-10-14 Thread Tiwei Bie
arse argc/argv. And I'm very willing to rework my patch to get rid of this limitation. Best regards, Tiwei Bie > /Bruce > > > -Original Message- > > From: Tiwei Bie [mailto:btw at mail.ustc.edu.cn] > > Sent: Wednesday, October 14, 2015 6:48 AM > > To: Zhu, He

[dpdk-dev] [PATCH] eal/bsd: reinitialize optind and optreset to 1

2015-10-14 Thread Don Provan
> > On Wed, Oct 14, 2015 at 10:28:44AM +0800, Tiwei Bie wrote: > > > It is designed to have DPDK's parameters specified in the front of the > > > cmd line and terminated by '--'. In other words, it is designed assuming the DPDK library can dictate the application's command line. This is an incorre

[dpdk-dev] [PATCH] eal/bsd: reinitialize optind and optreset to 1

2015-10-14 Thread Bruce Richardson
l patch, and also allow additional use-cases for applications at no extra cost. /Bruce > > > -don provan > > dprovan at bivio.net > > > > -Original Message- > > From: Tiwei Bie [mailto:btw at mail.ustc.edu.cn] > > Sent: Tuesday, October 13, 2015 1:54 A

[dpdk-dev] [PATCH] eal/bsd: reinitialize optind and optreset to 1

2015-10-14 Thread Tiwei Bie
t bivio.net > > -Original Message- > From: Tiwei Bie [mailto:btw at mail.ustc.edu.cn] > Sent: Tuesday, October 13, 2015 1:54 AM > To: dev at dpdk.org > Subject: [dpdk-dev] [PATCH] eal/bsd: reinitialize optind and optreset to 1 > > The variable optind must be reinit

[dpdk-dev] [PATCH] eal/bsd: reinitialize optind and optreset to 1

2015-10-13 Thread Don Provan
Original Message- From: Tiwei Bie [mailto:b...@mail.ustc.edu.cn] Sent: Tuesday, October 13, 2015 1:54 AM To: dev at dpdk.org Subject: [dpdk-dev] [PATCH] eal/bsd: reinitialize optind and optreset to 1 The variable optind must be reinitialized to 1 in order to skip over argv[0] on FreeBSD.

[dpdk-dev] [PATCH] eal/bsd: reinitialize optind and optreset to 1

2015-10-13 Thread Tiwei Bie
The variable optind must be reinitialized to 1 in order to skip over argv[0] on FreeBSD. Because getopt() on FreeBSD will return -1 when it meets an argument which doesn't start with '-'. The variable optreset is provided on FreeBSD to indicate the additional set of calls to getopt(). So, also rei

[dpdk-dev] [PATCH] eal/bsd: reinitialize optind and optreset to 1

2015-10-13 Thread Bruce Richardson
On Tue, Oct 13, 2015 at 04:54:06PM +0800, Tiwei Bie wrote: > The variable optind must be reinitialized to 1 in order to skip over > argv[0] on FreeBSD. Because getopt() on FreeBSD will return -1 when > it meets an argument which doesn't start with '-'. > > The variable optreset is provided on Free