stratum / fabric-tna

The SD-Fabric data plane
https://docs.sd-fabric.org/
30 stars 15 forks source link

[SDFAB-844 - Part 3] Add NetcfgSlicingProvider #457

Closed ccascone closed 2 years ago

ccascone commented 2 years ago

Which populates the SlicingManager stores by listening for netcfg events.

For now we support only adding or removing the slicing config block. Supporting updates will require more work around implementing some diff logic. For now, the only requirement we have for provisioning slices is at system startup, so no immediate need to support config updates.

TODO:

Example netcfg input:

{
  "apps": {
    "org.stratumproject.fabric-tna": {
      "slicing": {
        "bestEffortQueueId": 0,
        "slices": {
          "0": {
            "name": "Default",
            "tcs": {
              "REAL_TIME": {
                "queueId": 1,
                "isSystemTc": true
              }
            }
          },
          "1": {
            "name": "P4-UPF",
            "tcs": {
              "CONTROL": {
                "queueId": 2,
                "maxRateBps": "2000000"
              },
              "REAL_TIME": {
                "queueId": 3,
                "maxRateBps": "50000000"
              },
              "ELASTIC": {
                "queueId": 4,
                "gminRateBps": "10000000"
              }
            }
          },
          "2": {
            "name": "BESS-UPF",
            "tcs": {
              "ELASTIC": {
                "queueId": 5
              }
            }
          }
        }
      }
    }
  }
}

Example output:

carmelo@root > fabric-tna:slice-store
SliceStoreKey{sliceId=0, trafficClass=REAL_TIME} -> TrafficClassDescription{tc=REAL_TIME, qid=1, maxRateBps=unlimited, gminRateBps=0, isSystemTc=true}
SliceStoreKey{sliceId=0, trafficClass=BEST_EFFORT} -> TrafficClassDescription{tc=BEST_EFFORT, qid=0, maxRateBps=unlimited, gminRateBps=0, isSystemTc=false}
SliceStoreKey{sliceId=1, trafficClass=ELASTIC} -> TrafficClassDescription{tc=ELASTIC, qid=4, maxRateBps=unlimited, gminRateBps=10000000, isSystemTc=false}
SliceStoreKey{sliceId=1, trafficClass=BEST_EFFORT} -> TrafficClassDescription{tc=BEST_EFFORT, qid=0, maxRateBps=unlimited, gminRateBps=0, isSystemTc=false}
SliceStoreKey{sliceId=1, trafficClass=CONTROL} -> TrafficClassDescription{tc=CONTROL, qid=2, maxRateBps=2000000, gminRateBps=0, isSystemTc=false}
SliceStoreKey{sliceId=1, trafficClass=REAL_TIME} -> TrafficClassDescription{tc=REAL_TIME, qid=3, maxRateBps=50000000, gminRateBps=0, isSystemTc=false}
SliceStoreKey{sliceId=2, trafficClass=BEST_EFFORT} -> TrafficClassDescription{tc=BEST_EFFORT, qid=0, maxRateBps=unlimited, gminRateBps=0, isSystemTc=false}
SliceStoreKey{sliceId=2, trafficClass=ELASTIC} -> TrafficClassDescription{tc=ELASTIC, qid=5, maxRateBps=unlimited, gminRateBps=0, isSystemTc=false}

To remove the config:


carmelo@root > netcfg --remove apps org.stratumproject.fabric-tna slicing 
null
carmelo@root > fabric-tna:slice-store
SliceStoreKey{sliceId=0, trafficClass=BEST_EFFORT} -> TrafficClassDescription{tc=BEST_EFFORT, qid=0, maxRateBps=unlimited, gminRateBps=0, isSystemTc=false}
codecov[bot] commented 2 years ago

Codecov Report

Merging #457 (93ab584) into qos-refactoring (0c2a764) will increase coverage by 0.22%. The diff coverage is 70.07%.

:exclamation: Current head 93ab584 differs from pull request most recent head 1a7cdc1. Consider uploading reports for the commit 1a7cdc1 to get more accurate results Impacted file tree graph

@@                  Coverage Diff                  @@
##             qos-refactoring     #457      +/-   ##
=====================================================
+ Coverage              68.51%   68.74%   +0.22%     
- Complexity               639      669      +30     
=====================================================
  Files                     59       59              
  Lines                   4393     4508     +115     
  Branches                 483      496      +13     
=====================================================
+ Hits                    3010     3099      +89     
- Misses                  1140     1156      +16     
- Partials                 243      253      +10     
Impacted Files Coverage Δ
.../java/org/stratumproject/fabric/tna/Constants.java 100.00% <ø> (ø)
.../org/stratumproject/fabric/tna/PipeconfLoader.java 0.00% <0.00%> (ø)
...oject/fabric/tna/behaviour/FabricCapabilities.java 25.00% <ø> (ø)
...ratumproject/fabric/tna/behaviour/FabricUtils.java 77.58% <ø> (ø)
...abric/tna/behaviour/pipeliner/FabricPipeliner.java 30.83% <0.00%> (ø)
...aviour/pipeliner/FilteringObjectiveTranslator.java 82.88% <ø> (ø)
...viour/pipeliner/ForwardingObjectiveTranslator.java 74.19% <ø> (ø)
...atumproject/fabric/tna/slicing/api/MeterColor.java 100.00% <ø> (ø)
...stratumproject/fabric/tna/slicing/api/SliceId.java 83.33% <ø> (ø)
...mproject/fabric/tna/slicing/api/SlicingConfig.java 79.51% <ø> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0c2a764...1a7cdc1. Read the comment docs.