Skip to content

Commit

Permalink
Fix README.md with markdownlint
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyzhai committed Feb 25, 2025
1 parent 5e06b6d commit 0d9eb53
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions dash-pipeline/utils/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
# DASH pipeline utils

## Overview

This package includes utils to configure DASH pipeline (bmv2) via p4runtime
directly. It is a supplementary of DASH SAI, which is not doable/proper to do
bmv2 specific configurations.

## Usage
1. internal configuration of bmv2 pipeline
```
dut_mac = get_mac("veth0")
neighbor_mac = get_mac("veth1")
P4InternalConfigTable().set(neighbor_mac = mac_in_bytes(neighbor_mac), mac = mac_in_bytes(dut_mac))
```
2. underlay routing

### internal configuration of bmv2 pipeline

```python
neighbor_mac = "xx:xx:xx:xx:xx:xx"
dut_mac = "xx:xx:xx:xx:xx:xx"
internal_config = P4InternalConfigTable(target = "localhost:9559")
internal_config.set(neighbor_mac = neighbor_mac, mac = dut_mac)
internal_config.set(flow_enabled = 1)
internal_config.get()
internal_config.unset()
```
underlay_routing = P4UnderlayRoutingTable()

### underlay routing

```python
underlay_routing = P4UnderlayRoutingTable(target = "localhost:9559")
underlay_routing.set(ip_prefix = '::10.0.1.0', ip_prefix_len = 120, next_hop_id = 1)
underlay_routing.get(ip_prefix = '::10.0.1.0', ip_prefix_len = 120))
underlay_routing.unset(ip_prefix = '::10.0.1.0', ip_prefix_len = 120))
```
3. flow
```
# decorator use_flow can be used to enable flow lookup of bmv2 pipeline for unittest class
@use_flow
class Test:
def setUp(self):
# Verify flow entry is existing and customer packet can hit this flow
verify_flow(eni_mac, vnet_id, customer_packet)
# Verify flow entry is not existing and customer packet cannot hit this flow
verify_no_flow(eni_mac, vnet_id, customer_packet)
```

0 comments on commit 0d9eb53

Please sign in to comment.