[PATCH 5/6] net/hns3: make code more clean
Dongdong Liu
liudongdong3 at huawei.com
Fri Jun 24 10:59:50 CEST 2022
Delete unnecessary code and adjust code to make code more clean.
Signed-off-by: Dongdong Liu <liudongdong3 at 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 b48da82b64..4ae07fd91d 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -1904,8 +1904,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 +
@@ -2437,10 +2435,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;
}
@@ -3865,7 +3861,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.22.0
More information about the dev
mailing list