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] [thread-next>] [day] [month] [year] [list]
Message-ID: <01a8f9ea-56b1-47d8-ab9c-9324e703b403@loongson.cn>
Date: Thu, 25 Apr 2024 16:07:51 +0800
From: Yanteng Si <siyanteng@...ngson.cn>
To: Huacai Chen <chenhuacai@...nel.org>, Serge Semin <fancer.lancer@...il.com>
Cc: andrew@...n.ch, hkallweit1@...il.com, peppe.cavallaro@...com,
 alexandre.torgue@...s.st.com, joabreu@...opsys.com, Jose.Abreu@...opsys.com,
 linux@...linux.org.uk, guyinggang@...ngson.cn, netdev@...r.kernel.org,
 chris.chenfeiyang@...il.com, siyanteng01@...il.com
Subject: Re: [PATCH net-next v11 6/6] net: stmmac: dwmac-loongson: Add
 Loongson GNET support

Hi Serge and Russell,

在 2024/4/24 22:11, Huacai Chen 写道:
>> Once again. Please replace this with simpler solution:
> In full PCI system the below function works fine, because alloc irq
> vectors with PCI_IRQ_LEGACY do the same thing as fallback to call
> loongson_dwmac_config_legacy(). But for a DT-based system it doesn't
> work.
huacai's comments are here.
>
>
>> static int loongson_dwmac_config_multi_msi(struct pci_dev *pdev,
>> +                                          struct plat_stmmacenet_data *plat,
>> +                                          struct stmmac_resources *res)
>> +{
>> +       int i, ret, vecs;
>> +
>> +       /* INT NAME | MAC | CH7 rx | CH7 tx | ... | CH0 rx | CH0 tx |
>> +        * --------- ----- -------- --------  ...  -------- --------
>> +        * IRQ NUM  |  0  |   1    |   2    | ... |   15   |   16   |
>> +        */
>> +       vecs = plat->rx_queues_to_use + plat->tx_queues_to_use + 1;
>> +       ret = pci_alloc_irq_vectors(pdev, 1, vecs, PCI_IRQ_MSI | PCI_IRQ_LEGACY);
>> +       if (ret < 0) {
>> +               dev_err(&pdev->dev, "Failed to allocate PCI IRQs\n");
>> +               return ret;
>> +       } else if (ret >= vecs) {
>> +               for (i = 0; i < plat->rx_queues_to_use; i++) {
>> +                       res->rx_irq[CHANNELS_NUM - 1 - i] =
>> +                               pci_irq_vector(pdev, 1 + i * 2);
>> +               }
>> +               for (i = 0; i < plat->tx_queues_to_use; i++) {
>> +                       res->tx_irq[CHANNELS_NUM - 1 - i] =
>> +                               pci_irq_vector(pdev, 2 + i * 2);
>> +               }
>> +
>> +               plat->flags |= STMMAC_FLAG_MULTI_MSI_EN;
>> +       }
>> +
>> +       res->irq = pci_irq_vector(pdev, 0);
>> +
>> +       return 0;
>> +}

How about we stay the same in v12?


Thanks,

Yanteng



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ