Re: [PATCH 2/4] soc: marvell: rvu-pf: Add PF to AF mailbox communication support.
From: Alexander Sverdlin
Date: Sat Sep 21 2024 - 17:43:24 EST
Hi Anshumali!
On Fri, 2024-09-20 at 16:53 +0530, Anshumali Gaur wrote:
> Resource provisioning for virtual functions (VFs) is done by RVU admin
> function (AF). RVU PF and AF shares a memory region which can be used
> for communication. This patch adds support for mailbox communication
> between PF and AF, notification of messages is via IRQs.
>
> Example mailbox messages types and structures can be found at
> drivers/net/ethernet/marvell/octeontx2/af/mbox.h
>
> Signed-off-by: Anshumali Gaur <agaur@xxxxxxxxxxx>
>
[]
> +#define M(_name, _id, _fn_name, _req_type, _rsp_type) \
> +static struct _req_type __maybe_unused \
> +*gen_pf_mbox_alloc_msg_ ## _fn_name(struct mbox *mbox) \
> +{ \
> + struct _req_type *req; \
> + u16 id = _id; \
> + \
> + req = (struct _req_type *)otx2_mbox_alloc_msg_rsp( \
> + &mbox->mbox, 0, sizeof(struct _req_type), \
> + sizeof(struct _rsp_type)); \
> + if (!req) \
> + return NULL; \
> + req->hdr.sig = OTX2_MBOX_REQ_SIG; \
> + req->hdr.id = id; \
> + trace_otx2_msg_alloc(mbox->mbox.pdev, id, sizeof(*req)); \
> + return req; \
> +}
> +
> +MBOX_MESSAGES
> +#undef M
While checkpatch is wondering about _name:
WARNING: Argument '_name' is not used in function-like macro
#399: FILE: drivers/soc/marvell/rvu_gen_pf/gen_pf.h:77:
+#define M(_name, _id, _fn_name, _req_type, _rsp_type) \
... I ask myself what actually happens here with "M" and "MBOX_MESSAGES"?
--
Alexander Sverdlin.