From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C46E1A04B1; Thu, 24 Sep 2020 08:08:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 492D51DD53; Thu, 24 Sep 2020 08:08:23 +0200 (CEST) Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id 906D71DD4F for ; Thu, 24 Sep 2020 08:08:21 +0200 (CEST) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 8E21D104C735AB7BAD58; Thu, 24 Sep 2020 14:08:19 +0800 (CST) Received: from [127.0.0.1] (10.65.81.238) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Thu, 24 Sep 2020 14:08:13 +0800 To: Ferruh Yigit , "Wei Hu (Xavier)" References: <20200818120254.72792-1-huwei013@chinasoftinc.com> <20200919104708.58451-1-xavier_huwei@163.com> <20200919104708.58451-4-xavier_huwei@163.com> <72499939-f3c1-1caa-cded-b46b489c1863@intel.com> <887fa0c9-73f4-401c-85ca-ad8a1f1b5a1c@chinasoftinc.com> <5fbb620a-498c-a404-4183-f78190890a78@chinasoftinc.com> <8179ac78-9706-0bc5-e1da-ecda000532f7@intel.com> CC: , From: Chengchang Tang Message-ID: Date: Thu, 24 Sep 2020 14:08:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <8179ac78-9706-0bc5-e1da-ecda000532f7@intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.65.81.238] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v3 3/6] app/testpmd: remove restriction on txpkts set X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On 2020/9/24 0:59, Ferruh Yigit wrote: > On 9/23/2020 12:57 PM, Wei Hu (Xavier) wrote: >> Hi, Ferruh Yigit >> >> On 2020/9/23 11:14, Wei Hu (Xavier) wrote: >>> Hi, Ferruh Yigit >>> >>> On 2020/9/22 22:51, Ferruh Yigit wrote: >>>> On 9/19/2020 11:47 AM, Wei Hu (Xavier) wrote: >>>>> From: Chengchang Tang >>>>> >>>>> Currently, if nb_txd is not set, the txpkts is not allowed to be set >>>>> because the nb_txd is used to avoid the numer of segments exceed the Tx >>>>> ring size and the default value of nb_txd is 0. And there is a bug that >>>>> nb_txd is the global configuration for Tx ring size and the ring size >>>>> could be changed by some command per queue. So these valid check is >>>>> unreliable and introduced unnecessary constraints. >>>>> >>>>> This patch adds a valid check function to use the real Tx ring size to >>>>> check the validity of txpkts. >>>>> >>>>> Fixes: af75078fece3 ("first public release") >>>>> Cc: stable@dpdk.org >>>>> >>>>> Signed-off-by: Chengchang Tang >>>>> Signed-off-by: Wei Hu (Xavier) >>>>> --- <...> >>>> What do you think calling 'rte_eth_rx_queue_info_get()' & 'rte_eth_tx_queue_info_get()' to get the 'nb_desc'? >>> >>> Currently not all PMD driver implement the .rxq_info_get and >>> >>> .txq_info_get hook function. If calling rte_eth_rx_queue_info_get >>> >>> return -ENOSTUP, we still need to obtain the ring_size in this way. >>> >> If calling rte_eth_rx_queue_info_get function get ring_size, because not all PMDS implement the relevant the related hook function, we need to >> check the return value and if the return value is -ENOSTUP, we must obtain the ring_size in this way. >> Do you prefer this method, right? >> > > Do we really need this check? IMHO, these checks are needed. There are two patches use the same method to obtain the ring_size to implement the verification in the patch set. One is used to verify the validity of the descriptor ID in the ring. Another is used to avoid the number of segments configuration won't exceed the ring_size. For the first case, if no check is performed, memory out of bound may occur. For the another one, if no check is performed, the sending may fail when the number of segment exceed the ring size. > > What about verifying 'ring_size' if 'rte_eth_rx_queue_info_get()' returns a valid info, if not ignore the check? > if we ignore the check when the 'rte_eth_rx_queue_info_get()' returns -ENOTSUP, it may still cause an illegal memory access or sending failure. >> <...> > . >