From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78F373B47C6 for ; Fri, 13 Mar 2026 16:06:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773418020; cv=none; b=U4ur6B9EXdTSooAMPnLvQe599aYRbWlKSoc6Llg4/O6CzgU0/kqcVQYh842YxGY5hNNVsw865MczGetRhTe1GeLhUrM+ToG7MzgYKGYczpFPWMmUo4kWp34B4ZhHpsYPlQiO3C9iGy0cYnIGMNU6CqekE8goVsyZdDOcWlUMH1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773418020; c=relaxed/simple; bh=+GOxOukMS039NwtSAcABfk6d/cMDBo2ZQQs6s4zglfU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H55MCWs5AQiaRTt5iE9rufgaxHAePR/njBOP72wLga8U2wiu9SPFpTzRfLZBnIa4lA1yo+CZp2ZbrbCttxZaxRAbH/MhkK5aTeuUlLL9S6mzQQK/icjmmYgjuVO6DNqPVXfYT8Ihia3HCpF81dGwI5j8k+MNdjKwf87TTdobm9I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=Jwn1WCQv; arc=none smtp.client-ip=209.85.160.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="Jwn1WCQv" Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-506a747448dso20535821cf.0 for ; Fri, 13 Mar 2026 09:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1773418017; x=1774022817; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=i15CYPgw86ixnL5DKi6Gy+Y+qwcNUU5FHAjU2LbU8sg=; b=Jwn1WCQvhVCzGK5zQvQmHc2U8xiGPJiFNV10scUijUwgmRYUFpc+1mNOurSu6CXCBU Yjql9InYH0UkUJYG6zUbUmssLmHRez4Uw4YwUakMxvtPgkzQCxNBDn4DtJhg1NZNpEin kBSxqbSv5BZ7a8A1P6R9lJydiuQK2775pcm+vptMzQkDLaHXpSe9qwC6oKFIYyMzUf8w E4ypEJ1a0OCaoHhtP/fS+JxcMMstrby+n6Vj53b5wO9eAFSvl99PKbjQyNeE3rjK+Fbg wUtViPpesRMHxNXQtdN7r+xKzlHoIUMbv6NZsJFgvhnf/dcEXDdk/U2e0EnQiuGtex5B TXyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773418017; x=1774022817; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i15CYPgw86ixnL5DKi6Gy+Y+qwcNUU5FHAjU2LbU8sg=; b=KFEAnYUlo9Zex/mmtpo63L/mW5I71bIIdtc+xLluAzB8Wzf3nWZ9Et25b8+H2s+CnJ ejt7qrYHowug591buEStyepJeKYkIXMTOFg/bXnYA6ywljkKYcwYUi8tDW4IfSo1lRlq XHAcONhCbcI/AyeF741n7eC0BPVX6wtv7gVdKTOPhyu92cGU3qTcWkwqGdR3ZouWy5BG u+xIDs0KdwbOLF9hGp+j5pvrvnQ3+F6IBIdbz6dbRiqnY+8jW55LpwwYTlOIVOgibeOi O5lxjAVbhUFr3feNEWjkcxLbzNGAS444yspu8HqATwFXIhhOjIuWuRV91mdfRD2mqb/i 8LtQ== X-Forwarded-Encrypted: i=1; AJvYcCVMQlDpY+vhBUU5ivM2agAROf+MZ9ZMWnrBq6nrgYg8eKIlqZV+1sMR7LC2iownTVdw9PL+vu9UN1KCkBA=@vger.kernel.org X-Gm-Message-State: AOJu0Yx9doerIp1eSP/4pALQe7Mk/rS75WUXD/loCzRds75Ndj31lDBs 0nZXZ+zmd1HYSgdmExGO+EJVgO1byQoQgjelK27L9J7KcprMTA6iGhcVQWX9sORJFjU= X-Gm-Gg: ATEYQzyyKYh2E0oMnXYwVBYlPgYKJXyaY1kD35zKtujTkciUyce4cXxYb3emn20fv2S 5ytMKyK0LkgFah2gUuIGM4J4qnxuzIFiqhKam3C/6v/5WUjEHtA3hHfSoSko79gbourlVpKxnBu JgkpIGAyi7NF5UakYTVx6dlsUkfLFzx9C8PH4p5dwPZW9mshPZQqKLxGkqZPrw6AnFf/DcYX0IX wMFp2sIcb/gmtemt98bebokSnoDXM9l6CG2EZQakWAEqMGikYDvKWU3FzFOUoQH0eIcWKDJJLFh gcnfBtVXYNMDpFsxq81iwwj1+eTMwsjVr7gBj9zb7gmIWZpLiEt3oJ+t9tH6zEmLtplNO1aAmk+ EVebha74mxuv9TuXPFUcEicXYDmaCG2Fbi9LAOZKEilbd5XnVPxCy+0BJjXdCXdzNkCCRUWUbas 824kuO6HVu34l1WcbOPsmpVPNZDN1iJrK3wGGzzfHBhmgz8zP1HOFWIs318zOG+/6jRX5WUKpiz zCNzlOE X-Received: by 2002:a05:622a:1196:b0:509:4b11:6d02 with SMTP id d75a77b69052e-50957b8913bmr47695571cf.7.1773418017215; Fri, 13 Mar 2026 09:06:57 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-112-119.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.112.119]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5093a0ea1d1sm66851791cf.22.2026.03.13.09.06.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 09:06:56 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1w152N-00000007IaK-2lcA; Fri, 13 Mar 2026 13:06:55 -0300 Date: Fri, 13 Mar 2026 13:06:55 -0300 From: Jason Gunthorpe To: Pavan Chebbi 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 Message-ID: <20260313160655.GB1704121@ziepe.ca> References: <20260226082318.525518-1-pavan.chebbi@broadcom.com> <20260226082318.525518-5-pavan.chebbi@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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