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 BC49AA04AC; Mon, 24 Aug 2020 13:02:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9A9C31BE3D; Mon, 24 Aug 2020 13:01:56 +0200 (CEST) Received: from mail.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id A3BECF12 for ; Mon, 24 Aug 2020 13:01:51 +0200 (CEST) Received: from localhost.localdomain (120.133.139.157) by INCCAS002.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Mon, 24 Aug 2020 19:01:48 +0800 From: "Wei Hu (Xavier)" To: "Wei Hu (Xavier)" , "Min Hu (Connor)" , Yisen Zhuang CC: Date: Mon, 24 Aug 2020 19:01:28 +0800 Message-ID: <20200824110130.16647-2-huwei013@chinasoftinc.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200824110130.16647-1-huwei013@chinasoftinc.com> References: <20200818025132.27912-1-huwei013@chinasoftinc.com> <20200824110130.16647-1-huwei013@chinasoftinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [120.133.139.157] Subject: [dpdk-dev] [PATCH v4 1/3] net/hns3: report Rx drop packets enable configuration 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" 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 81e773046..bcbbd7e81 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -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, + }; + 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 1d2941f0e..3156ed7f5 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -947,6 +947,15 @@ hns3vf_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, + }; + 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 c0f798159..3e5e32e38 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.27.0