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 11750A0547;
	Fri, 12 Mar 2021 12:21:14 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 91F58406FF;
	Fri, 12 Mar 2021 12:21:13 +0100 (CET)
Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com
 [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 648F04067E
 for <dev@dpdk.org>; Fri, 12 Mar 2021 12:21:12 +0100 (CET)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.nyi.internal (Postfix) with ESMTP id B91465C0139;
 Fri, 12 Mar 2021 06:21:11 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Fri, 12 Mar 2021 06:21:11 -0500
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:content-type; s=fm3; bh=
 XukHe0vDDi/AECXsLAgabRAcN0shbUQKQ3EI4lNCTEE=; b=Sn66qs4cEKzMTIwQ
 MG6Xz3ypuHmB/xyqjKxenvk0g86e4eki+FN7YPHpkm9dJkV40hEQEZfAyhnht0Qg
 /uvi/enRz+dVs3Dm+R9RQ4+wFYnza5dEs4Wev90PHw9Gvg83b4CVDasvcdWPQiQy
 QFQ2wjzop+nKgJ2S/VsoLIyBmCQXhboVBT3B4qsowJiZqRsnOiTKi5Z/8XF38hTr
 Torb2tED19zmEjiqzBwmc8HxH8wPCWT6l24Fgl6N8dXetqip2h2Vg5cnPPDX1RS2
 HApp4QyGYqAq2yziean7thAdycW8uePMHUlG2WQUxbIgYuDFKMQyf6ep9hrDEOYJ
 bfjspg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :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=XukHe0vDDi/AECXsLAgabRAcN0shbUQKQ3EI4lNCT
 EE=; b=SBzDw67pev4q8bxct6f9YDSut19gXciJFS49GMFoQayFkH0Ok4Wm5PqN9
 t/GQrvy9MH2YxsNvJebK53zcLbWMA2L+wXrDlLdX5Nr7IlImyJHeSkZ7aaxkhjcV
 6y/B16D6tt7kz/CNNtoZcmlfmBOYXuugJddbLCDm/KJRLNcH45+t9uQon2DiHdYh
 WJwvDAUAr5cl6d+dbwBOIHBJS7KNbP5Fvep5dR9ML3bS8ZwSUIQ2WcehdUnBkHVl
 LYay67DC0Vvdt5aVLhEyn5o74apX4jtncVPXNx+2OD1fuEiZobiZ1m/5i9PuLO3R
 XcEYT1LYDs2YqeuD7KH1JavInPy6w==
X-ME-Sender: <xms:pk5LYLCngE_DI9HLOllK0nnn5ZcZ4FDRVF-PReU4664vzRd5MVkEuQ>
 <xme:pk5LYBiipe6YDEq7n8HvvVMnMW0v1lrVZtEp98UXzRSExPBqoJIs-c18qvDX_qYmT
 Yjh644MuTUNupOIaQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddvvddgvdejucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkjghfggfgtgesthfure
 dttddtvdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes
 mhhonhhjrghlohhnrdhnvghtqeenucggtffrrghtthgvrhhnpedugefgvdefudfftdefge
 elgffhueekgfffhfeujedtteeutdejueeiiedvffegheenucfkphepjeejrddvtdehrddu
 ledrtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe
 hthhhomhgrshesmhhonhhjrghlohhnrdhnvght
X-ME-Proxy: <xmx:pk5LYGnsp6GxDVkCDpj_7umpwUgU9depyzEp6mCrfhiKxgLsx8e5rw>
 <xmx:pk5LYNxqlfaaN9dMF_mv76siCasoowFSTV2rsleXWaEAfQWX7TexzA>
 <xmx:pk5LYATss8JIk85RqufSi1erhilHdvtVm9rQECW51yqjMlkFqD2STA>
 <xmx:p05LYJ7N9Kw6VJLpE8wEjSXNciljm8-6_QVUfbubTnZrW0TgR1yCsA>
Received: from xps.localnet (0.19.205.77.rev.sfr.net [77.205.19.0])
 by mail.messagingengine.com (Postfix) with ESMTPA id EE992240054;
 Fri, 12 Mar 2021 06:21:09 -0500 (EST)
From: Thomas Monjalon <thomas@monjalon.net>
To: oulijun <oulijun@huawei.com>
Cc: linuxarm@openeuler.org, dev <dev@dpdk.org>
Date: Fri, 12 Mar 2021 12:21:06 +0100
Message-ID: <13135629.FDAB5nOBdD@thomas>
In-Reply-To: <070496a4-3403-8c42-c80d-941b43e3fc4a@huawei.com>
References: <1614929583-37727-1-git-send-email-oulijun@huawei.com>
 <5590583.7m7mD32AY9@thomas> <070496a4-3403-8c42-c80d-941b43e3fc4a@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [Linuxarm] Re: [PATCH V2] app/testpmd: support Tx
 mbuf free on demand cmd
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>

12/03/2021 11:29, oulijun:
> 2021/3/10 15:59, Thomas Monjalon:
> > 10/03/2021 02:48, oulijun:
> >> Can we add an API such as rte_eth_get_device(pord_id)
> >>
> >> for example:
> >> struct rte_eth_dev *
> >> rte_eth_get_device(uint16_t port_id)
> >> {
> >>          return &rte_eth_devices[port_id];
> >> }
> > An application is not supposed to access the struct rte_eth_dev.
> > Which info do you need from this struct?
> 
> Applications cannot directly access the global variable 
> rte_eth_devices[]. To obtain information about rte_eth_dev, they need to 
> access the global variable through APIs instead of directly.

That's not the question.
Which device info do you need, which is not already provided by
one of the function rte_eth_*info* ?
	rte_eth_dev_get_dcb_info
	rte_eth_dev_get_reg_info
	rte_eth_dev_info_get
	rte_eth_rx_queue_info_get
	rte_eth_tx_queue_info_get
	rte_eth_dev_get_module_info