Skip to content

Commit 948a890

Browse files
ccasconejnfoster
authored andcommitted
Fixed P4Runtime spelling (#162)
As agreed in the P4 API WG
1 parent 08445e0 commit 948a890

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ you get started with P4 programming, organized into several modules:
99
* [Basic Forwarding](./exercises/basic)
1010
* [Basic Tunneling](./exercises/basic_tunnel)
1111

12-
2. P4 Runtime and the Control Plane
13-
* [P4 Runtime](./exercises/p4runtime)
12+
2. P4Runtime and the Control Plane
13+
* [P4Runtime](./exercises/p4runtime)
1414

1515
3. Monitoring and Debugging
1616
* [Explicit Congestion Notification](./exercises/ecn)

exercises/p4runtime/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Implementing a Control Plane using P4 Runtime
1+
# Implementing a Control Plane using P4Runtime
22

33
## Introduction
44

5-
In this exercise, we will be using P4 Runtime to send flow entries to the
5+
In this exercise, we will be using P4Runtime to send flow entries to the
66
switch instead of using the switch's CLI. We will be building on the same P4
77
program that you used in the [basic_tunnel](../basic_tunnel) exercise. The
88
P4 program has been renamed to `advanced_tunnel.py` and has been augmented
@@ -94,14 +94,14 @@ table entries like we have in the previous exercises.
9494
switch pipeline and control plane. This interface is defined in the
9595
`advanced_tunnel.p4info` file. The table entries that you build in `mycontroller.py`
9696
refer to specific tables, keys, and actions by name, and we use a P4Info helper
97-
to convert the names into the IDs that are required for P4 Runtime. Any changes
97+
to convert the names into the IDs that are required for P4Runtime. Any changes
9898
in the P4 program that add or rename tables, keys, or actions will need to be
9999
reflected in your table entries.
100100

101101
## Step 2: Implement Tunnel Forwarding
102102

103103
The `mycontroller.py` file is a basic controller plane that does the following:
104-
1. Establishes a gRPC connection to the switches for the P4 Runtime service.
104+
1. Establishes a gRPC connection to the switches for the P4Runtime service.
105105
2. Pushes the P4 program to each switch.
106106
3. Writes tunnel ingress and tunnel egress rules for two tunnels between h1 and h2.
107107
4. Reads tunnel ingress and egress counters every 2 seconds.
@@ -119,12 +119,12 @@ the `p4runtime_lib` directory. Here is a summary of each of the files in the dir
119119
- `helper.py`
120120
- Contains the `P4InfoHelper` class which is used to parse the `p4info` files.
121121
- Provides translation methods from entity name to and from ID number.
122-
- Builds P4 program-dependent sections of P4 Runtime table entries.
122+
- Builds P4 program-dependent sections of P4Runtime table entries.
123123
- `switch.py`
124124
- Contains the `SwitchConnection` class which grabs the gRPC client stub, and
125125
establishes connections to the switches.
126-
- Provides helper methods that construct the P4 Runtime protocol buffer messages
127-
and makes the P4 Runtime gRPC service calls.
126+
- Provides helper methods that construct the P4Runtime protocol buffer messages
127+
and makes the P4Runtime gRPC service calls.
128128
- `bmv2.py`
129129
- Contains `Bmv2SwitchConnection` which extends `SwitchConnections` and provides
130130
the BMv2-specific device payload to load the P4 program.
@@ -161,8 +161,8 @@ need to change it for a more realistic network?
161161
Hint: The default TTL is 64 for packets sent by the hosts.
162162

163163
If you are interested, you can find the protocol buffer and gRPC definitions here:
164-
- [P4 Runtime](https://github.com/p4lang/PI/blob/master/proto/p4/p4runtime.proto)
165-
- [P4 Info](https://github.com/p4lang/PI/blob/master/proto/p4/config/p4info.proto)
164+
- [P4Runtime](https://github.com/p4lang/PI/blob/master/proto/p4/p4runtime.proto)
165+
- [P4Info](https://github.com/p4lang/PI/blob/master/proto/p4/config/p4info.proto)
166166

167167
#### Cleaning up Mininet
168168

exercises/p4runtime/mycontroller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ def printGrpcError(e):
133133
print "[%s:%d]" % (traceback.tb_frame.f_code.co_filename, traceback.tb_lineno)
134134

135135
def main(p4info_file_path, bmv2_file_path):
136-
# Instantiate a P4 Runtime helper from the p4info file
136+
# Instantiate a P4Runtime helper from the p4info file
137137
p4info_helper = p4runtime_lib.helper.P4InfoHelper(p4info_file_path)
138138

139139
try:
140140
# Create a switch connection object for s1 and s2;
141-
# this is backed by a P4 Runtime gRPC connection.
141+
# this is backed by a P4Runtime gRPC connection.
142142
# Also, dump all P4Runtime messages sent to switch to given txt files.
143143
s1 = p4runtime_lib.bmv2.Bmv2SwitchConnection(
144144
name='s1',

exercises/p4runtime/solution/mycontroller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ def printCounter(p4info_helper, sw, counter_name, index):
145145

146146

147147
def main(p4info_file_path, bmv2_file_path):
148-
# Instantiate a P4 Runtime helper from the p4info file
148+
# Instantiate a P4Runtime helper from the p4info file
149149
p4info_helper = p4runtime_lib.helper.P4InfoHelper(p4info_file_path)
150150

151151
# Create a switch connection object for s1 and s2;
152-
# this is backed by a P4 Runtime gRPC connection.
152+
# this is backed by a P4Runtime gRPC connection.
153153
# Also, dump all P4Runtime messages sent to switch to given txt files.
154154
s1 = p4runtime_lib.bmv2.Bmv2SwitchConnection(
155155
name='s1',

utils/p4runtime_lib/switch.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def MasterArbitrationUpdate(self, dry_run=False, **kwargs):
6262
request.arbitration.election_id.low = 1
6363

6464
if dry_run:
65-
print "P4 Runtime MasterArbitrationUpdate: ", request
65+
print "P4Runtime MasterArbitrationUpdate: ", request
6666
else:
6767
self.requests_stream.put(request)
6868

@@ -78,7 +78,7 @@ def SetForwardingPipelineConfig(self, p4info, dry_run=False, **kwargs):
7878

7979
request.action = p4runtime_pb2.SetForwardingPipelineConfigRequest.VERIFY_AND_COMMIT
8080
if dry_run:
81-
print "P4 Runtime SetForwardingPipelineConfig:", request
81+
print "P4Runtime SetForwardingPipelineConfig:", request
8282
else:
8383
self.client_stub.SetForwardingPipelineConfig(request)
8484

@@ -90,7 +90,7 @@ def WriteTableEntry(self, table_entry, dry_run=False):
9090
update.type = p4runtime_pb2.Update.INSERT
9191
update.entity.table_entry.CopyFrom(table_entry)
9292
if dry_run:
93-
print "P4 Runtime Write:", request
93+
print "P4Runtime Write:", request
9494
else:
9595
self.client_stub.Write(request)
9696

@@ -104,7 +104,7 @@ def ReadTableEntries(self, table_id=None, dry_run=False):
104104
else:
105105
table_entry.table_id = 0
106106
if dry_run:
107-
print "P4 Runtime Read:", request
107+
print "P4Runtime Read:", request
108108
else:
109109
for response in self.client_stub.Read(request):
110110
yield response
@@ -121,7 +121,7 @@ def ReadCounters(self, counter_id=None, index=None, dry_run=False):
121121
if index is not None:
122122
counter_entry.index.index = index
123123
if dry_run:
124-
print "P4 Runtime Read:", request
124+
print "P4Runtime Read:", request
125125
else:
126126
for response in self.client_stub.Read(request):
127127
yield response

utils/run_exercise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def configureP4Switch(**switch_args):
3838
switch's thrift server is using a unique port.
3939
"""
4040
if "sw_path" in switch_args and 'grpc' in switch_args['sw_path']:
41-
# If grpc appears in the BMv2 switch target, we assume will start P4 Runtime
41+
# If grpc appears in the BMv2 switch target, we assume will start P4Runtime
4242
class ConfiguredP4RuntimeSwitch(P4RuntimeSwitch):
4343
def __init__(self, *opts, **kwargs):
4444
kwargs.update(switch_args)

0 commit comments

Comments
 (0)