summaryrefslogtreecommitdiff
path: root/drivers/net/octeontx/nicvf_main.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-08-18 10:54:44 -0600
committerTom Rini <trini@konsulko.com>2025-08-18 10:54:44 -0600
commit54fbdd408873413af86d86de03a490c5abf280f1 (patch)
tree4f08a3a23bfd457590b733893a082b15f817698d /drivers/net/octeontx/nicvf_main.c
parent6dee9a5b74972d18b0c554f31907dd0043b9e9f9 (diff)
parentc4526c390a3c4ea1c4f244b6436ebbb74902769a (diff)
Merge tag 'net-20250818' of https://source.denx.de/u-boot/custodians/u-boot-net
Pull request net-20250818. This is mostly code cleanup and fixes, mainly for issues reported by the Smatch tool, plus two small features for NET_LWIP as well as support for the BCM54612E phy. net-common: - Fix a bunch of issues reported by Smatch - Introduce CONFIG_DNS - Add support for BCM54612E phy net-legacy: - Add missing SPDX-License-Identifier for files originating from LiMon net-lwip: - ping: initialize net_try_count to 1 - sntp: remove redundant sys_check_timeouts() - tftp: resend initial request - Add Kconfig option to show ICMP unreachable errors
Diffstat (limited to 'drivers/net/octeontx/nicvf_main.c')
-rw-r--r--drivers/net/octeontx/nicvf_main.c51
1 files changed, 24 insertions, 27 deletions
diff --git a/drivers/net/octeontx/nicvf_main.c b/drivers/net/octeontx/nicvf_main.c
index 27d0327c88a..94e5d827614 100644
--- a/drivers/net/octeontx/nicvf_main.c
+++ b/drivers/net/octeontx/nicvf_main.c
@@ -232,7 +232,7 @@ static int nicvf_rcv_pkt_handler(struct nicvf *nic,
size_t pkt_len;
struct cqe_rx_t *cqe_rx = (struct cqe_rx_t *)cq_desc;
- int err = 0;
+ int err;
/* Check for errors */
err = nicvf_check_cqe_rx_errs(nic, cq, cq_desc);
@@ -245,8 +245,7 @@ static int nicvf_rcv_pkt_handler(struct nicvf *nic,
return -1;
}
- if (pkt)
- *ppkt = pkt;
+ *ppkt = pkt;
return pkt_len;
}
@@ -274,31 +273,29 @@ int nicvf_cq_handler(struct nicvf *nic, void **ppkt, int *pkt_len)
cqe_head >>= 9;
cqe_head &= 0xFFFF;
- if (cqe_count) {
- /* Get the CQ descriptor */
- cq_desc = (struct cqe_rx_t *)GET_CQ_DESC(cq, cqe_head);
- cqe_head++;
- cqe_head &= (cq->dmem.q_len - 1);
-
- switch (cq_desc->cqe_type) {
- case CQE_TYPE_RX:
- debug("%s: Got Rx CQE\n", nic->dev->name);
- *pkt_len = nicvf_rcv_pkt_handler(nic, cq, cq_desc,
- ppkt, CQE_TYPE_RX);
- processed_rq_cqe++;
- break;
- case CQE_TYPE_SEND:
- debug("%s: Got Tx CQE\n", nic->dev->name);
- nicvf_snd_pkt_handler(nic, cq, cq_desc, CQE_TYPE_SEND);
- processed_sq_cqe++;
- break;
- default:
- debug("%s: Got CQ type %u\n", nic->dev->name,
- cq_desc->cqe_type);
- break;
- }
- processed_cqe++;
+ /* Get the CQ descriptor */
+ cq_desc = (struct cqe_rx_t *)GET_CQ_DESC(cq, cqe_head);
+ cqe_head++;
+ cqe_head &= (cq->dmem.q_len - 1);
+
+ switch (cq_desc->cqe_type) {
+ case CQE_TYPE_RX:
+ debug("%s: Got Rx CQE\n", nic->dev->name);
+ *pkt_len = nicvf_rcv_pkt_handler(nic, cq, cq_desc,
+ ppkt, CQE_TYPE_RX);
+ processed_rq_cqe++;
+ break;
+ case CQE_TYPE_SEND:
+ debug("%s: Got Tx CQE\n", nic->dev->name);
+ nicvf_snd_pkt_handler(nic, cq, cq_desc, CQE_TYPE_SEND);
+ processed_sq_cqe++;
+ break;
+ default:
+ debug("%s: Got CQ type %u\n", nic->dev->name,
+ cq_desc->cqe_type);
+ break;
}
+ processed_cqe++;
/* Dequeue CQE */
nicvf_queue_reg_write(nic, NIC_QSET_CQ_0_7_DOOR,