-
Notifications
You must be signed in to change notification settings - Fork 546
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
Keep attribute order in bulk mode #1659
Conversation
auto it = rc.first; | ||
|
||
// If inserted new key, assign the attr | ||
// If found existing key, overwrite the old attr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If found existing key, overwrite the old attr [](start = 11, length = 45)
One advantage or map structure is possible to merge setting operation on the same entry and same attribute. Is it still required? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it does not seem very necessary to merge the operations for the same attribute and the same entry because of the following reasons:
- The same entry should not show up more than once in one bulk.
- For each route entry, there are two attributes that might be set in bulk mode:
PACKET_ACTION
andNEXT_HOP_ID
, each gets to set only once in the routeorch logic. - For other types of entries (not supported in bulk yet), the to_sync logic should already merge the same attribute for the same entry. It does not seem necessary to do it again in bulk.
what ? order should not matter at all in any way to any component including SAI |
It is reported in sonic-net/sonic-buildimage#6881 that the hardware has a contract that route action must not be DROP when setting next hops (otherwise it gets ignored). The order matters if this is the case since the action must be set first in this scenario. |
missing unit test? |
} | ||
}; | ||
|
||
TEST_F(BulkerTest, BulkerAttrOrder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BulkerTest [](start = 11, length = 10)
Did this unit test fail old code?
Keep attributes for the same entry in the order that the attributes are set in bulk mode. And add a unit test for the scenario in bulker. Some attributes have a dependency on others in SAI operations (e.g., setting nexthop requires packet action to be forward in route set operation). Without keeping the order of the attributes, the configuration may not be successfully applied to hardware. Therefore, it is necessary to keep the order of attributes in bulk mode.
Keep attributes for the same entry in the order that the attributes are set in bulk mode. And add a unit test for the scenario in bulker. Some attributes have a dependency on others in SAI operations (e.g., setting nexthop requires packet action to be forward in route set operation). Without keeping the order of the attributes, the configuration may not be successfully applied to hardware. Therefore, it is necessary to keep the order of attributes in bulk mode.
Keep attributes for the same entry in the order that the attributes are set in bulk mode. And add a unit test for the scenario in bulker. Some attributes have a dependency on others in SAI operations (e.g., setting nexthop requires packet action to be forward in route set operation). Without keeping the order of the attributes, the configuration may not be successfully applied to hardware. Therefore, it is necessary to keep the order of attributes in bulk mode.
- What I did following the change in PR sonic-net/sonic-buildimage#7830, the folder needs to be created when the first time enables the sniffer function. - How I did it check whether the path to store the sniffer file is existing or not, if not, create it. - How to verify it run command "config platform mlnx sniffer sdk enable", can see sniffer function can be enabled successfully.
What I did
Keep attributes for the same entry in the order that the attributes are set in bulk mode.
Fix sonic-net/sonic-buildimage#6881
Why I did it
Some attributes have a dependency on others in SAI operations (e.g., setting nexthop requires packet action to be forward in route set operation). Without keeping the order of the attributes, the configuration may not be successfully applied to hardware. Therefore, it is necessary to keep the order of attributes in bulk mode.
How I verified it
Verify that sairedis applys
SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION
beforeSAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID
when setting default routes.Details if related