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 2FF13A04AF; Thu, 20 Aug 2020 11:07:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0DDE21C031; Thu, 20 Aug 2020 11:07:52 +0200 (CEST) Received: from mail.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id 634A21BEBA for ; Thu, 20 Aug 2020 11:07:49 +0200 (CEST) Received: from [192.168.1.199] (139.159.243.11) by INCCAS002.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Thu, 20 Aug 2020 17:07:47 +0800 To: Ferruh Yigit CC: , References: <20200818025132.27912-1-huwei013@chinasoftinc.com> <20200818030738.42609-1-huwei013@chinasoftinc.com> <3976b92e-f3fa-d974-3da4-2ef9a715356f@intel.com> From: "Wei Hu (Xavier)" Message-ID: Date: Thu, 20 Aug 2020 17:07:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <3976b92e-f3fa-d974-3da4-2ef9a715356f@intel.com> Content-Language: en-US X-Originating-IP: [139.159.243.11] Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH V2] net/hns3: support getting Tx and Rx queue information 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" Hi, Ferruh Yigit On 2020/8/20 0:19, Ferruh Yigit wrote: > On 8/18/2020 4:07 AM, Wei Hu (Xavier) wrote: >> From: Huisong Li >> >> This patch adds support for querying Rx/Tx queue information. >> >> Currently, if there are not available Rx buffer descriptors in receiving >> direction based on hns3 network engine, incoming packets will always be >> dropped by hardware. This patch reports the '.rx_drop_en' information to >> DPDK framework in the '.dev_infos_get', '.rxq_info_get' and >> '.rx_queue_setup' ops implementation function. >> >> Signed-off-by: Huisong Li >> Signed-off-by: Wei Hu (Xavier) > <...> > >> @@ -2495,6 +2495,15 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info) >> .nb_mtu_seg_max = HNS3_MAX_NON_TSO_BD_PER_PKT, >> }; >> >> + info->default_rxconf = (struct rte_eth_rxconf) { >> + /* >> + * If there are no available Rx buffer descriptors, incoming >> + * packets are always dropped by hardware based on hns3 network >> + * engine. >> + */ >> + .rx_drop_en = 1, >> + }; > Can you please separate this into two patches, first one for 'rx_drop_en' > related changes to existing code, second one to add queue info get functions? > > And you may prefer to request backporting the 'rx_drop_en' patch. Thanks for you suggestion. I will update them in V3. > > <...> >> +void >> +hns3_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, >> + struct rte_eth_rxq_info *qinfo) >> +{ >> + struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); >> + struct hns3_rx_queue *rxq = dev->data->rx_queues[queue_id]; >> + >> + if (rxq == NULL) { >> + hns3_err(hw, "queue pointer of rx queue_id (%u) is NULL.", >> + queue_id); >> + return; >> + } > 'rxq' should not be 'NULL' at this stage, because of the "queue_id >= > dev->data->nb_rx_queues" check in 'rte_eth_rx_queue_info_get()'. > Can you please check if it can be 'NULL' and if it can be, better to check it in > the ethdev API, instead of doing in each PMD, both for 'rxq' & 'txq'. OK, I will send a email to add check rxq & txq in the rte_eth_rx_queue_info_get and rte_eth_tx_queue_info_get API function. Thanks, Xavier.