Skip to content

Conversation

@eliza-balas
Copy link
Contributor

@eliza-balas eliza-balas commented Jul 14, 2025

PR Description

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly (if there is the case)

@eliza-balas eliza-balas changed the title Staging/corundum pr drivers: net: mqnic: Add initial driver support for Corundum (MQNIC) Jul 14, 2025
@nunojsa
Copy link
Collaborator

nunojsa commented Jul 14, 2025

Hi,

This is a lot of stuff to "dump" on a single PR for reviewing... Can't we make this better? Another thing that worries me is that I see this is an out of tree driver maintained externally. Do we have any plan to upstream this? This definitely worries me from a maintainability point of view...

So depending on the above plan, I'm no so sure if a deep review makes sense given that we might not want to drastically change the code

@eliza-balas
Copy link
Contributor Author

Hi,

This is a lot of stuff to "dump" on a single PR for reviewing... Can't we make this better? Another thing that worries me is that I see this is an out of tree driver maintained externally. Do we have any plan to upstream this? This definitely worries me from a maintainability point of view...

So depending on the above plan, I'm no so sure if a deep review makes sense given that we might not want to drastically change the code

Hi Nuno,

We don't know how much time the Corundum drivers will be maintained by the Corundum team externally, but we made some changes to the Corundum Infrastructure IP cores in hdl and this PR also reflects those changes for support with microblaze, and there is an on-going effort to add support for other platforms too.

We don't plan to upstream the Corundum driver.

But we plan to add more functionality to Corundum Infrastructure in hdl and that functionality will also reflect in the driver.

Other then importing the MQNIC sources as they are with the new changes added, I don't see how we can do things differently.

@nunojsa
Copy link
Collaborator

nunojsa commented Jul 14, 2025

We don't plan to upstream the Corundum driver.

Given the size of this, it will impose (i suspect) a significant burden to maintain this out of tree which is far from ideal...

Copy link
Contributor

@gastmaier gastmaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes on the CONFIG_PCI usage, considering the CI log.
Also, after that is resolved, there are a few of modpost issues.

edit: this fixes would go great on corundum repo also.
In disagreement with nuno, if the driver is self contained in the mqnic folder, doing a
git checkout --theirs drivers/net/mqnic ; git add drivers/net/mqnic
for all merge conflicts should do the job, if it ever goes upstream.
But we definitely should at least keep our repo and corundum repo in sync and fix issues on both, since we are using their driver anyway.

@eliza-balas eliza-balas force-pushed the staging/corundum_pr branch 2 times, most recently from c480811 to ea409b9 Compare July 23, 2025 15:13
@eliza-balas eliza-balas marked this pull request as draft July 23, 2025 16:00
@eliza-balas eliza-balas force-pushed the staging/corundum_pr branch 2 times, most recently from a04bbd7 to 448e8e6 Compare July 25, 2025 12:57
Copy link
Contributor

@gastmaier gastmaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Eliza, see the comments about the depends and select

Thank you


menuconfig CORUNDUM_MQNIC
tristate "Corundum MQNIC support"
depends on NET_DEVLINK && I2C_ALGOBIT
Copy link
Contributor

@gastmaier gastmaier Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Eliza,

Suggested change
depends on NET_DEVLINK && I2C_ALGOBIT
select NET_DEVLINK
select I2C_ALGOBIT
depends on RTC_CLASS

The driver is not being inferred for compilation because
NET_DEVLINK and I2C_ALGOBIT are "SELECT" symbols, aka, the menuconfig entry looks like a mess.

If I am wrong, the depends needs to match some existing rule that select them instead.
For example, with my suggestion just changing the from depends to select, I still get

mqnic_main.c:(.text+0x85c): undefined reference to `rtc_time64_to_tm'

which could be nodding for an existing rule, but it is provided by RTC_CLASS and belong to neither symbols depends, so I don't think is the case.

And in this case, you also need to add

depends on RTC_CLASS

I used the container locally to try things out, using the exposed methods set_arch, auto_set_kconfig, and compile_kernel
https://analogdevicesinc.github.io/linux/ci.html#setting-up-and-running

Thank you

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, great! I will make the changes, thank you too!

@eliza-balas eliza-balas force-pushed the staging/corundum_pr branch 2 times, most recently from 63b9dbc to b215638 Compare August 1, 2025 12:09
Add MQNIC (Multi-Queue Network Interface Card) source files.
Corundum (MQNIC) is an open-source FPGA-based network interface
card (NIC) platform.

The original Corundum source files are imported from the
Corundum repo:
https://github.com/ucsdsysnet/corundum/tree/master/modules/mqnic

Some changes are added to the original source files:
  - Port to linux kernel v6.12
  - Cleanup code to comply with checkpatch guidelines
  - Fix incorrect pointer check in
    mqnic_platform_module_eeprom_put();
  - Use cast for dma_addr_t to u64 before right-shifting by 32
    bits in BAR address setup to make it compatible to 32-bit
    platforms;
  - Use div_s64 for compatibility with microblaze;
  - Use CORUNDUM_MQNIC_PCI entry to enable PCI support

Signed-off-by: Eliza Balas <[email protected]>
…m MQNIC

Add YAML-based devicetree binding documentation for the Corundum
mqnic FPGA-based multi-queue network interface controller.

Signed-off-by: Eliza Balas <[email protected]>
…the list

Enable Corundum mqnic and dependencies:
 RESET_GPIO
 I2C_ALGOBIT
 RTC_CLASS

Signed-off-by: Eliza Balas <[email protected]>
This patch adds an example device tree for
VCU118 / ad9081_fmca_ebz project with
Corundum (MQNIC) support.

Signed-off-by: Eliza Balas <[email protected]>
@eliza-balas eliza-balas force-pushed the staging/corundum_pr branch from b215638 to bae6c1b Compare August 1, 2025 16:07
@eliza-balas eliza-balas marked this pull request as ready for review August 4, 2025 08:33
@eliza-balas eliza-balas requested a review from gastmaier August 4, 2025 08:34
Copy link
Contributor

@gastmaier gastmaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't plan to upstream the Corundum driver.

Considering this.
If this changes, I think it makes sense to nuke the driver, then bring it back, to not have to deal with conflicts.
As long as the conflicts are Kconfig/Makefile alphabetic both added", I am ok with merging.
there are a lot of warnings caught by the ci that are useful for corundum source/upstream.

@eliza-balas eliza-balas merged commit 0019c28 into main Sep 1, 2025
18 of 19 checks passed
@eliza-balas eliza-balas deleted the staging/corundum_pr branch September 1, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants