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 16412A0527 for ; Wed, 25 Nov 2020 11:58:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C8C25C956; Wed, 25 Nov 2020 11:58:13 +0100 (CET) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by dpdk.org (Postfix) with ESMTP id 05B6CC95C for ; Wed, 25 Nov 2020 11:58:11 +0100 (CET) Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CgyXY3wRBz6yTJ for ; Wed, 25 Nov 2020 18:57:49 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Wed, 25 Nov 2020 18:58:00 +0800 From: Lijun Ou To: , CC: Date: Wed, 25 Nov 2020 18:58:15 +0800 Message-ID: <1606301898-51605-4-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1606301898-51605-1-git-send-email-oulijun@huawei.com> References: <1606274683-41536-1-git-send-email-oulijun@huawei.com> <1606301898-51605-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-stable] [PATCH v3 19.11.6 3/6] net/hns3: report Rx drop packets enable configuration X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: "Wei Hu (Xavier)" 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) --- drivers/net/hns3/hns3_ethdev.c | 9 +++++++++ drivers/net/hns3/hns3_ethdev_vf.c | 9 +++++++++ drivers/net/hns3/hns3_rxtx.c | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 3a92bd4..d14c96d 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -2501,6 +2501,15 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info) .nb_align = HNS3_ALIGN_RING_DESC, }; + 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, + }; + info->vmdq_queue_num = 0; info->reta_size = HNS3_RSS_IND_TBL_SIZE; diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 4359b2e..ee272da 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -868,6 +868,15 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info) .nb_align = HNS3_ALIGN_RING_DESC, }; + 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, + }; + info->vmdq_queue_num = 0; info->reta_size = HNS3_RSS_IND_TBL_SIZE; diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index 53b98cd..13d5560 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -1251,6 +1251,12 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc, return -EINVAL; } + if (conf->rx_drop_en == 0) + hns3_warn(hw, "if there are no available Rx descriptors," + "incoming packets are always dropped. input parameter" + " conf->rx_drop_en(%u) is uneffective.", + conf->rx_drop_en); + if (dev->data->rx_queues[idx]) { hns3_rx_queue_release(dev->data->rx_queues[idx]); dev->data->rx_queues[idx] = NULL; -- 2.7.4