From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 1619AA034F;
	Sun, 21 Mar 2021 23:32:02 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id F1D46140DE0;
	Sun, 21 Mar 2021 23:31:57 +0100 (CET)
Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com
 [64.147.123.19])
 by mails.dpdk.org (Postfix) with ESMTP id 7148B140DDB
 for <dev@dpdk.org>; Sun, 21 Mar 2021 23:31:55 +0100 (CET)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.west.internal (Postfix) with ESMTP id 12B2A1223;
 Sun, 21 Mar 2021 18:31:54 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Sun, 21 Mar 2021 18:31:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding; s=fm3; bh=ql1ArSEH28J4g
 Ov97og9YPDLexCyN2SYZtqVQNJpwjA=; b=kQP+YlFPexdtZLToY0FVNhjpf2HTF
 bEImpu9ojSHw354Q1RHG5jpVd9maA5pn8NU+qiqxDgg5ivyLzyCgkn+YxwMyJjuH
 fIza5G1Q5pA0NU0oPavnjuHiN0goOrnZth09jO3/ayH8VmEHim+PcSUmuiu9g0Nb
 BUOteG475imW4uo1EIwqwPw3V6Z+rQ3ZJswESWLSEmHOVpi2vZ8xAxQ111N1Gz+L
 vqL5+6+biYKt2PCQne4Y/4SqAxQ+uGwwAk8GnuWEbZBONi0M7HKxVaWroMzr8zRb
 SYP9LkBMZBrJy/5p98dazzHEWdzC0Ysy2rw82GovxYkPLzJE97Wen8Hvg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:date:from
 :in-reply-to:message-id:mime-version:references:subject:to
 :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm2; bh=ql1ArSEH28J4gOv97og9YPDLexCyN2SYZtqVQNJpwjA=; b=Ggq6ZfHY
 F3VVcVxxDHZRb9TO/OYT0Xoq4BGnmnHMNp+nFXeKtFbmXfC3CyDe921uLsd0Qsb0
 YWWj6Fw8tBxb4n/DayMc1WXbEa6AYai7GEJ9AhIn+0PkVdIxf080uEliNp68CP8p
 ObU8rKKPYgFFLPFcQ5kpw/6r3LiYFAUI2HO9ssRFcZZrYpXs54dP6yzyO2ZboTz1
 9Z4P20MIECtG66pKrT4m9hPv99SPqmf2cvKPuVQpSBcwB2r7Yh+6SrKX/Q68Z+QH
 fOxt9jbbKZlQMTB43O7FOvA0OAZAfBvsbVmgVB5GXsrVIsLO93sNcv2Dx/d9pB64
 3s/e4y0DYfdBlg==
X-ME-Sender: <xms:WclXYJGm0tBRv22n7ZmbyFUVb-DvfmqpsA5etlf6H69GKQNrbAOtmQ>
 <xme:WclXYOVN-b5_vwYwDk6YvAvY6fzv1sr-bBZaERfzzkV4GxclZkwyHz1m-vMJpdOqJ
 mUbxxGutvuiWFtXPA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegvddgudeivdcutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh
 necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd
 enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm
 rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc
 ggtffrrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedt
 gfeutdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh
 fuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr
 lhhonhdrnhgvth
X-ME-Proxy: <xmx:WclXYLJAnqh_XhrJg4s_8iOyLcCq4IZQI8hsJ0Z2WdYQMlu9sF51qQ>
 <xmx:WclXYPHjfD7kNqQX2NKkIjWbz_IwTXgW-BL061JVxFUsZ-cTTvqHSQ>
 <xmx:WclXYPVXZyxXM7dUoduKJ5Mua48cO6aRIQMIuyRkpcNv2U1CdGWRVw>
 <xmx:WclXYGcc2FsOcq7Mmc0-SnX3523yeE4H8sJsrJ0tOP9G9XBHmUE_xA>
Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id B53AF24035D;
 Sun, 21 Mar 2021 18:31:52 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: david.marchand@redhat.com, Bruce Richardson <bruce.richardson@intel.com>,
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Date: Sun, 21 Mar 2021 23:31:05 +0100
Message-Id: <20210321223116.1340974-2-thomas@monjalon.net>
X-Mailer: git-send-email 2.30.1
In-Reply-To: <20210321223116.1340974-1-thomas@monjalon.net>
References: <20210309233116.1934666-1-thomas@monjalon.net>
 <20210321223116.1340974-1-thomas@monjalon.net>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH v4 01/11] eal: explain argv behaviour during init
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

After argument parsing done by rte_eal_init(),
the remaining arguments are to be parsed by the application
by progressing in the argv array.
In this context, the first string represented by argv[0] is still
the same program name as the original argv[0],
while the next strings are the application arguments.
This is because rte_eal_init() manipulates the argv array
after EAL parsing, before returning to the application.

This note was missing in the doxygen comment of the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 lib/librte_eal/include/rte_eal.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_eal/include/rte_eal.h b/lib/librte_eal/include/rte_eal.h
index eaf6469e50..0cbeedb594 100644
--- a/lib/librte_eal/include/rte_eal.h
+++ b/lib/librte_eal/include/rte_eal.h
@@ -76,6 +76,8 @@ int rte_eal_iopl_init(void);
  * @param argv
  *   An array of strings.  The contents of the array, as well as the strings
  *   which are pointed to by the array, may be modified by this function.
+ *   The program name pointer argv[0] is copied into the last parsed argv
+ *   so that argv[0] is still the same after deducing the parsed arguments.
  * @return
  *   - On success, the number of parsed arguments, which is greater or
  *     equal to zero. After the call to rte_eal_init(),
-- 
2.30.1