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

Separate XPN configuration attribute from read-only attribute #1169

Merged
merged 4 commits into from
Jan 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions inc/saimacsec.h
Original file line number Diff line number Diff line change
Expand Up @@ -751,25 +751,40 @@ typedef enum _sai_macsec_sa_attr_t
SAI_MACSEC_SA_ATTR_AUTH_KEY,

/**
* @brief MACsec egress packet number (PN/XPN). At most 1 less than the next PN/XPN.
* @brief Configured value of next MACsec egress packet number (PN/XPN).
*
* @type sai_uint64_t
* @flags CREATE_AND_SET
* @default 0
* @validonly SAI_MACSEC_SA_ATTR_MACSEC_DIRECTION == SAI_MACSEC_DIRECTION_EGRESS
*/
SAI_MACSEC_SA_ATTR_XPN,
SAI_MACSEC_SA_ATTR_CONFIGURED_EGRESS_XPN,

/**
* @brief Minimum value of ingress MACsec packet number (PN/XPN).
* @brief MACsec current packet number (PN/XPN). For ingress, largest
* received packet number. For egress, 1 less than the next packet number.
*
* @type sai_uint64_t
* @flags READ_ONLY
*/
SAI_MACSEC_SA_ATTR_CURRENT_XPN,

/** @ignore - for backward compatibility */
SAI_MACSEC_SA_ATTR_XPN = SAI_MACSEC_SA_ATTR_CURRENT_XPN,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@dipankar-ba this does not look correct. SAI_MACSEC_SA_ATTR_XPN should be alias SAI_MACSEC_SA_ATTR_CONFIGURED_EGRESS_XPN ? This has broken backward compatibility as SAI_MACSEC_SA_ATTR_XPN was Create and Set and now it became Read only.

Here is the error when we are moving v1.8.0
https://dev.azure.com/mssonic/build/_build/results?buildId=9116&view=logs&jobId=83516c17-6666-5250-abde-63983ce72a49&j=83516c17-6666-5250-abde-63983ce72a49&t=6177235f-d4f1-5f72-835a-90ebb93a1784

can you please check again

cc @rlhui @kcudnik

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The underlying hardware has a counter whose value has to be periodically read by NOS to run MKA protocol through SAI_MACSEC_SA_ATTR_CURRENT_XPN. Since this read is mandatory for MACsec operation, I tried to keep this backward compatible.
For counter should be initialized to 0 by the driver and normally never be modified by NOS for normal operation. So I do not expect SAI_MACSEC_SA_ATTR_CONFIGURED_EGRESS_XPN to be read or written except perhaps for synthetic tests for testing counter saturation.


/**
* @brief Configured minimum acceptable ingress MACsec packet number (PN/XPN).
* Updated by value from MACsec peer by Key Agreement protocol.
*
* @type sai_uint64_t
* @flags CREATE_AND_SET
* @default 1
* @validonly SAI_MACSEC_SA_ATTR_MACSEC_DIRECTION == SAI_MACSEC_DIRECTION_INGRESS
*/
SAI_MACSEC_SA_ATTR_MINIMUM_XPN,
SAI_MACSEC_SA_ATTR_MINIMUM_INGRESS_XPN,
dipankar-ba marked this conversation as resolved.
Show resolved Hide resolved

/** @ignore - for backward compatibility */
SAI_MACSEC_SA_ATTR_MINIMUM_XPN = SAI_MACSEC_SA_ATTR_MINIMUM_INGRESS_XPN,

/**
* @brief SSCI value for this Secure Association
Expand Down