From: Jason Gunthorpe <jgg@nvidia.com>
To: Weihang Li <liweihang@huawei.com>
Cc: dledford@redhat.com, leon@kernel.org, linux-rdma@vger.kernel.org,
linuxarm@openeuler.org
Subject: Re: [PATCH for-next 1/2] RDMA/hns: Support query information of functions from FW
Date: Tue, 23 Mar 2021 16:56:27 -0300 [thread overview]
Message-ID: <20210323195627.GA398808@nvidia.com> (raw)
In-Reply-To: <1615542507-40018-2-git-send-email-liweihang@huawei.com>
On Fri, Mar 12, 2021 at 05:48:26PM +0800, Weihang Li wrote:
> +static int hns_roce_query_func_info(struct hns_roce_dev *hr_dev)
> +{
> + struct hns_roce_pf_func_info *resp;
> + struct hns_roce_cmq_desc desc;
> + int ret;
> +
> + if (hr_dev->pci_dev->revision < PCI_REVISION_ID_HIP09)
> + return 0;
> +
> + hns_roce_cmq_setup_basic_desc(&desc, HNS_ROCE_OPC_QUERY_FUNC_INFO,
> + true);
> + ret = hns_roce_cmq_send(hr_dev, &desc, 1);
> + if (ret)
> + return ret;
> +
> + resp = (struct hns_roce_pf_func_info *)desc.data;
WTF is this cast?
struct hns_roce_cmq_desc {
__le16 opcode;
__le16 flag;
__le16 retval;
__le16 rsv;
__le32 data[6];
};
Casting __le32 to a pointer is wrong
Jason
next prev parent reply other threads:[~2021-03-23 19:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-12 9:48 [PATCH for-next 0/2] RDMA/hns: Support to select congestion control algorithm Weihang Li
2021-03-12 9:48 ` [PATCH for-next 1/2] RDMA/hns: Support query information of functions from FW Weihang Li
2021-03-23 19:56 ` Jason Gunthorpe [this message]
2021-03-24 1:54 ` liweihang
2021-03-24 3:07 ` liweihang
2021-03-24 12:06 ` Jason Gunthorpe
2021-03-12 9:48 ` [PATCH for-next 2/2] RDMA/hns: Support congestion control type selection according to the FW Weihang Li
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=20210323195627.GA398808@nvidia.com \
--to=jgg@nvidia.com \
--cc=dledford@redhat.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linuxarm@openeuler.org \
--cc=liweihang@huawei.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