Skip to content

Commit

Permalink
Rename all SAI attributes
Browse files Browse the repository at this point in the history
Signed-off-by: Marian Pritsak <[email protected]>
  • Loading branch information
marian-pritsak committed Apr 30, 2024
1 parent 7753b2a commit cc43c75
Show file tree
Hide file tree
Showing 28 changed files with 72 additions and 72 deletions.
2 changes: 1 addition & 1 deletion dash-pipeline/tests/libsai/vnet_out/vnet_out.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ int main(int argc, char **argv)
attr.value.u32 = 10000;
attrs.push_back(attr);

attr.id = SAI_ENI_ATTR_PPS;
attr.id = SAI_ENI_ATTR_BW;
attr.value.u32 = 100000;
attrs.push_back(attr);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_sai_thrift_create_eni(saithrift_client):
pl_underlay_sip = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4,
addr=sai_thrift_ip_addr_t(ip4="10.0.0.18"))
eni = sai_thrift_create_eni(saithrift_client, cps=10000,
pps=100000, flows=100000,
bw=100000, flows=100000,
admin_state=True,
vm_underlay_dip=vm_underlay_dip,
vm_vni=9,
Expand Down
2 changes: 1 addition & 1 deletion documentation/general/dash-sonic-hld.md
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ rx_counter = uint64 ; Number of received bytes (read-only)
| DASH_QOS_TABLE | | | | |
| | qos_name | | | |
| | | qos_id | | |
| | | bw | SAI_ENI_ATTR_PPS | |
| | | bw | SAI_ENI_ATTR_BW | |
| | | cps | SAI_ENI_ATTR_CPS | |
| | | flows | SAI_ENI_ATTR_FLOWS | |
| DASH_ENI_TABLE | | | *SAI_OBJECT_TYPE_ENI* | |
Expand Down
2 changes: 1 addition & 1 deletion test/test-cases/functional/ptf/sai_dash_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def eni_create(self, **kwargs):

default_kwargs = {
"cps": 10000,
"pps": 100000,
"bw": 100000,
"flows": 100000,
"admin_state": True,
"vm_underlay_dip": sai_ipaddress("0.0.0.0"),
Expand Down
2 changes: 1 addition & 1 deletion test/test-cases/functional/ptf/saidashacl.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def setUpSwitch(self):
pl_underlay_sip = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4,
addr=sai_thrift_ip_addr_t(ip4="10.0.0.18"))
self.eni = self.create_obj(sai_thrift_create_eni, sai_thrift_remove_eni, cps=10000,
pps=100000, flows=100000,
bw=100000, flows=100000,
admin_state=True,
vm_underlay_dip=vm_underlay_dip,
vm_vni=9,
Expand Down
28 changes: 14 additions & 14 deletions test/test-cases/functional/ptf/saidasheni.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setUp(self):
super(CreateDeleteEniTest, self).setUp()

self.cps = 10000 # ENI connections per second
self.pps = 100000 # ENI packets per seconds
self.bw = 1000 # ENI BW
self.flows = 100000 # ENI flows
self.admin_state = True # ENI admin state
self.vm_vni = 10 # ENI VM VNI
Expand Down Expand Up @@ -124,7 +124,7 @@ def createEniTest(self):
"""

self.eni = self.eni_create(cps=self.cps,
pps=self.pps,
bw=self.bw,
flows=self.flows,
admin_state=self.admin_state,
vm_underlay_dip=self.vm_underlay_dip,
Expand Down Expand Up @@ -315,7 +315,7 @@ def eniGetAttributesTest(self):
attr = sai_thrift_get_eni_attribute(self.client,
self.eni,
cps=True,
pps=True,
bw=True,
flows=True,
admin_state=True,
vm_underlay_dip=True,
Expand Down Expand Up @@ -344,7 +344,7 @@ def eniGetAttributesTest(self):
self.assertEqual(self.status(), SAI_STATUS_SUCCESS)

self.assertEqual(attr['cps'], self.cps)
self.assertEqual(attr['pps'], self.pps)
self.assertEqual(attr['bw'], self.bw)
self.assertEqual(attr['flows'], self.flows)
self.assertEqual(attr['admin_state'], self.admin_state)
self.assertEqual(attr['vm_underlay_dip'].addr.ip4, self.vm_underlay_dip.addr.ip4)
Expand Down Expand Up @@ -379,7 +379,7 @@ def eniSetAndGetAttributesTest(self):
"""

test_cps = self.cps * 2
test_pps = self.pps * 2
test_bw = self.bw * 2
test_flows = self.flows * 2
test_admin_state = False
test_vm_vni = 5
Expand All @@ -399,12 +399,12 @@ def eniSetAndGetAttributesTest(self):
attr = sai_thrift_get_eni_attribute(self.client, self.eni, cps=True)
self.assertEqual(attr['cps'], test_cps)

# set and verify new pps value
sai_thrift_set_eni_attribute(self.client, self.eni, pps=test_pps)
# set and verify new bw value
sai_thrift_set_eni_attribute(self.client, self.eni, bw=test_bw)
self.assertEqual(self.status(), SAI_STATUS_SUCCESS)

attr = sai_thrift_get_eni_attribute(self.client, self.eni, pps=True)
self.assertEqual(attr['pps'], test_pps)
attr = sai_thrift_get_eni_attribute(self.client, self.eni, bw=True)
self.assertEqual(attr['bw'], test_bw)

# set and verify new flow value
sai_thrift_set_eni_attribute(self.client, self.eni, flows=test_flows)
Expand Down Expand Up @@ -594,7 +594,7 @@ def eniSetAndGetAttributesTest(self):
finally:
# set ENI attributes to the original values
sai_thrift_set_eni_attribute(self.client, self.eni, cps=self.cps)
sai_thrift_set_eni_attribute(self.client, self.eni, pps=self.pps)
sai_thrift_set_eni_attribute(self.client, self.eni, bw=self.bw)
sai_thrift_set_eni_attribute(self.client, self.eni, flows=self.flows)
sai_thrift_set_eni_attribute(self.client, self.eni, admin_state=self.admin_state)
sai_thrift_set_eni_attribute(self.client, self.eni, vm_underlay_dip=self.vm_underlay_dip)
Expand Down Expand Up @@ -634,7 +634,7 @@ def eniSetAndGetAttributesTest(self):
attr = sai_thrift_get_eni_attribute(self.client,
self.eni,
cps=True,
pps=True,
bw=True,
flows=True,
admin_state=True,
vm_underlay_dip=True,
Expand Down Expand Up @@ -663,7 +663,7 @@ def eniSetAndGetAttributesTest(self):
self.assertEqual(self.status(), SAI_STATUS_SUCCESS)

self.assertEqual(attr['cps'], self.cps)
self.assertEqual(attr['pps'], self.pps)
self.assertEqual(attr['bw'], self.bw)
self.assertEqual(attr['flows'], self.flows)
self.assertEqual(attr['admin_state'], self.admin_state)
self.assertEqual(attr['vm_underlay_dip'].addr.ip4, self.vm_underlay_dip.addr.ip4)
Expand Down Expand Up @@ -706,12 +706,12 @@ def eniEtherAddressMapAttributesTest(self):
try:
# create test eni to verify set method
test_cps = 500
test_pps = 500
test_bw = 500
test_flows = 500
test_vm_underlay_ip = sai_ipaddress('172.0.15.15')

test_eni = self.eni_create(cps=test_cps,
pps=test_pps,
bw=test_bw,
flows=test_flows,
admin_state=True,
vm_underlay_dip=test_vm_underlay_ip,
Expand Down
2 changes: 1 addition & 1 deletion test/test-cases/functional/ptf/saidashvnet_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def configureVnet(self):
pl_underlay_sip = sai_thrift_ip_address_t(addr_family=SAI_IP_ADDR_FAMILY_IPV4,
addr=sai_thrift_ip_addr_t(ip4="10.0.0.18"))
self.eni = sai_thrift_create_eni(self.client, cps=10000,
pps=100000, flows=100000,
bw=100000, flows=100000,
admin_state=True,
vm_underlay_dip=vm_underlay_dip,
vm_vni=9,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################

TOTALPACKETS = 1000
PPS = 100
BW = 100
PACKET_LENGTH = 128
ENI_IP = "1.1.0.1"
NETWORK_IP1 = "1.128.0.1"
Expand Down Expand Up @@ -92,7 +92,7 @@
"type": "SAI_OBJECT_TYPE_ENI",
"attributes": [
"SAI_ENI_ATTR_CPS", "10000",
"SAI_ENI_ATTR_PPS", "100000",
"SAI_ENI_ATTR_BW", "100000",
"SAI_ENI_ATTR_FLOWS", "100000",
"SAI_ENI_ATTR_ADMIN_STATE", "True",
"SAI_ENI_ATTR_VM_UNDERLAY_DIP", ENI_VTEP_IP,
Expand Down Expand Up @@ -134,7 +134,7 @@
"type": "SAI_OBJECT_TYPE_ENI",
"attributes": [
"SAI_ENI_ATTR_CPS", "10000",
"SAI_ENI_ATTR_PPS", "100000",
"SAI_ENI_ATTR_BW", "100000",
"SAI_ENI_ATTR_FLOWS", "100000",
"SAI_ENI_ATTR_ADMIN_STATE", "True",
"SAI_ENI_ATTR_VM_UNDERLAY_DIP", NETWORK_VTEP_IP,
Expand Down Expand Up @@ -176,7 +176,7 @@
"type": "SAI_OBJECT_TYPE_ENI",
"attributes": [
"SAI_ENI_ATTR_CPS", "10000",
"SAI_ENI_ATTR_PPS", "100000",
"SAI_ENI_ATTR_BW", "100000",
"SAI_ENI_ATTR_FLOWS", "100000",
"SAI_ENI_ATTR_ADMIN_STATE", "True",
"SAI_ENI_ATTR_VM_UNDERLAY_DIP", NETWORK_VTEP_IP,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###############################################################

TOTALPACKETS = 1000
PPS = 100
BW = 100
PACKET_LENGTH = 128
ENI_IP = "1.1.0.1"
NETWORK_IP1 = "1.128.0.1"
Expand Down Expand Up @@ -97,7 +97,7 @@
"attributes": [
"SAI_ENI_ATTR_CPS",
"10000",
"SAI_ENI_ATTR_PPS",
"SAI_ENI_ATTR_BW",
"100000",
"SAI_ENI_ATTR_FLOWS",
"100000",
Expand Down Expand Up @@ -174,7 +174,7 @@
"attributes": [
"SAI_ENI_ATTR_CPS",
"10000",
"SAI_ENI_ATTR_PPS",
"SAI_ENI_ATTR_BW",
"100000",
"SAI_ENI_ATTR_FLOWS",
"100000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"type": "SAI_OBJECT_TYPE_ENI",
"attributes": [
"SAI_ENI_ATTR_CPS", "10000",
"SAI_ENI_ATTR_PPS", "100000",
"SAI_ENI_ATTR_BW", "100000",
"SAI_ENI_ATTR_FLOWS", "100000",
"SAI_ENI_ATTR_ADMIN_STATE", "True",
"SAI_ENI_ATTR_VM_UNDERLAY_DIP", "221.0.1.11",
Expand Down Expand Up @@ -108,7 +108,7 @@
"type": "SAI_OBJECT_TYPE_ENI",
"attributes": [
"SAI_ENI_ATTR_CPS", "10000",
"SAI_ENI_ATTR_PPS", "100000",
"SAI_ENI_ATTR_BW", "100000",
"SAI_ENI_ATTR_FLOWS", "100000",
"SAI_ENI_ATTR_ADMIN_STATE", "True",
"SAI_ENI_ATTR_VM_UNDERLAY_DIP", "221.0.2.101",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_vnet_eni_create(self, dpu):
"attributes": [
"SAI_ENI_ATTR_CPS",
"10000",
"SAI_ENI_ATTR_PPS",
"SAI_ENI_ATTR_BW",
"100000",
"SAI_ENI_ATTR_FLOWS",
"100000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_vnet_inbound_routing_entry_create_setup(self, dpu):
"attributes": [
"SAI_ENI_ATTR_CPS",
"10000",
"SAI_ENI_ATTR_PPS",
"SAI_ENI_ATTR_BW",
"100000",
"SAI_ENI_ATTR_FLOWS",
"100000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_vnet_outbound_routing_entry_create(self, dpu):
"attributes": [
"SAI_ENI_ATTR_CPS",
"10000",
"SAI_ENI_ATTR_PPS",
"SAI_ENI_ATTR_BW",
"100000",
"SAI_ENI_ATTR_FLOWS",
"100000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_vm_to_vm_commn_acl_inbound(self, dataplane):
# send n packets and stop
f2.duration.fixed_packets.packets = TOTALPACKETS
# send n packets per second
f2.rate.pps = PPS
f2.rate.bw = BW
f2.metrics.enable = True

outer_eth, ip, udp, vxlan, inner_eth, inner_ip , inner_udp= (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
###############################################################

TOTALPACKETS = 1000
PPS = 100
TRAFFIC_SLEEP_TIME = (TOTALPACKETS / PPS) + 2
BW = 100
TRAFFIC_SLEEP_TIME = (TOTALPACKETS / BW) + 2
PACKET_LENGTH = 128
ENI_IP = "1.1.0.1"
NETWORK_IP2 = "1.128.0.2"
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_vm_to_vm_commn_acl_outbound(self, dataplane):
# send n packets and stop
f1.duration.fixed_packets.packets = TOTALPACKETS
# send n packets per second
f1.rate.pps = PPS
f1.rate.bw = BW
f1.metrics.enable = True

outer_eth1, ip1, udp1, vxlan1, inner_eth1, inner_ip1, inner_udp1= (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_vm_to_vm_commn_udp_bidir(self, dataplane):
# send n packets and stop
f1.duration.fixed_packets.packets = TOTALPACKETS
# send n packets per second
f1.rate.pps = PPS
f1.rate.bw = BW
f1.metrics.enable = True

outer_eth1, ip1, udp1, vxlan1, inner_eth1, inner_ip1, inner_udp1= (
Expand Down Expand Up @@ -111,7 +111,7 @@ def test_vm_to_vm_commn_udp_bidir(self, dataplane):
# send n packets and stop
f2.duration.fixed_packets.packets = TOTALPACKETS
# send n packets per second
f2.rate.pps = PPS
f2.rate.bw = BW
f2.metrics.enable = True

outer_eth, ip, udp, vxlan, inner_eth, inner_ip , inner_udp= (
Expand Down Expand Up @@ -152,7 +152,7 @@ def test_vm_to_vm_commn_udp_bidir(self, dataplane):
# send n packets and stop
f3.duration.fixed_packets.packets = TOTALPACKETS
# send n packets per second
f3.rate.pps = PPS
f3.rate.bw = BW
f3.metrics.enable = True

outer_eth, ip, udp, vxlan, inner_eth, inner_ip , inner_udp= (
Expand Down Expand Up @@ -193,7 +193,7 @@ def test_vm_to_vm_commn_udp_bidir(self, dataplane):
# send n packets and stop
f4.duration.fixed_packets.packets = TOTALPACKETS
# send n packets per second
f4.rate.pps = PPS
f4.rate.bw = BW
f4.metrics.enable = True

outer_eth, ip, udp, vxlan, inner_eth, inner_ip , inner_udp= (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_vm_to_vm_commn_udp_inbound(self, dataplane):
# send n packets and stop
f1.duration.fixed_packets.packets = TOTALPACKETS
# send n packets per second
f1.rate.pps = PPS
f1.rate.bw = BW
f1.metrics.enable = True

outer_eth1, ip1, udp1, vxlan1, inner_eth1, inner_ip1, inner_udp1= (
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_vm_to_vm_commn_udp_inbound(self, dataplane):
# send n packets and stop
f2.duration.fixed_packets.packets = TOTALPACKETS
# send n packets per second
f2.rate.pps = PPS
f2.rate.bw = BW
f2.metrics.enable = True

outer_eth, ip, udp, vxlan, inner_eth, inner_ip , inner_udp= (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
###############################################################

TOTALPACKETS = 1000
PPS = 100
TRAFFIC_SLEEP_TIME = (TOTALPACKETS / PPS) + 2
BW = 100
TRAFFIC_SLEEP_TIME = (TOTALPACKETS / BW) + 2
PACKET_LENGTH = 128
ENI_IP = "1.1.0.1"
NETWORK_IP1 = "1.128.0.1"
Expand Down Expand Up @@ -89,7 +89,7 @@ def test_vm_to_vm_commn_udp_outbound(self, dataplane):
# send n packets and stop
f1.duration.fixed_packets.packets = TOTALPACKETS
# send n packets per second
f1.rate.pps = PPS
f1.rate.bw = BW
f1.metrics.enable = True

outer_eth1, ip1, udp1, vxlan1, inner_eth1, inner_ip1, inner_udp1= (
Expand Down Expand Up @@ -128,7 +128,7 @@ def test_vm_to_vm_commn_udp_outbound(self, dataplane):
# send n packets and stop
f2.duration.fixed_packets.packets = TOTALPACKETS
# send n packets per second
f2.rate.pps = PPS
f2.rate.bw = BW
f2.metrics.enable = True

outer_eth, ip, udp, vxlan, inner_eth, inner_ip , inner_udp= (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"attributes": [
"SAI_ENI_ATTR_CPS",
"10000",
"SAI_ENI_ATTR_PPS",
"SAI_ENI_ATTR_BW",
"100000",
"SAI_ENI_ATTR_FLOWS",
"100000",
Expand Down Expand Up @@ -158,7 +158,7 @@
"attributes": [
"SAI_ENI_ATTR_CPS",
"10000",
"SAI_ENI_ATTR_PPS",
"SAI_ENI_ATTR_BW",
"100000",
"SAI_ENI_ATTR_FLOWS",
"100000",
Expand Down
Loading

0 comments on commit cc43c75

Please sign in to comment.