[dpdk-dev] [PATCH V2] net/hns3: support getting Tx and Rx queue information

Wei Hu (Xavier) huwei013 at chinasoftinc.com
Thu Aug 20 11:07:46 CEST 2020


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 <lihuisong at huawei.com>
>>
>> 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 <lihuisong at huawei.com>
>> Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
> <...>
>
>> @@ -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.



More information about the dev mailing list