Skip to contentSkip to conversation

Clarification on rdma-core Code Style and Contribution Guidelines

DISCUSSION 周洪锋 2 participants 2 messages May 7, 2025 – May 12, 2025 InfiniBand

lore
Share & tools
lore

周洪锋

author
#0 lore raw

Dear Maintainers,

I hope this message finds you well.

I'm Zhou Hongfeng from BitIntelligence, a network company from China, and I’m interested in contributing to rdma-core. While preparing my patches, I want to ensure my code adheres to the project’s style guidelines. However, I noticed a few uncertainties regarding the current practices:

  .clang-format Usage: The repository includes a .clang-format file, but it hasn’t been updated in a while. When I ran clang-format-11) on the existing codebase, nearly all files showed formatting differences. This suggests the config might not fully align with the actual code style. Is clang-format the recommended tool for enforcing style consistency? If so, is there an updated version of the config file that maintainers endorse?

  Manual Style Rules: If the project prioritizes manual style enforcement over automated tools, could you point me to documented conventions (e.g., indentation, naming, comments)?

  Pre-Submission Handling: Should contributors manually match the existing style, or is it acceptable to submit patches reformatted with an updated .clang-format?

Additionally, if there are other contribution guidelines (e.g., commit message format, testing requirements), I’d appreciate any pointers to avoid unnecessary review overhead.

Thank you for your time and guidance! I’m happy to adjust my workflow to align with the project’s standards. Looking forward to your insights.

Best regards,
Zhou Hongfeng
Github.com/zhf999

#1 lore raw
Quoted 5 lines · 周洪锋

Dear Maintainers,

Quoted 7 lines

I hope this message finds you well.

I'm Zhou Hongfeng from BitIntelligence, a network company from China, and I’m interested in contributing to rdma-core. While preparing my patches, I want to ensure my code adheres to the project’s style guidelines. However, I noticed a few uncertainties regarding the current practices:

  .clang-format Usage: The repository includes a .clang-format file, but it hasn’t been updated in a while. When I ran clang-format-11) on the existing codebase, nearly all files showed formatting differences. This suggests the config might not fully align with the actual code style. Is clang-format the recommended tool for enforcing style consistency? If so, is there an updated version of the config file that maintainers endorse?

We follow kernel coding style in rdma-core too, but some code was written before we adopted this policy. So the guidelines are relatively
simple: use kernel style for new files, and "existing to that file" for changes in already existing codebase.

Quoted 6 lines

  Manual Style Rules: If the project prioritizes manual style enforcement over automated tools, could you point me to documented conventions (e.g., indentation, naming, comments)?

  Pre-Submission Handling: Should contributors manually match the existing style, or is it acceptable to submit patches reformatted with an updated .clang-format?

Sure, it is perfectly fine to extend existing .clang-format.

Quoted 3 lines

Additionally, if there are other contribution guidelines (e.g., commit message format, testing requirements), I’d appreciate any pointers to avoid unnecessary review overhead.

Kernel coding style, pyverbs tests coverage and +1 from CI.

Thanks

Quoted 8 lines

Thank you for your time and guidance! I’m happy to adjust my workflow to align with the project’s standards. Looking forward to your insights.

Best regards,
Zhou Hongfeng
Github.com/zhf999