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

ERSPAN Mirror Session Enhancements #2142

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ppanara-marvell
Copy link

This update extends ERSPAN mirroring with added support for ERSPAN-II and ERSPAN-III. The key enhancements include:

  • Two new enums introduced to enable proper encapsulation and handling of ERSPAN-II and ERSPAN-III mirrored packets.
  • A new attribute to modify the first 16 bits of the GRE header, allowing repurposing of unused fields for additional functionality.
  • A new attribute to update the session_id field in ERSPAN-II and ERSPAN-III headers, ensuring unique identification of mirrored traffic flows.

@tjchadaga
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines -1756 to +1765
META_MD_ASSERT_FAIL(md, "conditional attribute is also conditional, not allowed");
if (md->objecttype == SAI_OBJECT_TYPE_MIRROR_SESSION &&
(md->attrid == SAI_MIRROR_SESSION_ATTR_ERSPAN_SESSION_ID
|| md->attrid == SAI_MIRROR_SESSION_ATTR_GRE_HEADER_FIRST_16BIT))
{
/*
* ERSPAN_SESSION_ID is valid for ERSPAN and when encap_type is ERSPAN_II or ERSPAN_III
* GRE_HEADER_FIRST_16BIT is valid for ERSPAN encap_type GRE
*/
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this exception is made ?

Copy link
Author

Choose a reason for hiding this comment

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

SAI_MIRROR_SESSION_ATTR_ERSPAN_ENCAPSULATION_TYPE values is added as validation for these attributes and SAI_MIRROR_SESSION_ATTR_ERSPAN_ENCAPSULATION_TYPE attribute itself is conditional.

Copy link
Collaborator

Choose a reason for hiding this comment

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

we probably should not have such dependencies

/**
* @brief L3 GRE Tunnel Encapsulation | L2 Ethernet header | IP header | GRE header | ERSPAN (8B) | Original mirrored packet
*/
SAI_ERSPAN_ENCAPSULATION_TYPE_MIRROR_L3_GRE_TUNNEL_ERSPAN_TYPE_II,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a mouthful. Can we simply call it SAI_ERSPAN_ENCAPSULATION_TYPE_II?

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