mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Pavan Chebbi <pavan.chebbi@broadcom.com>
Cc: michael.chan@broadcom.com, linux-kernel@vger.kernel.org,
	dave.jiang@intel.com, saeedm@nvidia.com,
	Jonathan.Cameron@huawei.com, gospo@broadcom.com,
	selvin.xavier@broadcom.com, leon@kernel.org,
	kalesh-anakkur.purayil@broadcom.com
Subject: Re: [PATCH v5 fwctl 4/5] fwctl/bnxt_fwctl: Add bnxt fwctl device
Date: Fri, 13 Mar 2026 13:06:55 -0300	[thread overview]
Message-ID: <20260313160655.GB1704121@ziepe.ca> (raw)
In-Reply-To: <20260226082318.525518-5-pavan.chebbi@broadcom.com>

On Thu, Feb 26, 2026 at 12:23:17AM -0800, Pavan Chebbi wrote:
> +static void *bnxtctl_fw_rpc(struct fwctl_uctx *uctx,
> +			    enum fwctl_rpc_scope scope,
> +			    void *in, size_t in_len, size_t *out_len)
> +{
> +	struct bnxtctl_dev *bnxtctl =
> +		container_of(uctx->fwctl, struct bnxtctl_dev, fwctl);
> +	struct bnxt_aux_priv *bnxt_aux_priv = bnxtctl->aux_priv;
> +	size_t off = offsetof(struct fwctl_rpc_bnxt, reserved1);
> +	struct fwctl_rpc_bnxt *msg = in;
> +	struct bnxt_fw_msg rpc_in = {0};
> +	int rc, err = 0;
> +
> +	if (in_len < sizeof(*msg))
> +		return ERR_PTR(-EINVAL);
> +
> +	if (memchr_inv((unsigned char *)msg + off, 0, in_len - off))
> +		return ERR_PTR(-EINVAL);

EOPNOTSUPP

> +/**
> + * struct fwctl_rpc_bnxt - describe the fwctl message for bnxt
> + * @req: FW (HWRM) command input structure
> + * @req_len: length of @req
> + * @timeout: in ms to override the driver's default, 0 otherwise
> + * @reserved: must be 0
> + * @reserved1: must be 0
> + */
> +struct fwctl_rpc_bnxt {
> +	__aligned_u64 req;
> +	__u32 req_len;
> +	__u32 timeout;
> +	__u32 reserved[2];
> +	__aligned_u64 reserved1;

Why? Upstream isn't going to try to be compatible with OOT drivers.

> +};

I know pensando did it this way, but every time I see this I don't
like it.

struct fwctl_rpc {
        __u32 size;
        __u32 scope;
        __u32 in_len;
        __u32 out_len;
        __aligned_u64 in;
        __aligned_u64 out;
         ^^^^^^^^^^^^^^^^^

These two were supposed to be the actual message, not a layer of
driver indirection, that is why the buffer mangement works the way
it does.

"timeout" just doesn't seem like a great reason to put a wrapper
struct..

Would you be happy to add a
   __aligned_u64 driver_data

To fwctl_rpc to use for your timeout and future stuff and leave the
message buffer as it was intended?

Jason

  reply	other threads:[~2026-03-13 16:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-26  8:23 [PATCH v5 fwctl 0/5] fwctl/bnxt_fwctl: fwctl for Broadcom Netxtreme devices Pavan Chebbi
2026-02-26  8:23 ` [PATCH v5 fwctl 1/5] fwctl/bnxt_en: Move common definitions to include/linux/bnxt/ Pavan Chebbi
2026-02-26  8:23 ` [PATCH v5 fwctl 2/5] fwctl/bnxt_en: Refactor aux bus functions to be more generic Pavan Chebbi
2026-03-13 15:46   ` Jason Gunthorpe
2026-03-13 15:57     ` Pavan Chebbi
2026-02-26  8:23 ` [PATCH v5 fwctl 3/5] fwctl/bnxt_en: Create an aux device for fwctl Pavan Chebbi
2026-02-26  8:23 ` [PATCH v5 fwctl 4/5] fwctl/bnxt_fwctl: Add bnxt fwctl device Pavan Chebbi
2026-03-13 16:06   ` Jason Gunthorpe [this message]
2026-03-13 17:56     ` Pavan Chebbi
2026-03-13 16:14   ` Jason Gunthorpe
2026-03-13 18:14     ` Pavan Chebbi
2026-03-13 18:17       ` Jason Gunthorpe
2026-02-26  8:23 ` [PATCH v5 fwctl 5/5] fwctl/bnxt_fwctl: Add documentation entries Pavan Chebbi

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=20260313160655.GB1704121@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=dave.jiang@intel.com \
    --cc=gospo@broadcom.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=pavan.chebbi@broadcom.com \
    --cc=saeedm@nvidia.com \
    --cc=selvin.xavier@broadcom.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

all inboxes | Powered by JetHome®