Re: [PATCH net-next 1/3] eth: fbnic: hwmon: Add completion infrastructure for firmware requests
From: Michal Swiatkowski
Date: Tue Jan 14 2025 - 03:34:02 EST
On Mon, Jan 13, 2025 at 04:07:03PM -0800, Sanman Pradhan wrote:
> Add infrastructure to support firmware request/response handling with
> completions. Add a completion structure to track message state including
> message type for matching, completion for waiting for response, and
> result for error propagation. Use existing spinlock to protect the writes.
> The data from the various response types will be added to the "union u"
> by subsequent commits.
>
> Signed-off-by: Sanman Pradhan <sanman.p211993@xxxxxxxxx>
> ---
> drivers/net/ethernet/meta/fbnic/fbnic.h | 1 +
> drivers/net/ethernet/meta/fbnic/fbnic_fw.c | 79 ++++++++++++++++++++++
> drivers/net/ethernet/meta/fbnic/fbnic_fw.h | 13 ++++
> 3 files changed, 93 insertions(+)
>
> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic.h b/drivers/net/ethernet/meta/fbnic/fbnic.h
> index 50f97f5399ff..ad8ac5ac7be9 100644
> --- a/drivers/net/ethernet/meta/fbnic/fbnic.h
> +++ b/drivers/net/ethernet/meta/fbnic/fbnic.h
> @@ -41,6 +41,7 @@ struct fbnic_dev {
>
> struct fbnic_fw_mbx mbx[FBNIC_IPC_MBX_INDICES];
> struct fbnic_fw_cap fw_cap;
> + struct fbnic_fw_completion *cmpl_data;
> /* Lock protecting Tx Mailbox queue to prevent possible races */
> spinlock_t fw_tx_lock;
>
> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_fw.c b/drivers/net/ethernet/meta/fbnic/fbnic_fw.c
> index 8f7a2a19ddf8..320615a122e4 100644
> --- a/drivers/net/ethernet/meta/fbnic/fbnic_fw.c
> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_fw.c
> @@ -228,6 +228,63 @@ static void fbnic_mbx_process_tx_msgs(struct fbnic_dev *fbd)
> tx_mbx->head = head;
> }
>
[...]
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@xxxxxxxxxxxxxxx>
> --
> 2.43.5