lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e56e1fca-90f1-414a-9ed3-5bd7b61ea8b3@huawei.com>
Date: Mon, 5 Aug 2024 21:29:53 +0800
From: Jijie Shao <shaojijie@...wei.com>
To: Simon Horman <horms@...nel.org>
CC: <shaojijie@...wei.com>, <yisen.zhuang@...wei.com>,
	<salil.mehta@...wei.com>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<kuba@...nel.org>, <pabeni@...hat.com>, <shenjian15@...wei.com>,
	<wangpeiyang1@...wei.com>, <liuyonglong@...wei.com>,
	<sudongming1@...wei.com>, <xujunsheng@...wei.com>, <shiyongbang@...wei.com>,
	<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH net-next 04/10] net: hibmcge: Add interrupt supported
 in this module


on 2024/8/5 20:57, Simon Horman wrote:
> On Wed, Jul 31, 2024 at 05:42:39PM +0800, Jijie Shao wrote:
>> The driver supports four interrupts: TX interrupt, RX interrupt,
>> mdio interrupt, and error interrupt.
>>
>> Actually, the driver does not use the mdio interrupt.
>> Therefore, the driver does not request the mdio interrupt.
>>
>> The error interrupt distinguishes different error information
>> by using different masks. To distinguish different errors,
>> the statistics count is added for each error.
>>
>> To ensure the consistency of the code process, masks are added for the
>> TX interrupt and RX interrupt.
>>
>> This patch implements interrupt request and free, and provides a
>> unified entry for the interrupt handler function. However,
>> the specific interrupt handler function of each interrupt
>> is not implemented currently.
>>
>> Signed-off-by: Jijie Shao <shaojijie@...wei.com>
> ...
>
>> diff --git a/drivers/net/ethernet/hisilicon/hibmcge/hbg_irq.c b/drivers/net/ethernet/hisilicon/hibmcge/hbg_irq.c
> ...
>
>> +int hbg_irq_init(struct hbg_priv *priv)
>> +{
>> +	struct hbg_vector *vectors = &priv->vectors;
>> +	struct hbg_irq *irq;
>> +	int ret;
>> +	int i;
>> +
>> +	ret = pci_alloc_irq_vectors(priv->pdev, HBG_VECTOR_NUM, HBG_VECTOR_NUM,
>> +				    PCI_IRQ_MSI);
>> +	if (ret < 0) {
>> +		dev_err(&priv->pdev->dev,
>> +			"failed to allocate MSI vectors, vectors = %d\n", ret);
>> +		return ret;
>> +	}
>> +
>> +	if (ret != HBG_VECTOR_NUM) {
>> +		dev_err(&priv->pdev->dev,
>> +			"requested %u MSI, but allocated %d MSI\n",
>> +			HBG_VECTOR_NUM, ret);
>> +		ret = -EINVAL;
>> +		goto free_vectors;
>> +	}
>> +
>> +	vectors->irqs = devm_kcalloc(&priv->pdev->dev, HBG_VECTOR_NUM,
>> +				     sizeof(struct hbg_irq), GFP_KERNEL);
>> +	if (!vectors->irqs) {
>> +		ret = -ENOMEM;
>> +		goto free_vectors;
>> +	}
>> +
>> +	/* mdio irq not request */
>> +	vectors->irq_count = HBG_VECTOR_NUM - 1;
>> +	for (i = 0; i < vectors->irq_count; i++) {
>> +		irq = &vectors->irqs[i];
>> +		snprintf(irq->name, sizeof(irq->name) - 1, "%s-%s-%s",
>> +			 HBG_DEV_NAME, pci_name(priv->pdev), irq_names_map[i]);
>> +
>> +		irq->id = pci_irq_vector(priv->pdev, i);
>> +		irq_set_status_flags(irq->id, IRQ_NOAUTOEN);
> I think that you <linux/irq.h> needs to be included.
> Else allmodconfig builds - on x86_64 but curiously not ARM64 - fail.

Thank you, this is very confusing. I built successfully on both ARM and x86.
I will rebuild it according to your Clang version to fix this error

Jijie Shao

>
>    CC      drivers/net/ethernet/hisilicon/hibmcge/hbg_irq.o
> drivers/net/ethernet/hisilicon/hibmcge/hbg_irq.c: In function 'hbg_irq_init':
> drivers/net/ethernet/hisilicon/hibmcge/hbg_irq.c:150:17: error: implicit declaration of function 'irq_set_status_flags' [-Wimplicit-function-declaration]
>    150 |                 irq_set_status_flags(irq->id, IRQ_NOAUTOEN);
>        |                 ^~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/hisilicon/hibmcge/hbg_irq.c:150:47: error: 'IRQ_NOAUTOEN' undeclared (first use in this function); did you mean 'IRQF_NO_AUTOEN'?
>    150 |                 irq_set_status_flags(irq->id, IRQ_NOAUTOEN);
>        |                                               ^~~~~~~~~~~~
>        |                                               IRQF_NO_AUTOEN
>
> ...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ