Re: [net-next, 07/10] bng_en: Add resource management support

From: Vadim Fedorenko
Date: Thu Jun 19 2025 - 09:41:23 EST


On 18/06/2025 15:47, Vikas Gupta wrote:
Get the resources and capabilities from the firmware.
Add functions to manage the resources with the firmware.
These functions will help netdev reserve the resources
with the firmware before registering the device in future
patches. The resources and their information, such as
the maximum available and reserved, are part of the members
present in the bnge_hw_resc struct.
The bnge_reserve_rings() function also populates
the RSS table entries once the RX rings are reserved with
the firmware.


[...]

diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm.h b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm.h
index c14f03daab4b..9dd13c5219a5 100644
--- a/drivers/net/ethernet/broadcom/bnge/bnge_hwrm.h
+++ b/drivers/net/ethernet/broadcom/bnge/bnge_hwrm.h
@@ -104,4 +104,14 @@ void hwrm_req_alloc_flags(struct bnge_dev *bd, void *req, gfp_t flags);
void *hwrm_req_dma_slice(struct bnge_dev *bd, void *req, u32 size,
dma_addr_t *dma);
+static inline int
+bnge_hwrm_func_cfg_short_req_init(struct bnge_dev *bdev,
+ struct hwrm_func_cfg_input **req)
+{
+ u32 req_len;
+
+ req_len = min_t(u32, sizeof(**req), bdev->hwrm_max_ext_req_len);
+ return __hwrm_req_init(bdev, (void **)req, HWRM_FUNC_CFG, req_len);
+}
+

Could you please explain how does this suppose to work? If the size of
request will be bigger than the max request length, the HWRM request
will be prepared with smaller size and then partially transferred to FW?

[...]