Skip to content

Commit

Permalink
adding max scale for ndp/arp tables per ASIC
Browse files Browse the repository at this point in the history
Summary:
Adding max scale for neighbor tables, NDP and ARP tables per ASIC.

when ResourceAccountant check for available resource, it gets max scale per asic and make decision based on that

I have created CSP to get max scale from brcm. I will update more ASIC, as I get response.

Cisco CLI o/p:
```
S1[Device:0]> show vrf hosts usage ip-version 4
+------------------------------------------------------------+
|                    Hosts Resources Usage                   |
+---------------+---------------+----------------------------+
| num-neighbors | max-neighbors | resources-usage            |
+---------------+---------------+----------------------------+
| 0             | 176881        | {'central-exact-match': 0} |
+---------------+---------------+----------------------------+
S1[Device:0]> show vrf hosts usage ip-version 6
+------------------------------------------------------------+
|                    Hosts Resources Usage                   |
+---------------+---------------+----------------------------+
| num-neighbors | max-neighbors | resources-usage            |
+---------------+---------------+----------------------------+
| 16            | 88465         | {'central-exact-match': 0} |
+---------------+---------------+----------------------------+
```

Reviewed By: shri-khare

Differential Revision: D66732093

fbshipit-source-id: cc0658e4eb549cd9ca748948348bc1f8c28922f8
  • Loading branch information
Prasoon Patel authored and facebook-github-bot committed Dec 5, 2024
1 parent 8f75c8b commit 0e622b7
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fboss/agent/hw/switch_asics/EbroAsic.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ class EbroAsic : public TajoAsic {
// MAX_NEXT_HOP_GROUP_MEMBERS = 32768
return 32768;
}
std::optional<uint32_t> getMaxNdpTableSize() const override {
return 88465;
}
std::optional<uint32_t> getMaxArpTableSize() const override {
return 176881;
}
uint32_t getNumCores() const override {
return 12;
}
Expand Down
6 changes: 6 additions & 0 deletions fboss/agent/hw/switch_asics/FakeAsic.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ class FakeAsic : public HwAsic {
std::optional<uint32_t> getMaxEcmpMembers() const override {
return 128;
}
std::optional<uint32_t> getMaxNdpTableSize() const override {
return 8192;
}
std::optional<uint32_t> getMaxArpTableSize() const override {
return 8192;
}
AsicVendor getAsicVendor() const override {
return HwAsic::AsicVendor::ASIC_VENDOR_FAKE;
}
Expand Down
11 changes: 11 additions & 0 deletions fboss/agent/hw/switch_asics/HwAsic.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,17 @@ class HwAsic {
return std::nullopt;
}

// SAI implementaion doen not support attribute
// SAI_SWITCH_ATTR_L3_NEIGHBOR_TABLE_SIZE yet, so decided to add these
// functions to return max neighbot table size
virtual std::optional<uint32_t> getMaxNdpTableSize() const {
return std::nullopt;
}

virtual std::optional<uint32_t> getMaxArpTableSize() const {
return std::nullopt;
}

virtual bool scalingFactorBasedDynamicThresholdSupported() const = 0;

virtual int getBufferDynThreshFromScalingFactor(
Expand Down
6 changes: 6 additions & 0 deletions fboss/agent/hw/switch_asics/MockAsic.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ class MockAsic : public HwAsic {
std::optional<uint32_t> getMaxDlbEcmpGroups() const override {
return 4;
}
std::optional<uint32_t> getMaxNdpTableSize() const override {
return 8;
}
std::optional<uint32_t> getMaxArpTableSize() const override {
return 8;
}
AsicVendor getAsicVendor() const override {
return HwAsic::AsicVendor::ASIC_VENDOR_MOCK;
}
Expand Down
7 changes: 7 additions & 0 deletions fboss/agent/hw/switch_asics/Tomahawk3Asic.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ class Tomahawk3Asic : public BroadcomXgsAsic {
// Max ACL entries per ACL table
return 256;
}
std::optional<uint32_t> getMaxNdpTableSize() const override {
return 8192;
}

std::optional<uint32_t> getMaxArpTableSize() const override {
return 16384;
}
};

} // namespace facebook::fboss
7 changes: 7 additions & 0 deletions fboss/agent/hw/switch_asics/Tomahawk4Asic.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ class Tomahawk4Asic : public BroadcomXgsAsic {
// Max ACL entries per ACL table
return 256;
}
std::optional<uint32_t> getMaxNdpTableSize() const override {
return 8192;
}

std::optional<uint32_t> getMaxArpTableSize() const override {
return 16384;
}
};

} // namespace facebook::fboss
6 changes: 6 additions & 0 deletions fboss/agent/hw/switch_asics/TomahawkAsic.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ class TomahawkAsic : public BroadcomXgsAsic {
// Max ACL entries per ACL table
return 256;
}
std::optional<uint32_t> getMaxNdpTableSize() const override {
return 20476;
}
std::optional<uint32_t> getMaxArpTableSize() const override {
return 40944;
}
};

} // namespace facebook::fboss

0 comments on commit 0e622b7

Please sign in to comment.