Skip to content
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

Feat(eos_designs): Improve ptp settings for p2p_links #4612

Open
wants to merge 17 commits into
base: devel
Choose a base branch
from

Conversation

laxmikantchintakindi
Copy link
Contributor

@laxmikantchintakindi laxmikantchintakindi commented Oct 18, 2024

Change Summary

Improve ptp settings for p2p_links

Related Issue(s)

Fixes #2698

Component(s) name

arista.avd.eos_designs

Proposed changes

PTP knobs are available in connected_endpoints:

    ptp:
      enable: < true | false | default -> false | Required >
      # These are the default settings:
      # - The global PTP profile parameters will be applied to all connected endpoints where ptp is manually enabled.
      # - `ptp role master` is set to ensure control over the PTP topology.
      endpoint_role: < follower | bmca | default -> follower >
      profile: < aes67 | smpte2059-2 | aes67-r16-2016 | default -> aes67-r16-2016 >

These would be valuable to have also in l3_edge p2p_links for L3 devices.

How to test

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@github-actions github-actions bot added state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated role: eos_designs issue related to eos_designs role labels Oct 18, 2024
Copy link

Review docs on Read the Docs

To test this pull request:

# Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4612
# Activate the virtual environment
source test-avd-pr-4612/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/laxmikantchintakindi/avd.git@feat/ptp-p2p-links#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/laxmikantchintakindi/avd.git#/ansible_collections/arista/avd/,feat/ptp-p2p-links --force
# Optional: Install AVD examples
cd test-avd-pr-4612
ansible-playbook arista.avd.install_examples

@laxmikantchintakindi laxmikantchintakindi changed the title Feat(eos_desings): Improve ptp settings for p2p_links Feat(eos_designs): Improve ptp settings for p2p_links Oct 18, 2024
@laxmikantchintakindi laxmikantchintakindi force-pushed the feat/ptp-p2p-links branch 3 times, most recently from 5504ee0 to 3477fa5 Compare October 24, 2024 06:13
type: str
default: "bmca"
valid_values:
- "bmca"
Copy link
Contributor

Choose a reason for hiding this comment

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

can you confirm the role bmca. I see dynamic and master in eos

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this as per comment from the issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

use can add dynamic and master here. But then also please update the valid values for the endpoints to also accept dynamic (without removing bmca, but add deprecated in the description for bmca). Dynamic == bmca

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added new valid value dynamic updated the change in description.

# Apply PTP profile config
if self.shared_utils.ptp_enabled:
ptp_config.update(self.shared_utils.ptp_profile)

ptp_config["enable"] = True

if get(p2p_link, "role") != "bmca":
Copy link
Contributor

Choose a reason for hiding this comment

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

it means default role is master which is not correct

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I saw similar logic in connected_endpoints.utils.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should have different assumptions for endpoints and p2p links.

Copy link
Contributor

Choose a reason for hiding this comment

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

This logic behaves different than the schema says. The schema says the default is "bmca", but your logic requires "bmca" to be set directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed bmca to dynamic and corrected the default output.

@laxmikantchintakindi laxmikantchintakindi marked this pull request as ready for review October 28, 2024 10:13
Copy link
Member

@carlbuchmann carlbuchmann left a comment

Choose a reason for hiding this comment

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

Please add test coverage in eos_designs_unit_tests scenario

@laxmikantchintakindi laxmikantchintakindi marked this pull request as draft October 29, 2024 12:14
@laxmikantchintakindi laxmikantchintakindi marked this pull request as ready for review October 30, 2024 06:36
@laxmikantchintakindi
Copy link
Contributor Author

Please add test coverage in eos_designs_unit_tests scenario

Added.

Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions github-actions bot removed the state: conflict PR with conflict label Nov 15, 2024
@laxmikantchintakindi laxmikantchintakindi force-pushed the feat/ptp-p2p-links branch 2 times, most recently from ab63faf to 50527f8 Compare November 15, 2024 07:18
@@ -135,11 +135,13 @@ $defs:
default: false
endpoint_role:
type: str
description: Set `dynamic` instead of `bmca`(deprecated).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: Set `dynamic` instead of `bmca`(deprecated).
description: |-
PTP role of the endpoint.
`follower` will configure the switch port as `ptp role master`.
`dynamic` will use BMCA.
`default` is deprecated in favor of `follower`.
`bmca` is deprecated in favor of `dynamic`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the description.

Comment on lines 141 to 147
- "bmca"
- "default"
- "follower"
- "dynamic"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's reorder so default is first and deprecated is last.

Suggested change
- "bmca"
- "default"
- "follower"
- "dynamic"
- "follower"
- "dynamic"
- "bmca"
- "default"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -132,6 +132,20 @@ $defs:
type: bool
default: false
description: Enable PTP.
role:
type: str
description: EOS default is `dynamic`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is applied on a link with two ends, it would not make sense to use "master" on both ends. We need to change this to a list similar to the ip_addresses etc. and then apply it on each device based on the index.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@laxmikantchintakindi laxmikantchintakindi marked this pull request as draft November 18, 2024 07:13
Copy link

sonarcloud bot commented Nov 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
role: eos_designs issue related to eos_designs role state: CI Updated CI scenario have been updated in the PR state: Documentation role Updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add PTP knobs to l3_edge p2p_links
4 participants