1 Star 0 Fork 76

mds.lanruo/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0131-net-hns3-clean-some-functions.patch 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
From 3a1871f1dfbba831c9c6a65081d22e6021d78ffe Mon Sep 17 00:00:00 2001
From: Dongdong Liu <liudongdong3@huawei.com>
Date: Fri, 21 Oct 2022 15:36:07 +0800
Subject: [PATCH 131/189] net/hns3: clean some functions
Delete unnecessary code and adjust code to make code more clean.
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
drivers/net/hns3/hns3_rxtx.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index b7fe2352a1..840ca384ce 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -1909,8 +1909,6 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
rxq->pvid_sw_discard_en = false;
rxq->ptype_en = hns3_dev_get_support(hw, RXD_ADV_LAYOUT) ? true : false;
rxq->configured = true;
- rxq->io_base = (void *)((char *)hw->io_base + HNS3_TQP_REG_OFFSET +
- idx * HNS3_TQP_REG_SIZE);
rxq->io_base = (void *)((char *)hw->io_base +
hns3_get_tqp_reg_offset(idx));
rxq->io_head_reg = (volatile void *)((char *)rxq->io_base +
@@ -2442,10 +2440,8 @@ hns3_recv_pkts_simple(void *rx_queue,
nmb = hns3_rx_alloc_buffer(rxq);
if (unlikely(nmb == NULL)) {
- uint16_t port_id;
-
- port_id = rxq->port_id;
- rte_eth_devices[port_id].data->rx_mbuf_alloc_failed++;
+ rte_eth_devices[rxq->port_id].data->
+ rx_mbuf_alloc_failed++;
break;
}
@@ -3870,7 +3866,7 @@ hns3_prep_pkt_proc(struct hns3_tx_queue *tx_queue, struct rte_mbuf *m)
#endif
if (hns3_pkt_is_tso(m)) {
if (hns3_pkt_need_linearized(m, m->nb_segs,
- tx_queue->max_non_tso_bd_num) ||
+ tx_queue->max_non_tso_bd_num) ||
hns3_check_tso_pkt_valid(m)) {
rte_errno = EINVAL;
return -EINVAL;
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdslanruo/dpdk.git
git@gitee.com:mdslanruo/dpdk.git
mdslanruo
dpdk
dpdk
master

搜索帮助