Skip to content

Commit ae5963d

Browse files
author
Shrikrishna (Shri) Khare
committed
Bulk get/set for switches
Signed-off-by: Shrikrishna (Shri) Khare <[email protected]>
1 parent 754ca66 commit ae5963d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

inc/saiswitch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4061,6 +4061,8 @@ typedef struct _sai_switch_api_t
40614061
sai_get_switch_tunnel_attribute_fn get_switch_tunnel_attribute;
40624062
sai_switch_mdio_cl22_read_fn switch_mdio_cl22_read;
40634063
sai_switch_mdio_cl22_write_fn switch_mdio_cl22_write;
4064+
sai_bulk_object_set_attribute_fn set_switches_attribute;
4065+
sai_bulk_object_get_attribute_fn get_switches_attribute
40644066

40654067
} sai_switch_api_t;
40664068

meta/parse.pl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4452,6 +4452,13 @@ sub ExtractObjectTypeBulkMap
44524452

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

4455+
# Object type is extracted from name like "routes" -> "route", and then
4456+
# from "switches" -> "switche" which fails due to invalid type.
4457+
# Map "switche" to "switch" to avoid this error.
4458+
if ($OT eq "SAI_OBJECT_TYPE_SWITCHE") {
4459+
$OT = "SAI_OBJECT_TYPE_SWITCH";
4460+
}
4461+
44554462
if (not defined $OBJECT_TYPE_MAP{$OT})
44564463
{
44574464
LogError "invalid object type $OT extracted from bulk definition: $fn";

meta/style.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,9 @@ sub CheckFunctionNaming
459459
switch_mdio_cl22_read
460460
switch_mdio_cl22_write
461461
switch_register_read
462-
switch_register_write);
462+
switch_register_write
463+
set_switches_attribute
464+
get_switches_attribute);
463465
464466
my $REG = "(" . (join"|",@listex) . ")";
465467

0 commit comments

Comments
 (0)