Skip to content

example-cnf | Improvements for Mellanox support #661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ramperher
Copy link
Contributor

@ramperher ramperher commented Apr 30, 2025

SUMMARY
  • Added instructions for Mellanox interfaces support in example-cnf
  • Allow the possibility to create the pods with privileged mode enabled, which is needed when using Mellanox
ISSUE TYPE
  • Enhanced Feature
Tests

build-depends: openshift-kni/example-cnf#122

TestDallasWorkload: example-cnf-green example-cnf-green:ansible_extravars=ecd_run_deployment:0 example-cnf-green:ansible_extravars=dci_teardown_on_success:false

@ramperher ramperher requested a review from a team as a code owner April 30, 2025 12:05
@dcibot
Copy link
Collaborator

dcibot commented Apr 30, 2025

from change #661:

  • no check (not a code change)

Copy link
Contributor

coderabbitai bot commented Apr 30, 2025

📝 Walkthrough

Walkthrough

This change introduces a new variable, ecd_enable_privileged_mode, across the example CNF deployment role. The variable, defaulting to false, allows configuration of container privileged mode, which is necessary for Mellanox network cards. Documentation is updated to explain its purpose and usage, especially in scenarios involving Mellanox cards and RDMA. Template files are modified to reference this variable for setting the privileged field dynamically, replacing previous hardcoded values. No logic changes are made beyond enabling this configuration option.

Changes

Files/Paths Change Summary
roles/example_cnf_deploy/README.md Updated documentation to introduce and explain ecd_enable_privileged_mode, with details for Mellanox card usage.
roles/example_cnf_deploy/defaults/main.yml Added ecd_enable_privileged_mode variable (default: false) with explanatory comments.
roles/example_cnf_deploy/templates/grout-cr.yaml.j2
roles/example_cnf_deploy/templates/testpmd-cr.yaml.j2
Changed privileged field to use ecd_enable_privileged_mode variable instead of hardcoded false.
roles/example_cnf_deploy/templates/trex-server-cr.yaml.j2 Added privileged field to the template, set dynamically via ecd_enable_privileged_mode.

Suggested reviewers

  • tonyskapunk

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dcibot
Copy link
Collaborator

dcibot commented Apr 30, 2025

from change #661:

  • no check (not a code change)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
roles/example_cnf_deploy/README.md (1)

117-119: Fix plural agreement and streamline phrasing.
Change "other type of cards" to "other types of cards" and tighten the Mellanox sentence for clarity.

- This configuration is related to Intel cards. If you are using other type of cards, you need to apply the corresponding modifications (`device_id` and `vendor` will change, among others). For example, [for Mellanox cards](https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/networking/hardware-networks#example-vf-use-in-dpdk-mode-mellanox_using-dpdk-and-rdma), you need to use `netdevice` instead of `vfio-pci`, and also enable RDMA (`is_rdma: true`).
+ This configuration is related to Intel cards. If you are using other types of cards, apply the corresponding modifications (`device_id` and `vendor` will change, among others`). For Mellanox cards, use `netdevice` instead of `vfio-pci` and enable RDMA (`is_rdma: true`) (see https://docs.redhat.com/.../example-vf-use-in-dpdk-mode-mellanox_using-dpdk-and-rdma).
🧰 Tools
🪛 LanguageTool

[grammar] ~117-~117: In this context, ‘type’ should agree in number with the noun after ‘of’.
Context: ... to Intel cards. If you are using other type of cards, you need to apply the corresponding mo...

(TYPE_OF_PLURAL)


[style] ~117-~117: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...mode-mellanox_using-dpdk-and-rdma), you need to use netdevice instead of vfio-pci, ...

(REP_NEED_TO_VB)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 789a4ab and b834ef8.

📒 Files selected for processing (5)
  • roles/example_cnf_deploy/README.md (2 hunks)
  • roles/example_cnf_deploy/defaults/main.yml (1 hunks)
  • roles/example_cnf_deploy/templates/grout-cr.yaml.j2 (1 hunks)
  • roles/example_cnf_deploy/templates/testpmd-cr.yaml.j2 (1 hunks)
  • roles/example_cnf_deploy/templates/trex-server-cr.yaml.j2 (1 hunks)
🧰 Additional context used
🪛 LanguageTool
roles/example_cnf_deploy/README.md

[grammar] ~117-~117: In this context, ‘type’ should agree in number with the noun after ‘of’.
Context: ... to Intel cards. If you are using other type of cards, you need to apply the corresponding mo...

(TYPE_OF_PLURAL)


[style] ~117-~117: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...mode-mellanox_using-dpdk-and-rdma), you need to use netdevice instead of vfio-pci, ...

(REP_NEED_TO_VB)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Sanity Check (stable-2.17)
  • GitHub Check: Sanity Check (stable-2.9)
  • GitHub Check: Ansible-lint Check
🔇 Additional comments (6)
roles/example_cnf_deploy/defaults/main.yml (2)

70-74: Well-documented new feature for Mellanox support

The comment clearly explains why privileged mode is necessary for Mellanox cards, providing good context about the netdevice vs vfio-pci difference and the requirement to access /dev/vfio/vfio. The reference to the Red Hat solution article is particularly helpful.


74-74: Sensible security default

Setting ecd_enable_privileged_mode to false by default is a good security practice - privileged mode should only be enabled when specifically needed.

roles/example_cnf_deploy/templates/testpmd-cr.yaml.j2 (1)

7-7: Consistent implementation of privileged mode toggle

The template now properly uses the ecd_enable_privileged_mode variable instead of a hardcoded value, making the TestPMD configuration consistent with the other components.

roles/example_cnf_deploy/templates/trex-server-cr.yaml.j2 (1)

19-19: Good placement for privileged mode setting

The privileged field is appropriately added to the spec section, making it clear how to configure the TRex server with privileged mode when needed for Mellanox cards.

roles/example_cnf_deploy/templates/grout-cr.yaml.j2 (1)

7-7: Consistent implementation across all templates

The Grout template now uses the same variable-based approach as the other templates, ensuring consistent behavior across all components when Mellanox cards are used.

roles/example_cnf_deploy/README.md (1)

48-48: Excellent addition of ecd_enable_privileged_mode.
This new variable clearly documents the need for privileged mode when using Mellanox cards and why a hostPath volume alone is insufficient.

Copy link

@dcibot
Copy link
Collaborator

dcibot commented Apr 30, 2025

from change #661:

  • no check (not a code change)

1 similar comment
@dcibot
Copy link
Collaborator

dcibot commented Apr 30, 2025

from change #661:

  • no check (not a code change)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
roles/example_cnf_deploy/README.md (3)

48-48: Fix missing article for clarity.
Insert “the” before “host” for grammatical correctness:

…requires access to /dev/vfio/vfio from the host. Using a volume…
🧰 Tools
🪛 LanguageTool

[uncategorized] ~48-~48: You might be missing the article “the” here.
Context: ... requires access to /dev/vfio/vfio from host. Using a volume with hostPath is not en...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


116-116: Use plural for ‘types’ and refine phrasing.
Change “other type of cards” to “other types of cards” and consider rephrasing to reduce repetition (e.g., “If you are using cards from other vendors…”).

🧰 Tools
🪛 LanguageTool

[grammar] ~116-~116: In this context, ‘type’ should agree in number with the noun after ‘of’.
Context: ... to Intel cards. If you are using other type of cards, you need to apply the corresponding mo...

(TYPE_OF_PLURAL)


[style] ~116-~116: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...mode-mellanox_using-dpdk-and-rdma), you need to use netdevice instead of vfio-pci, ...

(REP_NEED_TO_VB)


117-117: Improve reminder discoverability.
Consider moving the Mellanox privileged-mode note closer to the ecd_enable_privileged_mode variable above or adding an inline link for easier reference.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b834ef8 and fc4b8a9.

📒 Files selected for processing (5)
  • roles/example_cnf_deploy/README.md (2 hunks)
  • roles/example_cnf_deploy/defaults/main.yml (1 hunks)
  • roles/example_cnf_deploy/templates/grout-cr.yaml.j2 (1 hunks)
  • roles/example_cnf_deploy/templates/testpmd-cr.yaml.j2 (1 hunks)
  • roles/example_cnf_deploy/templates/trex-server-cr.yaml.j2 (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • roles/example_cnf_deploy/templates/testpmd-cr.yaml.j2
  • roles/example_cnf_deploy/templates/trex-server-cr.yaml.j2
  • roles/example_cnf_deploy/templates/grout-cr.yaml.j2
  • roles/example_cnf_deploy/defaults/main.yml
🧰 Additional context used
🪛 LanguageTool
roles/example_cnf_deploy/README.md

[uncategorized] ~48-~48: You might be missing the article “the” here.
Context: ... requires access to /dev/vfio/vfio from host. Using a volume with hostPath is not en...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[grammar] ~116-~116: In this context, ‘type’ should agree in number with the noun after ‘of’.
Context: ... to Intel cards. If you are using other type of cards, you need to apply the corresponding mo...

(TYPE_OF_PLURAL)


[style] ~116-~116: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...mode-mellanox_using-dpdk-and-rdma), you need to use netdevice instead of vfio-pci, ...

(REP_NEED_TO_VB)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Sanity Check (stable-2.17)
  • GitHub Check: Sanity Check (stable-2.9)
  • GitHub Check: Ansible-lint Check

Copy link

@ramperher ramperher changed the title example-cnf | Document other SRIOV setups and enable privileged mode example-cnf | Improvements for Mellanox support Apr 30, 2025
@dcibot
Copy link
Collaborator

dcibot commented Apr 30, 2025

@ramperher ramperher marked this pull request as draft April 30, 2025 14:34
@dcibot
Copy link
Collaborator

dcibot commented Apr 30, 2025

@dcibot
Copy link
Collaborator

dcibot commented Apr 30, 2025

@dcibot
Copy link
Collaborator

dcibot commented Apr 30, 2025

@dcibot
Copy link
Collaborator

dcibot commented May 1, 2025

@ramperher
Copy link
Contributor Author

recheck

Copy link

@dcibot
Copy link
Collaborator

dcibot commented May 6, 2025

@dcibot
Copy link
Collaborator

dcibot commented May 7, 2025

@ramperher
Copy link
Contributor Author

recheck

Copy link

@dcibot
Copy link
Collaborator

dcibot commented May 7, 2025

@ramperher
Copy link
Contributor Author

recheck

Copy link

@dcibot
Copy link
Collaborator

dcibot commented May 12, 2025

@ramperher
Copy link
Contributor Author

recheck

Copy link

@dcibot
Copy link
Collaborator

dcibot commented May 12, 2025

@ramperher
Copy link
Contributor Author

recheck

Copy link

@dcibot
Copy link
Collaborator

dcibot commented May 12, 2025

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.

2 participants