Re: [External] : [v7, net-next 08/10] bng_en: Register rings with the firmware

From: ALOK TIWARI
Date: Wed Sep 17 2025 - 16:18:57 EST




On 9/12/2025 1:05 AM, Bhargava Marreddy wrote:
+int hwrm_ring_free_send_msg(struct bnge_net *bn,
+ struct bnge_ring_struct *ring,
+ u32 ring_type, int cmpl_ring_id)
+{
+ struct hwrm_ring_free_input *req;
+ struct bnge_dev *bd = bn->bd;
+ int rc;
+
+ rc = bnge_hwrm_req_init(bd, req, HWRM_RING_FREE);
+ if (rc)
+ goto exit;
+
+ req->cmpl_ring = cpu_to_le16(cmpl_ring_id);
+ req->ring_type = ring_type;

req->ring_type is a u8, but u32 ring_type uses here
since the enums (0x0, ->0x5) fit in 8 bits
That is not a mismatch but it is misleading.
it can use u8 ?

+ req->ring_id = cpu_to_le16(ring->fw_ring_id);
+
+ bnge_hwrm_req_hold(bd, req);
+ rc = bnge_hwrm_req_send(bd, req);
+ bnge_hwrm_req_drop(bd, req);
+exit:
+ if (rc) {
+ netdev_err(bd->netdev, "hwrm_ring_free type %d failed. rc:%d\n", ring_type, rc);
+ return -EIO;
+ }
+ return 0;
+}


Thanks,
Alok