Skip to content

Bulk get/set for switches #2174

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions inc/saiswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -4061,6 +4061,8 @@ typedef struct _sai_switch_api_t
sai_get_switch_tunnel_attribute_fn get_switch_tunnel_attribute;
sai_switch_mdio_cl22_read_fn switch_mdio_cl22_read;
sai_switch_mdio_cl22_write_fn switch_mdio_cl22_write;
sai_bulk_object_set_attribute_fn set_switches_attribute;
sai_bulk_object_get_attribute_fn get_switches_attribute

} sai_switch_api_t;

Expand Down
7 changes: 7 additions & 0 deletions meta/parse.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4452,6 +4452,13 @@ sub ExtractObjectTypeBulkMap

my $OT = "SAI_OBJECT_TYPE_" . uc($ot);

# Object type is extracted from name like "routes" -> "route", and then
# from "switches" -> "switche" which fails due to invalid type.
# Map "switche" to "switch" to avoid this error.
if ($OT eq "SAI_OBJECT_TYPE_SWITCHE") {
$OT = "SAI_OBJECT_TYPE_SWITCH";
}

if (not defined $OBJECT_TYPE_MAP{$OT})
{
LogError "invalid object type $OT extracted from bulk definition: $fn";
Expand Down
4 changes: 3 additions & 1 deletion meta/style.pm
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ sub CheckFunctionNaming
switch_mdio_cl22_read
switch_mdio_cl22_write
switch_register_read
switch_register_write);
switch_register_write
set_switches_attribute
get_switches_attribute);

my $REG = "(" . (join"|",@listex) . ")";

Expand Down
Loading