141 Commits

Author SHA1 Message Date
Ray Milkey
5739b2cc0c Merge branch 'master' into dev-karaf-4.2.1
Change-Id: I260f0ee72fa87f1547fa790f031c4980176992ac
2018-11-06 14:11:34 -08:00
Yi Tseng
2a340f7cc6 [ONOS-7829] Implement AbstractGrpcClient and AbstractGrpcClientControl
Change-Id: I39cba6834e7fe8d1b60b576b9934c0b3cfa7104b
2018-11-05 19:05:35 +00:00
Ray Milkey
a218d43062 Merge branch 'master' into merge
Change-Id: Id77bb2de77dd288404c83e331b076aaf9aafacc5
2018-10-30 12:44:55 -07:00
ghj0504520
ed7340c7c2 ONOS-7797 Support adding an arbitrary number of members to an existing P4Runtime group
Change-Id: I7b9ed589ca15957ee1b2780934a6da8e998bace3
2018-10-27 00:25:03 +00:00
Ray Milkey
956bb1691a Merge remote-tracking branch 'origin/master' into dev-karaf-4.2.1
Change-Id: If611105632e508cb17352c6f5b1cbcfd85f716d1
2018-10-26 10:53:44 -07:00
steven30801
7632e150e1 [ONOS-7596] Support reading table entries with counter data in P4Runtime
Change-Id: I85bacb1697a6c881dd69ba74a2162c73ec0b8aee
2018-10-26 17:25:13 +00:00
Thomas Vachuska
22ea6126e4 Removing BUCK files and other Buck-related auxiliaries.
Change-Id: I23691380efcd9bce4906695605214ed59ada0e87
2018-10-24 20:02:31 +00:00
ghj0504520
ec1a420030 ONOS-7810 calculate cookie field when pipeconf registered
Change-Id: Iea29fc447b34c49d4e8fcc831812385459c1ccbb
2018-10-24 19:59:22 +00:00
ghj0504520
92a48bfe9e ONOS-7810 use cookie field when checking the pipeline in P4Runtime
Change-Id: I777af9536889eb525f78493e2cbf43ff637b1a1f
2018-10-23 18:04:36 +00:00
Ray Milkey
d542568b21 Merge branch 'master' into dev-karaf-4.2.1
Change-Id: Iec1b8947c898b0bf10db8caece0c3a064d1c63ae
2018-10-23 10:50:43 -07:00
Carmelo Cascone
03ae0acdd8 Bump version of P4Runtime to 1.0.0rc3 and P4 tools
Change-Id: I3082b4bd772d692830bd5af8e326a0fd5fb2f167
2018-10-18 22:30:46 +00:00
Ray Milkey
db57f1c326 Merge branch 'master' into dev-karaf-4.2.1
Change-Id: I86b9d80581cd76a7c20e05201023090f9692d1ab
2018-10-09 11:26:45 -07:00
Carmelo Cascone
e44592f246 More robust P4Runtime group handling
This patch solves the PENDING_UPDATE and PENDING_ADD_RETRY issue
observed on the ONS EU topology.

The P4Runtime action profile group handling has been re-implemented to
be robust against inconsistencies of the device mirror, which is now
periodically synchronized with the device state. Similarly, we implement
a routine in the P4RuntimeClient to cleanup unused action profile
members.

This patch includes also:
-  Refactor PI handle classes to allow creating handles without the
entity instance
- Use list instead of collections in P4RuntimeClient methods, as order
of updates sent and/or entities received from the device is important

Change-Id: I2e7964ce90f43d66680131b47ab52aca32ab55d2
2018-10-05 23:45:29 +00:00
Carmelo Cascone
50d195ffb3 Do not insert or delete default action entries in P4Runtime
Spec says:
the default entry for a table is always set. It can be set at
compile-time by the P4 programmer - or defaults to NoAction (which is a
no-op) otherwise - and assuming it is not declared as const, can be
modified by the P4Runtime client. Because the default entry is always
set, we do not allow INSERT and DELETE updates on the default entry and
the P4Runtime server must return an INVALID_ARGUMENT error code if the
client attempts one.

With this patch we convert insert or delete operations into modify ones
(unless specified by a driver property, to support non-compliant devices).
For delete, we use the interpreter to suggest a default action that is
the same as the one when the pipeline was originally deployed.

Also, we introduce the capability of synchronizing the device mirror
with the device state.

Change-Id: I3758fc11780eb0f1cf4ed5a295bd98b54b182e29
2018-10-05 23:45:18 +00:00
Carmelo Cascone
dca52babbe Increase gRPC inbound msg size for P4Runtime client
Change-Id: I51bb790a7b16c6e34066978e7044d51971f1b9d4
(cherry picked from commit b3e821d417eddc0c0345d7848a5e62ddd47ff5c3)
2018-10-05 23:39:38 +00:00
Ray Milkey
d84f89ba3d [WIP] Upgrade ONOS to karaf version 4.2.1
Change-Id: I7cd40c995bdf1c80f94b1895fb3344e32404c7fa
2018-09-28 11:20:57 -07:00
Carmelo Cascone
943c664d2f Fixed P4RuntimeClient not parsing detailed write errors
Before the only error shown was UNKNOWN, now we can report errors
specif to each write request.

Change-Id: I5eeed890597b7273720414498b3abce8e9d62fa8
2018-09-13 20:52:20 +00:00
Carmelo Cascone
33b27bc190 Ignore entries from constant tables in P4Runtime
Change-Id: I6ba8591a9674287832a18e258c5dd3801c588a32
(cherry picked from commit ba73da5bd09a6b40ab5727ef4a03767d437687e8)
2018-09-10 08:33:35 +00:00
Carmelo Cascone
de3b6843ca Relinquish mastership when device reports "permission" denied event
Also reduces default pipeconf watchdog probe interval
Also fixes NPE on GDP when device is unreachable

Change-Id: Ie2fe1874b0883a037596d9a555a2f8cc030a55a6
(cherry picked from commit d797e2c28505fbdbb8597038ebcf977a053bae72)
2018-09-10 08:33:22 +00:00
Carmelo Cascone
9e4972c5d8 Refactor P4Runtime subsystem to implement async connection procedure
This patch is an attempt to solve issues observed when restarting both
switches and ONOS nodes. Most of the issues seemed to depend on a
brittle mastership handling when deploying the pipeline.

With this patch, GDP registers devices to the core with available=false
(i.e. offline) and marks them online only when the P4 pipeline has been
deployed to the device. A new PiPipeconfWatchdogService takes care of
deploying pipelines and producing event when devices are ready.

Moreover, we fix a race condition where pipeconf-related behaviors
were not found. This was caused by GDP enforcing the merged
driver name in the network config, while external entities (e.g.
Mininet) were pushing a JSON blob with the base driver name. This patch
removes the need to rely on such a trick and instead uses
pipeconf-aware logic directly in the driver manager (change #19622).

Finally, we fix issues in P4RuntimeClientImpl that were causing the
stream channel not detecting unreachable devices. The solution is to
follow gRPC APIs and re-instantiate a new channel once the first fails.

Change-Id: I6fbc91859c0fb58a6db3bc197b7081a8fe9f97f7
2018-09-06 03:08:09 +00:00
Carmelo Cascone
85d72efe96 Fix race to become master in P4Runtime before pipeline config set
Change-Id: Id02e33a1d72d16ec49634ac57b6a4b56acdcf796
(cherry picked from commit 86f82c9e7ccd3912f77840e38eb7402a04f93681)
2018-08-28 04:50:17 +00:00
Ray Milkey
761e80a427 Remove pom files from ONOS
Change-Id: I53e2395466cba10222d638736635b11380421d98
2018-08-21 18:11:58 +00:00
Ray Milkey
312d987732 Starting snapshot 1.15.0-SNAPSHOT
Change-Id: I9239c7695f7faf6dc184a0ff54a34dedf4761b2d
2018-08-20 16:09:54 -07:00
Ray Milkey
05d609aa02 buildifier reformatting of bazel files
Change-Id: I1645613ec9dc57e659e7036634fcf3f3992b05a7
2018-08-15 17:55:00 +00:00
Carmelo Cascone
0e427dc182 Fix P4RuntimeClientImpl sending empty stream RPC messages
Change-Id: I31e010144585a0cb9e054e773b7a7e4380919d75
2018-08-15 05:53:37 +00:00
ONOS Jenkins User
03e5521fba Starting snapshot 1.14.0-SNAPSHOT 2018-08-14 22:13:58 +00:00
ONOS Jenkins User
3594c24cb2 Tagging 1.14.0-rc2 2018-08-14 22:13:02 +00:00
ONOS Jenkins User
4e5f2d67ac Starting snapshot 1.14.0-SNAPSHOT 2018-08-13 23:16:37 +00:00
ONOS Jenkins User
cff0bd8922 Tagging 1.14.0-rc1 2018-08-13 23:15:43 +00:00
Carmelo Cascone
6a1ae71db1 Fix p4runtime runtime dependencies when building with Bazel
A convenient macro for packaging together all proto and gRPC libraries
in an OSGi jar is provided. Also re-packaging of gRPC core (to avoid OSGi
split problem) is simplified by depending on a patched fork of grpc-java.

Change-Id: Idb79a5bea8ae0bc57b146bda1fc47a4568d12c60
2018-08-13 18:51:36 +00:00
Ray Milkey
4867af2f9c Revert "Tagging 1.14.0-b1"
This reverts commit 78ce40093ac008fd6d169ab83d2d5961f91f6e31.

Change-Id: I8482f550c30f75d65333f6be9c9115a930abc56f
2018-08-10 16:53:10 -07:00
Carmelo Cascone
4164436785 More p4runtime-related bazel build files
Change-Id: Icdd02a06d7905e4cd0a6c61d282fd522c7b75fe7
2018-08-10 18:42:44 +00:00
Ray Milkey
78ce40093a Tagging 1.14.0-b1 2018-08-10 11:16:44 -07:00
Carmelo Cascone
72893b7755 [WIP] Attempt at building grpc and p4runtime protocols with Bazel
STILL NOT WORKING AT RUNTIME

Change-Id: I1f9e60b12a12e09edad2a714ec2921a4f71c6d35
2018-08-09 20:33:39 +00:00
Jian Li
d486a73352 Support to build openstack related apps using Bazel
Change-Id: Ibc9f43a8fd92bb41b162a88a1eb3e8c8c5ad990a
2018-08-05 08:53:02 -07:00
Ray Milkey
3077358d1a Bazel build for the combined GRPC runtime jar file
Change-Id: I76ff5f1b81a0985cb45c70c8f63640668207cd4e
2018-08-03 16:04:05 +00:00
Carmelo Cascone
58136816ab ONOS-7739 Support for P4Runtime multicast programming
Design doc: https://docs.google.com/document/d/13rkQlwr49M-uxQQEuxCMP7BFEPY2gtQ850Hn3gUfesU/edit#heading=h.lzdayib259sq

Change-Id: Ief00bec89fe5a9784b0ee13fdaafa3ae58ab654f
2018-07-20 18:16:17 +00:00
Carmelo Cascone
f645e8406c Bump P4 tools to latest version
With support for P4Runtime multicast API

Change-Id: I6982c32187204b656a927d0f3d7f3a4b1b877e75
2018-07-16 20:31:32 +00:00
Carmelo Cascone
7044efd07e More bugfixes in P4Runtime subsystem
- NPE when removing agent listeners
- Don't block netcfg event dispatch thread on GDP
- Avoid unnecessary warn logs during disconnection in GDP

Change-Id: I612f7f7914579eea9ba393e952377a3933d92e8d
2018-07-06 13:01:36 +02:00
Carmelo Cascone
158b8c4f6b More improvements and bugfixes in P4Runtime subsystem
Most notably, we fix a bug in which some nodes were not able to find
pipeconf-specific behaviors for a given device. The problem is not
completelly solved but it's mitigated.

There's a race condition caused by the fact that the GDP updates the cfg
with the merged driver name before advertising the device to the core.
Some nodes might receive the cfg update after the device has been
advertised. We mitigate the problem by performing the pipeline deploy
(slow operation) after the cfg update, giving more time for nodes
to catch up. Perhaps we should listen for cfg update events before
advertising the device to the core?

Also:
- NPE when getting P4Runtime client
- Detect if a base driver is already merged in pipeconf manager
- Longer timeouts in P4Runtime driver and protocol (for slow networks)
- Configurable timeout in P4Runtime driver and GDP
- NPE when adding/removing device agent listeners in P4Rtunime handshaker
- Various exceptions due to race conditions in GDP when disconnecting
devices (by serializing disconnect tasks per device)
- NPE when cancelling polling tasks in GDP
- Refactored PipeconfService to distinguish between driver merge,
pipeconf map update, and cfg update (now performed in the GDP)
- Fixed PipeconfManagerTest, not testing driver behaviours
- Use Guava striped locks when possible (more memory-efficient than maps,
and with strict atomicity guarantees w.r.t. to caches).

Change-Id: I30f3887541ba0fd44439a86885e9821ac565b64c
2018-07-06 08:13:44 +00:00
Ray Milkey
dbd3821cf0 Checkstyle rule to prevent throwing the generic RuntimeException
This is a frequent cause of sonar breakage.

Change-Id: I54e0044447633a61bab560b020b57ed0a6875ebe
2018-07-02 18:03:00 +00:00
Carmelo Cascone
e5b2872eb6 Improve scalability of P4Runtime subsystem
The P4Runtime client was hanging (deadlock) on a master arbitration
request. As such, all other requests (e.g. table write) were waiting
for the client's request lock to become available.

Apart from fixing those deadlocks, this patch brings a number of
improvements that all together allow to run networks of 100+ P4Runtime
devices on a single ONOS instance (before only ~20 devices)

Includes:
- Asynchrounous mastership handling in DevicHandshaker (as defined in
the P4Runtime and OpenFlow spec)
- Refactored arbitration handling in the P4RuntimeClient
to be consistent with the P4Runtime spec
- Report suspect deadlocks in P4RuntimeClientImpl
- Exploit write errors in P4RuntimeClient to quickly report
channel/mastership errors to upper layers
- Complete all futures with deadlines in P4Runtime driver
- Dump all tables in one request
- Re-purposed ChannelEvent to DeviceAgentEvent to carry also mastership
response events
- Fixed IntelliJ warnings
- Various code and log clean-ups

Change-Id: I9376793a9fe69d8eddf7e8ac2ef0ee4c14fbd198
2018-06-29 13:59:27 +00:00
Carmelo Cascone
44448a52cc Allow re-creating clients for the same P4Runtime addr-port
Change-Id: Ib3de10d047f52dd28511e71385773d4b4a9ad74f
2018-06-26 12:23:29 +00:00
Ray Milkey
1f9e7dc1fe Fix maven build of P4 models
Change-Id: If7ed98261a1f3a18ea752e7ce401d155085650f3
2018-06-15 13:37:33 -07:00
Carmelo Cascone
6af4e17c53 Bumped supported revisions of P4 tools
Includes:
- Use new P4Runtime "v1" package names
- Removed VALID match
- New table entry priority spec (1 is min priority, not 0)
- Fixed p4c-bm2-ss to include arch flag
- Re-compiled P4 programs with more recent p4c (with updated p4info)

Change-Id: I05908f40eda0f0c755009268fd261fb8bcc9be35
2018-06-15 19:04:30 +00:00
FrankWang
2674e45220 Introduce Pi Register model to PI Framework
Change-Id: I7fae87d5b5ed5fff34b3addfc148cee6fc98137c
2018-06-13 13:00:50 +00:00
Yuta HIGUCHI
08392f45ec Fix gRPC dependency
Change-Id: Iddebec60218b555d8ffe39fcabd3daad0b776218
2018-06-09 07:15:37 +00:00
FrankWang
ea70de3094 [ONOS-7602]Implement support for P4Data in PI framework and P4Runtime southbound
Change-Id: I9c0c76fb29b8c3aa36f39bde62e825f0f0094253
2018-06-08 09:04:50 +00:00
Andrea Campanella
1e5734480f [ONOS-7584] Adding Capability of re-connecting to a P4Runtime Device.
Also addresses ONOS-7359

Change-Id: I47ec4ed429af82feb225ab5ac180b94c91366a53
2018-06-08 02:14:33 +00:00
Ray Milkey
a8cf59e03a move osgi_feature() and wrapped_osgi_jar() out of the bazel prelude
Change-Id: I0266ab4dbf0d0845ccbd940f2d0d3b230bd55260
2018-06-07 16:35:10 +00:00