netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Shannon Nelson <shannon.nelson@amd.com>
Cc: <jgg@nvidia.com>, <andrew.gospodarek@broadcom.com>,
	<aron.silverton@oracle.com>, <dan.j.williams@intel.com>,
	<daniel.vetter@ffwll.ch>, <dave.jiang@intel.com>,
	<dsahern@kernel.org>, <gregkh@linuxfoundation.org>,
	<hch@infradead.org>, <itayavr@nvidia.com>, <jiri@nvidia.com>,
	<kuba@kernel.org>, <lbloch@nvidia.com>, <leonro@nvidia.com>,
	<linux-cxl@vger.kernel.org>, <linux-rdma@vger.kernel.org>,
	<netdev@vger.kernel.org>, <saeedm@nvidia.com>,
	<brett.creeley@amd.com>
Subject: Re: [PATCH v2 4/6] pds_fwctl: initial driver framework
Date: Tue, 4 Mar 2025 16:30:43 +0800	[thread overview]
Message-ID: <20250304163043.00006b34@huawei.com> (raw)
In-Reply-To: <20250301013554.49511-5-shannon.nelson@amd.com>

On Fri, 28 Feb 2025 17:35:52 -0800
Shannon Nelson <shannon.nelson@amd.com> wrote:

> Initial files for adding a new fwctl driver for the AMD/Pensando PDS
> devices.  This sets up a simple auxiliary_bus driver that registers
> with fwctl subsystem.  It expects that a pds_core device has set up
> the auxiliary_device pds_core.fwctl
> 
> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
A few minor comments inline,

> diff --git a/drivers/fwctl/pds/main.c b/drivers/fwctl/pds/main.c
> new file mode 100644
> index 000000000000..afc7dc283ad5
> --- /dev/null
> +++ b/drivers/fwctl/pds/main.c
> @@ -0,0 +1,169 @@
> +struct pdsfc_dev {
> +	struct fwctl_device fwctl;
> +	struct pds_auxiliary_dev *padev;
> +	struct pdsc *pdsc;

Not used in this patch that I can see.  I was curious why it is
here as I would expect that to match with the padev parent.

> +	u32 caps;
> +	struct pds_fwctl_ident ident;
> +};
> +DEFINE_FREE(pdsfc_dev, struct pdsfc_dev *, if (_T) fwctl_put(&_T->fwctl));


> +static void *pdsfc_info(struct fwctl_uctx *uctx, size_t *length)
> +{
> +	struct pdsfc_uctx *pdsfc_uctx = container_of(uctx, struct pdsfc_uctx, uctx);
> +	struct fwctl_info_pds *info;
> +
> +	info = kzalloc(sizeof(*info), GFP_KERNEL);
> +	if (!info)
> +		return ERR_PTR(-ENOMEM);
> +
> +	info->uctx_caps = pdsfc_uctx->uctx_caps;

What about the UID? If it is always zero, what is it for?

> +
> +	return info;
> +}

> +/**
> + * struct pds_fwctl_comp - Firmware control completion structure
> + * @status:     Status of the firmware control operation
> + * @rsvd:       Word boundary padding
> + * @comp_index: Completion index in little-endian format
> + * @rsvd2:      Word boundary padding

11 bytes is some extreme word padding.  I'd just call it reserved
space.

> + * @color:      Color bit indicating the state of the completion
> + */
> +struct pds_fwctl_comp {
> +	u8     status;
> +	u8     rsvd;
> +	__le16 comp_index;
> +	u8     rsvd2[11];
> +	u8     color;
> +} __packed;

...

> +/**
> + * struct pds_fwctl_ident - Firmware control identification structure
> + * @features:    Supported features

Nice to have some defines or similar that give meaning to these
features, but maybe that comes in later patches.

> + * @version:     Interface version
> + * @rsvd:        Word boundary padding

word size seems to be varying between structures. I'd just document
it as "reserved"

> + * @max_req_sz:  Maximum request size
> + * @max_resp_sz: Maximum response size
> + * @max_req_sg_elems:  Maximum number of request SGs
> + * @max_resp_sg_elems: Maximum number of response SGs
> + */
> +struct pds_fwctl_ident {
> +	__le64 features;
> +	u8     version;
> +	u8     rsvd[3];
> +	__le32 max_req_sz;
> +	__le32 max_resp_sz;
> +	u8     max_req_sg_elems;
> +	u8     max_resp_sg_elems;
> +} __packed;

Jonathan

  parent reply	other threads:[~2025-03-04  8:30 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-01  1:35 [PATCH v2 0/6] pds_fwctl: fwctl for AMD/Pensando core devices Shannon Nelson
2025-03-01  1:35 ` [PATCH v2 1/6] pds_core: make pdsc_auxbus_dev_del() void Shannon Nelson
2025-03-04  1:57   ` Jonathan Cameron
2025-03-04  4:09   ` Kalesh Anakkur Purayil
2025-03-01  1:35 ` [PATCH v2 2/6] pds_core: specify auxiliary_device to be created Shannon Nelson
2025-03-04  7:44   ` Jonathan Cameron
2025-03-01  1:35 ` [PATCH v2 3/6] pds_core: add new fwctl auxiliary_device Shannon Nelson
2025-03-04  8:03   ` Jonathan Cameron
2025-03-06  1:48     ` Nelson, Shannon
2025-03-01  1:35 ` [PATCH v2 4/6] pds_fwctl: initial driver framework Shannon Nelson
2025-03-03 16:45   ` Dave Jiang
2025-03-03 17:29     ` Jason Gunthorpe
2025-03-03 17:35       ` Nelson, Shannon
2025-03-04  1:50       ` Jonathan Cameron
2025-03-03 17:31     ` Nelson, Shannon
2025-03-03 17:46       ` Dave Jiang
2025-03-04  8:30   ` Jonathan Cameron [this message]
2025-03-06  1:52     ` Nelson, Shannon
2025-03-04 19:39   ` Jason Gunthorpe
2025-03-06  2:05     ` Nelson, Shannon
2025-03-01  1:35 ` [PATCH v2 5/6] pds_fwctl: add rpc and query support Shannon Nelson
2025-03-04  9:08   ` Jonathan Cameron
2025-03-04 17:24     ` Jason Gunthorpe
2025-03-06  2:02       ` Nelson, Shannon
2025-03-06  1:55     ` Nelson, Shannon
2025-03-04 19:52   ` Jason Gunthorpe
2025-03-06  2:07     ` Nelson, Shannon
2025-03-01  1:35 ` [PATCH v2 6/6] pds_fwctl: add Documentation entries Shannon Nelson
2025-03-04  9:12   ` Jonathan Cameron
2025-03-06  1:56     ` Nelson, Shannon
2025-03-02 12:34 ` [PATCH v2 0/6] pds_fwctl: fwctl for AMD/Pensando core devices Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250304163043.00006b34@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=andrew.gospodarek@broadcom.com \
    --cc=aron.silverton@oracle.com \
    --cc=brett.creeley@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dave.jiang@intel.com \
    --cc=dsahern@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=itayavr@nvidia.com \
    --cc=jgg@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=lbloch@nvidia.com \
    --cc=leonro@nvidia.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=shannon.nelson@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).