From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4CF16A0A03; Tue, 19 Jan 2021 02:06:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD98C140D48; Tue, 19 Jan 2021 02:06:54 +0100 (CET) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id 789BE140D35; Tue, 19 Jan 2021 02:06:52 +0100 (CET) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DKVng5JXGzl6Fg; Tue, 19 Jan 2021 09:05:27 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Tue, 19 Jan 2021 09:06:48 +0800 To: Bruce Richardson , CC: , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Ciara Power , Keith Wiles References: <20210114121733.46801-1-bruce.richardson@intel.com> From: "Min Hu (Connor)" Message-ID: <4b5e9630-b331-f498-2488-d9418719ff8c@huawei.com> Date: Tue, 19 Jan 2021 09:06:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20210114121733.46801-1-bruce.richardson@intel.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH] ethdev: avoid blocking telemetry callback for link status X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Bruce and all, Do you know the difference between "rte_eth_link_get" and "rte_eth_link_get_nowait"? I know they call funciton "link_update" with differenct parameter "wait_to_complete"(set 1 means wait, set 0 means not wait). But how to define the "wait" time, and why it shoud wait? On the further, What are the application scenarios of the two APIs? Look forward to your reply, thanks. ÔÚ 2021/1/14 20:17, Bruce Richardson дµÀ: > When querying the link status via telemetry interface, we don't want the > client to have to wait for multiple seconds for a reply. Therefore use > "rte_eth_link_get_nowait()" rather than "rte_eth_link_get()" in the > telemetry callback. > > Cc: stable@dpdk.org > Fixes: c190daedb9b1 ("ethdev: add telemetry callbacks") > > Signed-off-by: Bruce Richardson > --- > lib/librte_ethdev/rte_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c > index 17ddacc78..1f4545fe0 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -5692,7 +5692,7 @@ eth_dev_handle_port_link_status(const char *cmd __rte_unused, > if (!rte_eth_dev_is_valid_port(port_id)) > return -1; > > - ret = rte_eth_link_get(port_id, &link); > + ret = rte_eth_link_get_nowait(port_id, &link); > if (ret < 0) > return -1; > >