Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Xin Tian" <tianx@yunsilicon.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH v2 04/11] net/xsc: query HCA capabilities and reset function
Date: Fri, 27 Nov 2026 14:58:07 +0000	[thread overview]
Message-ID: <sashiko-outbox-237637@kernel.org> (raw)
In-Reply-To: <20261126145721.70868-5-tianx@yunsilicon.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] net/xsc: missing in.hdr.ver initialization in
  xsc_cmd_query_hca_cap()
- [Low] net/xsc: wrapped commit subject line spilling into commit
  message body
--

commit f750ba7cb78453344d90f6c33acb7a3b7bad17b8
Author: Xin Tian <tianx@yunsilicon.com>

> net/xsc: query HCA capabilities and reset function
> 
> resources
> 
> Query the firmware HCA capabilities needed by the ethernet driver and
> reset the function resources during probe.
> 
> Signed-off-by: Xin Tian <tianx@yunsilicon.com>

[Severity: Low]
The commit subject line appears to have been wrapped mid-phrase, leaving
"resources" as a standalone line at the top of the commit message body.

> diff --git a/drivers/net/ethernet/yunsilicon/xsc/pci/main.c b/drivers/net/ethernet/yunsilicon/xsc/pci/main.c
> index 9b08580f52f38..42c5a1baed23b 100644
> --- a/drivers/net/ethernet/yunsilicon/xsc/pci/main.c
> +++ b/drivers/net/ethernet/yunsilicon/xsc/pci/main.c
> @@ -29,6 +29,63 @@ static int xsc_set_dma_caps(struct pci_dev *pdev)
>  	return err;
>  }
>  
> +static int xsc_cmd_query_hca_cap(struct xsc_core_device *xdev,
> +				 struct xsc_caps *caps)
> +{
> +	struct xsc_cmd_query_hca_cap_mbox_out *out;
> +	struct xsc_cmd_query_hca_cap_mbox_in in;
> +	int err;
> +
> +	out = kzalloc_obj(*out, GFP_KERNEL);
> +	if (!out)
> +		return -ENOMEM;
> +
> +	memset(&in, 0, sizeof(in));
> +	in.hdr.opcode = cpu_to_be16(XSC_CMD_OP_QUERY_HCA_CAP);
> +	in.cpu_num = cpu_to_be16(num_online_cpus());
> +
> +	err = xsc_cmd_exec(xdev, &in, sizeof(in), out, sizeof(*out));
> +	if (err)
> +		goto err_free;

[ ... ]

> +	xdev->pcie_no = out->hca_cap.pcie_no;
> +	xdev->pf_id = out->hca_cap.pf_id;

[Severity: Medium]
Should in.hdr.ver be initialized to cpu_to_be16(XSC_CMD_QUERY_HCA_CAP_V1)
before calling xsc_cmd_exec()?

XSC_CMD_QUERY_HCA_CAP_V1 is defined in
drivers/net/ethernet/yunsilicon/xsc/common/xsc_cmd.h as the HCA capability
mailbox version, and xsc_cmd_query_hca_cap() reads out->hca_cap.pcie_no and
out->hca_cap.pf_id from the versioned extension section of struct
xsc_hca_cap.  Leaving in.hdr.ver at 0 could cause firmware that checks the
request version to reject the query or leave those fields unpopulated.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126145711.70868-1-tianx@yunsilicon.com?part=4

  reply	other threads:[~2026-11-27 14:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 14:57 [PATCH v2 00/11] net/xsc: add the Yunsilicon XSC ethernet driver Xin Tian
2026-11-26 14:57 ` [PATCH v2 01/11] net/xsc: add Yunsilicon XSC ethernet PCI driver Xin Tian
2026-11-26 14:57 ` [PATCH v2 02/11] net/xsc: add doorbell and cmdq MMIO accessors Xin Tian
2026-11-26 14:57 ` [PATCH v2 03/11] net/xsc: add the command queue Xin Tian
2026-11-27 14:58   ` sashiko-bot
2026-11-26 14:57 ` [PATCH v2 04/11] net/xsc: query HCA capabilities and reset function Xin Tian
2026-11-27 14:58   ` sashiko-bot [this message]
2026-11-26 14:57 ` [PATCH v2 05/11] net/xsc: add event queues and MSI-X Xin Tian
2026-11-27 14:58   ` sashiko-bot
2026-11-26 14:57 ` [PATCH v2 06/11] net/xsc: add CQ and QP helpers Xin Tian
2026-11-27 14:58   ` sashiko-bot
2026-11-26 14:57 ` [PATCH v2 07/11] net/xsc: add the ethernet netdev Xin Tian
2026-11-27 14:58   ` sashiko-bot
2026-11-26 14:57 ` [PATCH v2 08/11] net/xsc: add the single TX/RX channel Xin Tian
2026-11-27 14:58   ` sashiko-bot
2026-11-26 14:57 ` [PATCH v2 09/11] net/xsc: report link state changes Xin Tian
2026-11-27 14:58   ` sashiko-bot
2026-11-26 14:57 ` [PATCH v2 10/11] net/xsc: add the transmit path Xin Tian
2026-11-27 14:58   ` sashiko-bot
2026-11-26 14:57 ` [PATCH v2 11/11] net/xsc: add the receive path Xin Tian
2026-11-27 14:58   ` sashiko-bot
2026-11-27 14:58 ` [PATCH v2 00/11] net/xsc: add the Yunsilicon XSC ethernet driver sashiko-bot

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=sashiko-outbox-237637@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tianx@yunsilicon.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