1905 Commits

Author SHA1 Message Date
Andrea Campanella
a42a6ab206 Enabling role timeout configuration on the Device Manager
Change-Id: Ie8664189d236431a5f2ee42476d0f99fdfe5f1d7
(cherry picked from commit 32762fa3a3fce3f0cc6d97e9fadca2959080ad08)
2022-06-29 16:42:31 +00:00
Andrea Campanella
3971df8106 [ONOS-8157] Adding port disable during periodic checkeker for device disconnections.
Change-Id: Ie44f2c485446e29ef4c39198e8bfe8461bd13c93
(cherry picked from commit 9f820659064984ca898ffd40083a1a4944097897)
2022-05-02 07:24:21 +00:00
pierventre
13792aa10f Update FlowRuleOperations API
stripeKey now exposes an Optional instead of an Integer

Change-Id: I9a13fcea85ba3e0b52c004ece5a47fc50e99c9d6
2022-04-04 13:14:13 +00:00
pierventre
16ff3291a8 [SDFAB-1100] In-order flowrule processing
Extends the FlowRuleService and its api by adding in-order processing
capabilities. This is achieved by introducing stripe key as way to
indicate how to process the flowrules. Key is an object which is used
to select a specific executor. Operations having the same key is guaranteed
that will be processed by the same executor.

Change-Id: I5ab4d42e8a2b8cb869f3dc2305dbc5084d31f08b
(cherry picked from commit 07af21d9e116414b74152dc812cc980ca2c4c0a5)
2022-03-29 06:46:27 +00:00
pierventre
386f5ca225 [SDFAB-1100] Fix flow removal logic
If the store is already in sync re-issueing a batch
request is dangerous (race with conflictual writes)
and wrong. In this case, if the device is still reporting
the flow, it is enough to send a flow removal directly.

Instead, if the flow is expired it is important to update
the store accordingly and then issue a flow removal as
consequence of the batch request.

Change-Id: I11a595e0a91f0efdc1cac3bf1d589a5108f1ae06
2022-03-24 20:10:24 +00:00
pierventre
14a76e72a7 Improve Mastership logging
Logs only meaningful mastership changes

Change-Id: Ibbe4f85526df01b3c1b6eab317a2c15716098d80
2022-03-03 01:46:40 +00:00
pierventre
d8d4025897 [SDFAB-1006] Purge groups and flows failed
With the persistence mastership in place the stats are no longer
discarded because of the lack of a master. This change introduces
further checks based on the availability. Additionally, it purges
the pending groups map which was leaking memory.

Change-Id: I6b0d127bf9a247d7981871f02847f6e2f4074182
2022-02-25 01:01:28 +00:00
pierventre
bc91cea9de [SDFAB-1015] Introduce gracePeriod and defer mastership check
For some devices like p4rt devices which are first registered
and then updated does not make sense to check the reachability
asap: connection is established concurently to the mastership
checks and the channel might not be ready.

Change-Id: I5a31e09cf382df388a473af338eb72fb9a187fa8
2022-02-25 00:30:01 +00:00
pierventre
0263b62380 [SDFAB-954] Non-leader instance can mark UNKNOWN the pipeline.
The probe task is not performed in atomic way and between the
initial mastership check and the actual probe the execution
can be blocked many times and the mastership can change. Recheck
the mastership after pipeline probe returns.

We are seeing an issue when a network partition occurs: watchdog
is stuck for 60s before returning and will mark the device offline.
However, in the meanwhile the mastership has been passed to another
instance which is already connected and has already marked the device
online. An harmless side effect of this change is that when we return
from the pipeline config we might be no longer the master and this
will delay in the worst case the markonline of the device for 15s
(next reconcile interval)

Additionally, this patch simplifies the Manager by removing the
executor lock and by using only one worker per device. This change
prevents also the exhaustion of all workers than can easily happen
if there is a network partition that prevents the probe to return
immediately.

Change-Id: I3429cd0598c95589e50f35139f6087f83ceb60f2
2022-02-24 23:06:11 +00:00
pierventre
5a91f5fb74 Relax meters translation checks
Change-Id: I1dd3d2c9642ebff28d68425a7bcbc01c4d6a15f5
2022-02-24 22:29:18 +00:00
pierventre
dac2589944 [SDFAB-935] Optimize and improve the p. mastership
This patch is the part 1 and contains the following:
- Make the GDP greedy by reasserting immediately the role

Change-Id: I7259d4ace4a3e58ae2d97b6e53a393c41d5c0df9
(cherry picked from commit d510b7db8aeafbb52b00982dacb1f1079b0cc4b2)
2022-02-17 19:52:49 +00:00
pierventre
2bb50165cd [SDFAB-977][SDFAB-978] Implement persistent mastership logic in ONOS
Design doc can be found here:
https://docs.google.com/document/d/1UStD1hGCy5YQlFmaWfclq6uYROtMY56jWxUBwfUEsRM

Additionally, introduce few more changes in the DeviceManager:
- Always reassert the role if the instance has a valid role
- Test reachability through isReachable and probeReachability

Change-Id: I35183c04b65a98bc0332ed256be8333b53d6b68f
(cherry picked from commit b2f636bffd2783266826503755ba5f42dfdb2b75)
2022-02-17 14:30:37 +00:00
pierventre
b59c51dd4e [SDFAB-933] Integrate atomix-3.1.12 and expose demote API
Additionally, this patch adds unit tests for demote and
updates a bunch of testing tools

Change-Id: I9636078b08486c9167ae253f0251f72239ad2802
2022-02-15 17:05:26 +01:00
pierventre
81a2cb9c49 Fix ONOS CI by removing the usage of getRegisteredApps
getRegisteredApps is deprecated and it has been discontinued

This patch partially reverts:
- https://gerrit.onosproject.org/c/onos/+/22325
- https://gerrit.onosproject.org/c/onos/+/22362
- https://gerrit.onosproject.org/c/onos/+/22382

Change-Id: I652d814a006709bd40a673699697ba229955b0e4
2022-02-01 19:12:11 +00:00
Yi Tseng
8c79f3f7e3 New PiInterpreter API to map logical port to long type
Introduce a new API for PiInterpreter to map logical port number to a long
port number and deprecate the old one.
The reason we need to translate logical port number to a long type is that
the mapped number will become negative when translating port number to
an unsigned integer with MSB (e.g., 0xFFFFFFFD) and the low level driver
or translator is expecting to get a positive number.

Change-Id: I751e69461b0cf97280f12fd98ca2b15b83cbe84f
2022-01-26 14:55:13 +00:00
pierventre
7768d7f49d [SDFAB-887][SDFAB-893] Missig flowrules in the ECFlowRuleStore
Mastership changes can happen during the processing of the flow rules stats,
If there is no master while we are executing handleExistingFlow we will get
null when we try to retrieve the stored flow rule. This is wrongly handled
with the removal of the flow rule from the store which will cause lost
of connectivity. This patch basically removes the flow rule only when we are
sure of what we are doing, when we are not the code verifies if there are
proper conditions to continue the processing (check if there was a mastership
change).

Additionally, this patch improves the logging of the ECFlowRuleStore

Change-Id: I7b79e7ab3d8ccfa6edca6ba4ad5de93ada082265
2022-01-12 19:55:49 +00:00
Charles Chan
f5c6f28e9e Avoid probing hosts on non-existent or disabled ports
- All ports that has a subnet configured in netcfg will be used for probing
- A port may not exist on the device even if it's configured in interfces
- A port will never be added to the edge port list if it is never enabled
If a port meets both conditions above, it will fail the isEdgePort check and produce repeating warning messages.
This patch explicitly avoid probing on non-existent or disabled ports

Change-Id: I5cc5f32d4b2ff9fc00729e0adddbede29fb49ca0
(cherry picked from commit a618d74a7596633d666679f709a853d374fe2cb9)
2022-01-06 23:27:05 +00:00
Thomas Vachuska
b7f12e63c2 Changing version to 3.0.0-SNAPSHOT
Change-Id: Iff0e25fd1e3928b182a21352c17685aea4034f4e
2022-01-05 20:13:10 +00:00
Ray Milkey
95f124892c Starting snapshot 2.8.0-SNAPSHOT
Change-Id: I7a38cdc0ef1f51458c2605f59aca6221fc0320f9
2021-12-17 10:20:32 -08:00
Andrea Campanella
6a3ee34b6b [ONOS-8151] Re-send request for flow removal in case the flow is in PENDING_REMOVE and the stats report it.
Change-Id: I4e46f102a0a1a341ccfaff968207378ce30b9144
(cherry picked from commit 321f75a794dd8d8524209172c980f172a35d547f)
2021-12-15 08:20:28 +00:00
pierventre
4af4879dec [SDFAB-821] Implement auto-recovery mechanism for failed mastership changes
With this fix the ONOS cluster will start a new term if the mastership is not
acknowledged by the device after 10 seconds.

Change-Id: Id0927181e4ba37ed1af52dd9843d4c2563469025
2021-12-08 17:29:43 +00:00
ONOS Jenkins User
844bc4e061 Starting snapshot 2.7.0-SNAPSHOT 2021-12-01 17:50:52 +00:00
ONOS Jenkins User
1d51166bfe Tagging 2.7.0-rc1 2021-12-01 17:50:46 +00:00
David Glantz
dfb3ceb78d Return intent collection with details
Added backwards compatible flag to GET /intents/ to return full intent JSON.
Added GET /intents/application/{appId} to return application specifc intents.
Extended IntentService to include getIntentsByAppId(appId).
Removed hard-coded intent codec lookup in IntentWebResource.

Change-Id: I38e7b1dbd7669e654afe723f6ec3a4eb7a9af6fb
2021-11-07 09:18:19 +00:00
pierventre
f9a00a5ce0 Fix npe during hostVanished handling
java.lang.NullPointerException: null
	at org.onosproject.net.host.impl.HostManager$InternalHostProviderService.hostVanished(HostManager.java:573) ~[?:?]
	at org.onosproject.provider.netcfghost.NetworkConfigHostProvider.removeHost(NetworkConfigHostProvider.java:189) ~[?:?]
	at org.onosproject.provider.netcfghost.NetworkConfigHostProvider$InternalNetworkConfigListener.event(NetworkConfigHostProvider.java:274) ~[?:?]
	at org.onosproject.provider.netcfghost.NetworkConfigHostProvider$InternalNetworkConfigListener.event(NetworkConfigHostProvider.java:222) ~[?:?]
	at org.onosproject.event.ListenerRegistry.process(ListenerRegistry.java:66) [!/:?]
	at org.onosproject.event.impl.CoreEventDispatcher$DispatchLoop.process(CoreEventDispatcher.java:198) [!/:?]
	at org.onosproject.event.impl.CoreEventDispatcher$DispatchLoop.run(CoreEventDispatcher.java:180) [!/:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]

Change-Id: If6e3978798d5fb11b3f5b1344b551b9f3cd3e51d
(cherry picked from commit 3a615560678cb83fa41f393fa59c346cdae659e2)
2021-10-27 07:19:34 +00:00
David Glantz
8ad1da90c4 Log exception message when intent compiling fails
Change-Id: Ied046c31e512504b45ba92023996d400574d5128
(cherry picked from commit c4d6a7ce658d595d9c8d1c270cf5f469c1d3e1b7)
2021-10-18 13:49:57 +00:00
David Glantz
0a5779c775 Fix to reinstall flow rules when they are missing in FlowRuleService.
Change-Id: I1e7e0d62e27012cd090f3a72eb92eadc85afafdf
(cherry picked from commit 5c7fe3acf43bf1304038a7be55a5fd45e5805396)
2021-10-14 13:24:36 +00:00
pierventre
b885685722 [SDFAB-642][SDFAB-643] Fix device disconnection when an instance rejoins
Changes in the GDP are done to make sure the default availability is always
updated through the two step process defined in the provider and to prevent
the disconnection of the devices when an instance rejoins the cluster

Finally, the patch improves logging inside the GossipDeviceStore and improve
the stability of PiPipeconfWatchdogManager by getting rid of the timer and
timer task and by executing the event listeners inside an executor.

Change-Id: Ibc6ce711e15e86bde05dbf3b1c37d2a93516fae3
2021-10-07 22:21:51 +00:00
David Glantz
77e18553fb Remove logic to create a link when network configuration is added.
Change-Id: I9e26308c0f5ce9c5b70ccdbc37d97e4f480ff227
(cherry picked from commit a4d40f37bfd342c64595fea6c7357d303dd55870)
2021-10-01 13:21:46 +00:00
pierventre
7e41399499 [SDFAB-612] Cluster not ready when using recent tost master images
There is no guarantee that the HostProbingProvider is already
registered before setDelegate is called. This patch prevents
npe caused by events delivered before the provider is ready

Change-Id: I8612a3b156e342752d1ade9ee1d7d786ad53cc9e
(cherry picked from commit e84b2e8081ea40ff06eaa1b119c6e22cfcf9459d)
2021-09-27 19:26:35 +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
5d64c56dc1 Protect event handler from the exceptions
Change-Id: I8c7b68f4eff1460e02dd4cc01b7d655a5d7ad581
(cherry picked from commit 6bfdeb3215247561313a083d4131fc77d9c3792e)
2021-09-16 16:48:03 +00:00
pierventre
26ac1517c4 [SDFAB-542] Meters cleanup and leftovers v2
- Code clean up (unused code, unuseful comments)
- Remove deprecated internal APIs
- Prevent the ejection of the meter pollers
- Prevent the ejection of the mf pollers
- Fix unproper filter of device events
- Fix delete on store which updated existing meters with dummy value
- Fix NPE in TofinoMeterProgrammable caused by default config
- Update unit tests

Change-Id: Ib2767e3ab3cf146693e61b7e1890419c9743d521
(cherry picked from commit a770879a950d1cc985db1a659da701551700e886)
2021-09-16 16:13:33 +00:00
Matteo Scandolo
1bd07c8b6c Fix issue with multiline comment in OSGI properties
If a component property as a multiline comment the app activation
will throw an exception and no property for that component would be initialized.

This patch address that in two ways:
- Make sure that if we cannot parse a line from cfgdef the other properties are enabled and logs a warn.
- Changes the onos-maven-plugin so that it removes new lines when generating the .cfgdef file

Bumping version as plugin is already published from onos-2.5 branch

Change-Id: I550c23624118782fe6d79c9abbaf75ae59ea0eab
2021-09-15 15:45:11 -07: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
pierventre
3b39bd8562 [SDFAB-500][SDFAB-499] Implement user defined index mode for the meter service
- Introduce a boolean to control the meter service modes
- User defined mode does not provide any coordination to the apps
- Only one mode can be active at time
- In addition some sanity checks are peformed by the meter service
- Update existing unit tests and add new ones to test the new behaviors
- Initial clean up of the meters subsystems

Change-Id: I61500b794f27e94abd11637c84bce0dbb2e073f3
2021-09-02 10:50:26 +00:00
Wailok Shum
79919528c8 [SDFAB-355] Revisit MeterService and north abstractions
Change-Id: I685cb90d53f8aa61017ecda9fa7ff842e58e2940
2021-08-24 01:31:51 +08:00
Daniele Moro
06aac70fd2 [SDFAB-359] Purge all objective for a given application ID
Change-Id: I51847b0be890deacec5caddc18d52bcd2993959a
(cherry picked from commit 607fd0b70e4553226d0937d36de9cde655f2eb62)
2021-08-06 15:01:17 +00:00
Daniele Moro
43ac289464 [SDFAB-359] Allow purging flows, groups and meters by device and application ID
Change-Id: I5e507d230789979ac997dbc99697fa0483363f70
(cherry picked from commit cfd774018c0ed926873b1e171c106217cb2ac568)
2021-08-06 14:13:38 +00:00
Wailok Shum
f013a7852b [SDFAB-352][SDFAB-353] Retrieve MeterFeatures from the P4RT southbound, Extend MeterProviderService and revisit MeterStore
Change-Id: If0dae53643988cb551ff5020abd792cb6d33ff6b
2021-08-05 00:32:55 +08:00
pierventre
121ea29ece [SDFAB-379] Optimize the resource usage of the L3 unicast groups
This is achieved by translating SIMPLE next objective into
INDIRECT groups. By default SELECT groups are always used
which has as side effect the creation of action profile groups
with the maxGroupSize derived from the action profile model.

Instead, PiGroupTranslator sets always to 1 the maxGroupSize
of action profile groups derived from a INDIRECT groups which
allows us to achieve a better scale for target devices pre-allocating
memory according to the maxGroupSize.

Change-Id: I7079a99ca9a7474eafae7f258da06770453b05f9
2021-08-04 09:03:36 +02:00
Yi Tseng
29b4f22e8b Add truncate instruction and support it with PI framework
To support truncate by P4Runtime clone/mirror session, we need to pass the
truncate size/length from ONOS northbound to the southbound.
As discussed in the SDFabric syncup, we decide to pass this information via
the instruction in group bucket so applications or pipeliners can simply
reuse current APIs.

Change-Id: I15cc822b7c8008b6b9f8b02f3f399769ae396ef0
(cherry picked from commit 9f94a13bf5695996708eedc17166b5b09308147f)
2021-08-02 20:27:20 +00:00
pierventre
52ef933d5e [SDFAB-20] Prevent listeners ejection and the stop of the group polling
Offload listeners processing to external executors to prevent
the listener ejection due to time consuming processing

In future, we may want to extend the same fix to the
HostManager and NetworkConfigHostProvider

Additionally, avoid the propagation of the exceptions in GroupDriverProvider
which leads to the cancellation of the peridioc poll task

Change-Id: I8ea4ec9fda1ccc48bbd3855fd443ee8760cbbb60
2021-08-02 16:57:11 +00:00
pierventre
df29dc7117 Unset proper delegate on InOrderFlowObjectiveManager deactivate event
Change-Id: I59768e2de6876ffb5d48a9cd59a8ab66c0191e01
(cherry picked from commit 10c9cc418562f2deece03edc942eac2d0a22805d)
2021-08-02 16:11:30 +00:00
Ray Milkey
3b7fa577da Starting snapshot 2.7.0-SNAPSHOT
Change-Id: I20289f264e33b99e8ef073a8e6384857383a4e65
2021-07-13 15:43:39 -07:00
ONOS Jenkins User
a01cc5b324 Starting snapshot 2.6.0-SNAPSHOT 2021-07-13 21:41:25 +00:00
ONOS Jenkins User
b72d6961d4 Tagging 2.6.0-rc4 2021-07-13 21:41:19 +00:00
ONOS Jenkins User
bc990cbfc9 Starting snapshot 2.6.0-SNAPSHOT 2021-07-13 21:02:24 +00:00
ONOS Jenkins User
4dbcd7f53d Tagging 2.6.-rc4 2021-07-13 21:02:19 +00:00
ONOS Jenkins User
95d1465424 Starting snapshot 2.6.0-SNAPSHOT 2021-07-01 19:25:42 +00:00