1045 Commits

Author SHA1 Message Date
Miguel Borges de Freitas
89e3d23d2b [P4Runtime] Make sure write requests contain the codec failure reason
The submit() method of p4 WriteRequestImpl is returning an empty
response if there are no update messages. However, one of the reasons
for updates to be empty is the fact the catch block in
appendToRequestMsg is reached due to some invalid usage of the p4runtime
contract. In such situations, not only the user doesn't know why the
request is failing (absence of logging in ONOS) but the responseBuilder
which contains the failure is also not propagated. As a result, a future
call to P4RuntimeWriteClient.WriteResponse.isSuccess() will return
true (as if the request actually succeeded) and .all() will also not
contain the failedResponse appended during the CodecException. Added a
test to illustrate the issue.

Change-Id: I0acfd3b34b3ed1db2d91f91fed08f9d00800dda4
2021-10-26 17:52:13 +00:00
Miguel Borges de Freitas
3daf7cef74 [OVSDB] Fix ovsdb passive mode connections
Currently ovsdb passive connections are broken. This happens because the
eventloop is never initialized. As a result, in connectRetry() (called
in connect()) the workerGroup is null and the connection to the switch
can't be established.

Change-Id: Ic20a3f699e49f119bd2ba6edb6eb8ad94ba09009
2021-10-25 13:14:00 +00:00
Andrea Campanella
18fdda8cb8 [VOL-4343] Processing status of ports in order with mastership and connection/disconnection to avoid inconsisten state
Change-Id: I731866b358fd4b6a7cfd296051e11f3d8690c5a7
(cherry picked from commit b0b93ac609e7860d5fd15703a50a0180fbf7a176)
(cherry picked from commit 727ed68ed3edc4512e353af814abe327ee25f143)
2021-09-20 07:18:54 +00:00
pierventre
c0914ec586 [SDFAB-500][SDFAB-527] Meters cleanup and leftovers
- Improve ONOS cli enabling CRUD of p4rt trtcm
- Improve ONOS rest enabling CRUD of p4rt trtcm
- Improve MeterService with scope defined reads and integrate in cli/rest
- Add support along the stack for BYTE_PER_SEC unit
- Add support along the stack for COMMITTED and PEAK bands
- Fix several bugs in ONOS cli/rest interfaces
- Improve REST codecs
- Fix NPE in MeterDriverProvider
- Improve PiMeterTransalation by enforcing trtcm config
- Implement explicit translation of the bands
- Fix ONOS reconciliation by removing from the mirror the wrong configs
- Remove unnecessary checks in MeterEntryCodec
- Update unit tests

It will follow a 2nd patch to complete SDFAB-527

Change-Id: I855235b17f60cb1d39f5b9a042c1015105a8a269
2021-09-10 10:22:18 +00:00
Wailok Shum
221d70dc4e [SDFAB-453] Add a field check to MeterEntryCodec
Change-Id: I4c59c9d45f3128a7d75661fa432bfb33336965aa
2021-08-24 01:40:09 +08:00
Wailok Shum
6d42cff6bc [SDFAB-354] Improve P4RTMeterProgrammable
Change-Id: I65a325f90a49853c6c4a1cfb8212a016a8ec2b2d
2021-08-24 01:33:04 +08:00
Wailok Shum
9664209358 [SDFAB-356] Extend P4RuntimeMeterProgrammable and Codecs to support reset scenario
Change-Id: Ifad0b296568d3f78b2aa792fa63f2f81fa80ebae
2021-08-06 17:28:50 +08:00
pierventre
8e489de27f [SDFAB-271] Change the default max inbound metadata size for grpc channels
The default size is set to 8KB which can be easily exceed even by batch
of 100 flows. When this happens ONOS closes the channel as consequence
of the HTTP2Exception thrown by Netty. With this patch we set the size
to 40MB which should avoid any problem even with batch larger than 100k
flows.

Change-Id: I3f1ccbf20275898798e039531d1871991d99d952
(cherry picked from commit cf5dabd3dd6b1a94fb718da6fe8d5e95ef1e5479)
2021-07-01 18:13:18 +00:00
Daniele Moro
d900fe4a87 Add support for one shot action profile programming in PI
A P4 table annotated with @oneshot annotation can be programmed
only with the action profile action set. For these kind of tables
we don't issue read request for action profile groups and members.

Change-Id: I7b6a743f4f4df4190f17d958ebb4807aca5feda5
2021-07-01 17:34:35 +00:00
pierventre
f92de5130a [SDFAB-98] Improve logging in several ONOS subsystems
Change-Id: Ic9a20af6da27c3cc5c219657f10999f6804b9334
2021-05-25 07:29:49 +00:00
Daniele Moro
53a3cdfb82 Ensure P4Runtime byte strings are padded to their bit width
The P4Runtime server may send canonical byte strings (i.e.,
non-padded byte strings).
In ONOS we ensure, in the codecs, that all byte strings are
padded to match the model (P4Info) bit width. In this way,
we provide read-write symmetry inside ONOS.
ONOS always pads byte strings when sending messages to the
P4Runtime server.
This patch doesn't enforce read-write symmetry between
P4Runtime client and server on the wire.

N.B.: the current padding implementation works ONLY when
using non-negative integer.

Change-Id: I9f8e43de015bd0929dd543d7688c8e71bf5fe98d
2021-05-18 15:58:44 +02:00
Daniele Moro
7aa13e6898 Allows to specify matches, action parameters as strings in PI
Some PI elements can encode in their value a string (e.g., when
a P4Runtime translation is used), for this reason we allow users
to specify matches and action parameters as strings.
From southbound, during decode, we interpret the elements as
string if the P4 model suggests that.

Change-Id: I5884de1500437ab647abc200d65de442e23bd1a8
2021-05-18 12:51:24 +00:00
Anurag Chadha
4673237526 [ONOS-8139]Private SSH Key File Path made configurable for passwordless netconf ssh connection
Change-Id: I3a3d991dcd2f458acad2cc98f10543b697440fb3
2021-05-10 17:32:59 +05:30
pierventre
219dd8fedf [AETHER-1550] Add additional trace logs in P4RT SB
log:set TRACE org.onosproject.p4runtime.ctl.client.WriteRequestImpl
to have all the prints we need

Change-Id: Ie46e36145769ffc7a91485ee3f3791a94cf8b8a9
2021-04-30 04:33:42 +00:00
Anurag Chadha
b6a6bcbe12 [ONOS-8137] Bug fixed for driver not found in case of ipv6 address being used in short notation
Change-Id: I8fd0922eb2cce98ecb5612979f0554ac2281351b
2021-03-29 18:27:17 +00:00
Daniele Moro
2375917830 Add support for arbitrary bitwidth packet metadata
This patch is related to #24172

Change-Id: I29fc82bd3944b7fc9f58021df56cadd209cac190
2021-03-01 17:57:36 +00:00
Daniele Moro
298d326e35 Fix bug when reading table entries
Check if table has counter only if not all tables wildcard read.

Change-Id: I1a15e578bb55eaaf0b1ce4e1c509a6ec0334292b
2021-02-17 23:00:07 +00:00
Daniele Moro
46b27630d4 Add support for all tables wildcard read in P4Runtime
This is required for targets that are not P4RT-compliant
and do not support table-specific wildcard reads.
The all tables wildcard read are activated via
tableWildcardReads driver property.

Change-Id: I675e6f876648ad7634ea0a13ecf44aa366739d3f
2021-02-11 16:52:57 +00:00
Daniele Moro
c6f2f7f3c5 Add Optional match fields support to PI subsystem
Change-Id: Ic458f59cab98340e40c04a0ad060d3c725ac5dbb
2021-02-05 19:03:05 +01:00
Carmelo Cascone
304b6644a1 Add digest to P4InfoBrowser
Change-Id: Ie79b61d2ecfc5a52c8b027a5384b86a555623db7
(cherry picked from commit 08be25533d09c3ba8023f4d34e07f4555d6013aa)
2021-02-05 18:02:04 +00:00
Daniele Moro
f178b0a5ad Add tests for codecs and P4Info parser when P4Runtime Translation is used
Change-Id: Ied0e83e81dad29f5b250548d2e26ec960b98f560
2021-02-05 18:00:09 +00:00
pierventre
69329170ad [AETHER-1104] Calculate PiPipeconf fingerprint in a deterministic way
New master after taking over a switch was pushing again the pipeline
and all the flows and groups. This was happening because DefaultPiPipeconf
fingerprint was not calculated in a deterministic way across the cluster.

This patch introduces the following changes:
- Implements toString method in each abstraction representing a pipeline
- Hashes the p4Info file to generate a consistent hash of the pipeline model
- Uses a sorted collection to generate a consistent hash of the extensions

Change-Id: I792283b0a9b821284add36b3aba52843f33527c3
2021-01-21 21:55:24 +01:00
pierventre
1a833d4c85 [AETHER-1074][AETHER-1088] Missing Kryo classes in several subsystems
This was leading to not proper replication of the state
and some EC maps being empty

Change-Id: Id39660c2ce3b5507e796801c0213c194f0a2009a
2021-01-19 16:47:27 -08:00
Charles Chan
730d546f05 Add debug log in P4RuntimePipelineConfigClient
Change-Id: Ie71af2f80b12b8ad99c8f597af1c3f026a532c4b
2021-01-19 16:47:21 -08:00
Anurag Chadha
924f01f31f [ONOS-8129] Bug fixed for duplicate events when netconf device goes down along with some fixes for NPE in NetconfControllerImpl
Change-Id: I4ea6100ce4c4e56ff8219cf846f107f49c50cd2d
2021-01-08 00:54:25 +00:00
Daniele Moro
5c82b0fb37 Support arbitrary bit width action parameter and match field
This commit goes into the direction of supporting user-defined types in P4Runtime.
The modification is focusing on supporting fields and params with arbitrary bit width, that is the
case of using a String with the p4runtime_translation annotation on the user-defined type.

Change-Id: I7db7a6d97211378ff78ab4f1b3734a0bec4558e6
2020-12-15 17:50:10 +00:00
Jian Li
a56dea6ecd Support to enable multicast snooping of ovsdb through bridge desc
Change-Id: Ia14e67ab3a5a734a8a0eaa0b7bdda2fc9429c905
2020-12-12 10:21:02 +09:00
Carmelo Cascone
7981d09ab6 Extract and publish p4runtime protocol utils in separate artifact
For consumption by third-party apps built via mvn

Change-Id: Ic9c1eccb2519b2952cdb632e1f07ccefbba00396
2020-12-04 15:58:31 -08:00
Andrea Campanella
fb362174e1 [ONOS-8130] Correct and cosistent access to message-id counter in NetconfSessionMinaImpl
Change-Id: If27435c5ff9e1855696246326243eabe92a20335
2020-12-04 14:06:18 +01:00
Andrea Campanella
9ef930aa75 Offload OF Port Status message processing to a single thread executor.
This avoid processing Port Status messages in the same thread of the channel read
avoiding blocking the processing if too many messages are received at once.

Change-Id: I397723d621f69fbac9478f4f3d91a277d17cfa28
(cherry picked from commit dad65ac5a058242326fe91fbe47e65fa9c5a3583)
2020-11-11 19:06:10 +00:00
Thomas Vachuska
84d9fac856 Pruned defunct and unused contributions from Huawei
Change-Id: I8f1c611682e0f282bc41eb7a4ff4ff23b91a48e5
2020-09-03 16:09:36 +00:00
Ankur Aggarwal
2d7ff64d09 [ONOS-8085] Route Refresh timers in Controller
- Add timers in BgpController
- Add triggers in BgpLocalRib
- Code to send Route Refresh messages

Change-Id: Id45f1bcb3325ccc21c0d0d2e673c2b0097aac552
2020-08-11 09:50:59 +00:00
Anurag Chadha
8a9feb5716 [ONOS-8111]Fix for passwordless ssh to netconf device without sshkey
Change-Id: I7bedb4c1463024d359b641b24a2089c909e6f03e
2020-07-31 08:59:19 +00:00
Thomas Vachuska
c6ea647501 Revert "Introduced SetPackage and SwitchControlProcessor RPC to gNOI implementation."
This reverts commit 992bf52f25d491afec8d8e54efb5c3a8125b77bb.

Reason for revert: Broke the master build.

Change-Id: If47508a8cff95bd6e9c57f7234baa517879a54cf
2020-07-30 23:24:24 +00:00
Serhii Boiko
992bf52f25 Introduced SetPackage and SwitchControlProcessor RPC to gNOI implementation.
Change-Id: Ib8df537459b50bb83fadfe217e6ea5cd2bf6da5f
2020-07-30 19:44:19 +00:00
Ankur Aggarwal
bd6fc428c3 [ONOS-8082] and [ONOS-8083] Route refresh changes
- Added Route Refresh message
- Changes in BgpFactory
- Add parsing for Route Refresh Capability TLV
- Add Unit Test case for Route Refresh message

Change-Id: I68efe55be50c545b06c99a099c4bc315b2d5f566
2020-07-30 13:10:33 +00:00
Ankur Aggarwal
9deda616b7 [ONOS-8084] Changes to Bgp Cfg
- Added route refresh params to BgpCfg
- Added default values and value checks

Change-Id: I835fd9bbcb6d0c627c216d98ac84fdb65d98eea8
2020-07-30 12:54:04 +00:00
Carmelo Cascone
df79459af1 AETHER-452 Read P4RT counters only if table supports them
Before, we were reading counters from all tables, even from those that
didn't have any. That was causing certain P4RT implementations to
return error.

Change-Id: I028ecaca46ddc0c9afc16b78ba7754f943a2717b
(cherry picked from commit d172435433e19b10eb6b320823428e67f6205e8a)
2020-07-17 19:13:29 +00:00
Anurag Chadha
01ab40a03a [ONOS-8106][ONOS-8107] Fix for netconf ssh session not initiating when a node goes down in cluster
Change-Id: If9c3208a299d8dfde763115cb873aba00fc35ef6
2020-07-13 16:17:54 +05:30
Andrea Campanella
fbec099737 [ONOS-8098][VOL-3128] Implement multipart PORT_DESC processing in ACTIVE state
Change-Id: Icb82a0856ca0388ee27151d3a90e50a07e49965a
(cherry picked from commit f9a5ecb69b239dd04f8923b8dc8a6b764b405f90)
2020-05-28 16:10:24 +00:00
Shibu Vijayakumar
a0565191f0 Flow stats collection optimization - Flag introduced to stop periodic collection and collect only in 3 scenarios (Flows Add/Delete/Mod, Switch Add/Change, Mastership Change)
Change-Id: I1ad143a416f34135a622818c60dbc97310fe905e
2020-03-27 11:48:31 +00:00
Yi Tseng
9619d8087a Add gNMI-based ODTN driver
Change-Id: Ic1df82797ee9f60956f46f4c3431e8c74f4548b2
2020-03-23 20:12:48 +00:00
Ankur Aggarwal
32c9696d28 [ONOS-8073] Fix for : BGP Open message keeps only last "Optional Parameter"
- Create an inner linkedlist and add that to the main Linked list of capabilities

Change-Id: I42e87d4fd3949d13ebacc36dd83682365b4cbdd8
2020-02-27 16:38:37 +00:00
ChinmayaAgarwal
c9decdec5a [ONOS-8036] Unit test cases
Change-Id: I1cbdf7fe0527f7c1cf6982fbca3ec03d8f3c9c9e
2020-02-25 14:41:45 +00:00
ChinmayaAgarwal
a3d7d7e9ca Fix for ONOS Jira Bug 8060
Change-Id: I4d5cf5af4adf343a66d1b752c8d9459dd30e8cdd
2020-02-24 14:38:13 +00:00
Pier Luigi Ventre
d8a923c512 Avoids delete of dataplane state during mastership change
Leftover in the flow stats creates duplicate flow stats entry.
These entries were considered as flows not in the store and thus removed

Additionally adds further guards during the processing of the stats and
updates unit tests

Change-Id: I242009f560660fb572a633f153edf9798256bfd0
2020-02-24 09:48:19 +00:00
Pier Luigi Ventre
3491e761c0 Revert "Avoids delete of dataplane state during mastership change"
This reverts commit 0a4ead65f47bdf8576bb6d4f1605858f2e8f9df4.

Change-Id: I595ac6181cc0b4494a0e2198629d38522f74d86b
2020-02-20 08:05:43 +00:00
pier
0a4ead65f4 Avoids delete of dataplane state during mastership change
Leftover in the flow stats creates duplicate flow stats entry.
These entries were considered as flows not in the store and thus removed

Additionally adds further guards during the processing of the stats and
updates unit tests

Change-Id: Iba07996e1413c54374b7a4ce7efd21109b429eeb
2020-02-20 08:00:21 +00:00
pier
f528effedd Avoids disconnection from the switches
- Restarting the dispatcher during idle events
- Checking, during idle events, if the backlog can be drained
- Reducing the interval of idle events

Does not change the behavior of the state machine

Change-Id: I1721d8fad37e4e833d0fdfd12d51dc51a06559d0
2020-02-04 08:40:23 +00:00
Maciej Skala
3251a30661 Implement BGP Prefix Listener for BGP Controler
Change-Id: I8cbb43df45104e5cfd7dc7aa7225e5bf99a8ee37
2020-01-07 17:28:54 +00:00