155 Commits

Author SHA1 Message Date
Carmelo Cascone
4d8785b5b1 First stab at BNG support in fabric.p4
This implementation is derived from Deutsche Telekom contribution:
https://github.com/opencord/p4se

It supports basic upstream and downstream termination based on double
VLAN tags and PPPoE, including counters and downstream metering.

Change-Id: I940959f2338d7319654cf665f6cfe2de7200616b
2019-06-11 17:20:23 +00:00
Carmelo Cascone
9b607dab1c Update P4 programs to compile with most recent p4c
Change-Id: Iced2e9af53dca2dcfd4e6a5de22a45241c264886
(cherry picked from commit 040d6d8c748b6399b74b56abde5894d254eb6383)
2019-05-17 20:46:03 +00:00
Carmelo Cascone
75a9a8958e Trigger pipeconf deploy right after registration
Without waiting for the next pipeconf watchdog periodic probe.
To support this, this patch extends the PiPipeconfService to advertise
pipeconf registration events.

Change-Id: Ib44f1813bd37083c666a5e7980de320ce469c2d2
2019-04-23 19:39:56 +00:00
Carmelo Cascone
33f36a0ec7 Clean up PipelineInterpreter API by removing ambiguous methods
Such as mapping from PiMatchFieldId to Criterion.Type. This should not
be required since the only translation happening is from north
(Criterion.Type) to south (PiMatchFieldId).

Change-Id: I204e0bd66b3996fd60bc11d4241e8a0408e11582
2019-04-18 05:55:06 +00:00
Carmelo Cascone
3032b87e07 Fix missing IPv6 table size in fabric.p4
Change-Id: Ic5af848958e9692087b873f9248eac093b2b463a
2019-04-15 20:34:20 +00:00
Carmelo Cascone
c2be50a804 Allow sharing the same gRPC channel between clients
This change introduces a refactoring of the gRPC protocol subsystem that
allows the creation of a gRPC chanel independently of the client, while
allowing multiple clients to share the same channel (e.g. as in Stratum
where we use 3 clients).

Moreover, we refactor the P4RuntimeClient API to support multiple
P4Runtime-internal device ID using the same client. While before the
client was associated to one of such ID.

Finally, we provide an abstract implementation for gRPC-based driver
behaviors, reducing code duplication in P4Runtime, gNMI and gNOI drivers.

Change-Id: I1a46352bbbef1e0d24042f169ae8ba580202944f
2019-04-11 23:14:41 +00:00
Carmelo Cascone
1c8a4ede3d Give priority to instructions over meta when generating next_vlan rule
Change-Id: I3cfbf0bef788b8a6cffaf9e58f740a83d4b18020
2019-04-09 06:48:36 +00:00
Carmelo Cascone
70e816b05a Support compiling fabric.p4 with arbitrary table sizes
By using preprocessor macros. Also, change expected location of tofino
compiler outputs when building the pipeconf.

Change-Id: I98ea95b61d57e725c88e52a3bfd95618f3c407cb
2019-03-22 17:19:50 +00:00
Carmelo Cascone
3977ea4d9e Refactor channel and mastership handling in P4Runtime
This (big) change aims at solving the issue observed with mastership flapping
and device connection/disconnection with P4Runtime.

Channel handling is now based on the underlying gRPC channel state. Before,
channel events (open/close/error) were generated as a consequence of P4Runtime
StreamChannel events, making device availability dependent on mastership. Now
Stream Channel events only affect mastership (MASTER/STANDBY or NONE when the
SteamChannel RPC is not active).

Mastership handling has been refactored to generate P4Runtime election IDs that
are compatible with the mastership preference decided by the MastershipService.

GeneralDeviceProvider has been re-implemented to support in-order
device event processing and to reduce implementation complexity. Stats polling
has been moved to a separate component, and netcfg handling updated to only
depend on BasicDeviceConfig, augmented with a pipeconf field, and re-using the
managementAddress field to set the gRPC server endpoints (e.g.
grpc://myswitch.local:50051). Before it was depending on 3 different config
classes, making hard to detect changes.

Finally, this change affects some core interfaces:
- Adds a method to DeviceProvider and DeviceHandshaker to check for device
availability, making the meaning of availability device-specific. This is needed
in cases where the device manager needs to change the availability state of a
device (as in change #20842)
- Support device providers not capable of reconciling mastership role responses
with requests (like P4Runtime).
- Clarify the meaning of "connection" in the DeviceConnect behavior.
- Allows driver-based providers to check devices for reachability and
availability without probing the device via the network.

Change-Id: I7ff30d29f5d02ad938e3171536e54ae2916629a2
2019-03-06 19:28:42 +00:00
Carmelo Cascone
25243d671f Missing changes from update install-p4-tools.sh to use P4Runtime v1.0
Change-Id: I89aca8b081bd05f10c6a8ad88322fd132316b581
2019-02-22 22:54:19 +00:00
Carmelo Cascone
a4dc3c12bc Update install-p4-tools.sh to use P4Runtime v1.0
Includes also various improvements to the p4vm scripts, such as:
- Choose to build VM with Ubuntu 16.04 or 18.04 (experimental)
- Allow users to specify version of protobuf and grpc to use
- Avoid building protobuf and grpc if already installed in the system
- Install Bazel 0.22

Also:
- Remove check for invalid group member weights (now PI always returns
members with weight 1)
- Re-compiled all P4 programs and fixed missing padding in controller
packet headers

Change-Id: I0e672fcebbaba63354c749f0c774af251f3cbc6c
2019-02-21 23:24:26 +00:00
Jonghwan Hyun
aeabca7c86 [ONOS-7931] Add table id mapping for basic pipeline
Change-Id: I56a5c12b320a3a353892e59b115d2a852b8af0a5
2019-02-16 00:17:26 +00:00
Jonghwan Hyun
c235d46312 Update INT version to 1.0
Change-Id: I898501780cad9c1ad725ee624aa0cd4617ad2559
2019-02-15 21:16:45 +00:00
Carmelo Cascone
4c289b731d New P4RuntimeClient implementation that supports batching and error reporting
The new client API supports batching and provides detailed response for
write requests (e.g. if entity already exists when inserting), which was
not possible with the old one.

This patch includes:
- New more efficient implementation of P4RuntimeClient (no more locking,
use native gRPC executor, use stub deadlines)
- Ported all codecs to new AbstractCodec-based implementation (needed to
implement codec cache in the future)
- Uses batching in P4RuntimeFlowRuleProgrammable and
P4RuntimeGroupActionProgrammable
- Minor changes to PI framework runtime classes

Change-Id: I3fac42057bb4e1389d761006a32600c786598683
2019-02-04 23:12:46 -08:00
Carmelo Cascone
cb4327a09e ONOS-7887 Rename action profile-related entities
Members can exist outside of a group. Previous naming was ambiguous
about this.

Action group -> action profile group
Action group member -> action profile member

Change-Id: I5097e92253353d355b864e689f9653df2d318230
2019-01-10 13:52:52 -08:00
Carmelo Cascone
776be389d1 Rejuvenate (to some extent) the basic pipeconf
- Use auto-generated BasicConstants
- Implement own pipeliner that maps to table0 (will remove soon
interpreter mapping for index table IDs)

Change-Id: I19fd2091605edc0efbe62134e1ad8e3336089cde
2018-12-12 22:19:38 -08:00
Carmelo Cascone
d06a8511cd Fix fabric.p4 pipeliner not generating next_vlan rule for routing to a tagged host
Change-Id: If3cba5509545bb1de5d8f35796ba2bfee3020ef4
2018-12-11 14:48:06 -08:00
Carmelo Cascone
45cc08627f Xconnect support for fabric.p4 pipeliner
Change-Id: I3bd802ccbc34561b71862a160bab67adeccc2891
2018-12-11 14:48:06 -08:00
Carmelo Cascone
b5324e7168 Improve fabric.p4 to reduce pipeline resources and refactor pipeconf impl
This patch affects both the P4 pipeline implementation and the
Java pipeconf.

P4 PIPELINE
- Less tables and smarter use of metadata to reduce inter-tables
dependencies and favor parallel execution of tables.
- Removed unused actions / renamed existing ones to make forwarding
behavior clearer (e.g. ingress_port_vlan table)
- Remove co-existence of simple and hansed table. Hashed should be the
default one, but implementations that do not support action profiles
might compile fabric.p4 to use the simple one.
- Use @name annotations for match fields to make control plane
independent of table implementation.
- Use @hidden to avoid showing actions and table on the p4info that
cannot be controlled at runtime.
- First attempt to support double VLAN cross-connect (xconnect table).
- New design has been tested with "fabric-refactoring" branch of
fabric-p4test:
github.com/opennetworkinglab/fabric-p4test/tree/fabric-refactoring

JAVA PIPECONF
This patch brings a major refactoring that reflects the experience
gathered in the past months of working on fabric.p4 and reasoning on its
pipeconf implementation. Indeed, the FlowObjective API is
under-specified and sometimes ambiguous which makes the process of
creating and maintaining a pipeliner implementation tedious. This
refactoring brings a simplified implementation by removing unused/
unnecessary functionalities and by recognizing commonality when possible
(e.g. by means of abstract and utility classes). It also makes design
patterns more explicit and consistent. Overall, the goal is to reduce
technical debt and to make it easier to support new features as we
evolve fabric.p4

Changes include:
- Changes in pipeliner/interpreter to reflect new pipeline design.
- By default translate objective treatment to PiAction. This favors
debuggability of flow rules in ONOS.
- Support new NextObjective’s NextTreatment class.
- Remove lots of unused/unnecessary code (e.g. async callback handling
for pending objective install status in pipeliner as current
implementation was always returning success)
- Gather commonality in abstract classes and simplify implementation
for objective translator (filtering, forwarding, next)
- New implementation of ForwardingFunctionTypes (FFT) that looks at
criterion instance values along with their types (to avoid relying on
case-specific if-else conditions to recognize variants of an FFT)
- Adaptive translation of NextObjective based on presence of simple or
hashed table.
- Support DENY FilteringObjective

Also:
- Fix onos-p4-gen-constants to avoid generating conflicting
PiMatchFieldId variable names.
- Install Graphviz tools in p4vm to generate p4c graphs
- Generate p4c graphs by default when compiling fabric.p4
- Use more compact Hex string when printing PI values

Change-Id: Ife79e44054dc5bc48833f95d0551a7370150eac5
2018-12-11 14:48:06 -08:00
Jonghwan Hyun
6777d53386 Implement INT Telemetry Reporting functionality
[ONOS-7335] Add telemetry reporting functionality to basic int.p4

Change-Id: I3ddd776857598d0b9c1bb70aab22a302c0d6bcc0
2018-11-21 02:38:48 +00:00
Jonghwan Hyun
435ec7bd74 Fix NPE in IntProgrammableImpl
Change-Id: Ibb45a701327021ac9daae7e0e357a6bc2c8587d1
2018-11-15 07:32:42 +00:00
Ray Milkey
a349da9d6b Merge branch 'master' into dev-karaf-4.2.1
Change-Id: I3c87139d15508e16a15df62fe73590b2a2ef7a04
2018-11-07 16:20:46 -08:00
Alan Lo
5e2b705713 Update spectrum pipeline config
Change-Id: I6d663e1a2851d812ab64cf6cb268c20914520570
2018-11-06 23:47:09 +00: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
Carmelo Cascone
8e5818dc65 In fabric.p4 do not parse int_data if sink is not enabled
Change-Id: Ie4d5b9ccdf31ea1142945365fca7db7b8d4ae3f9
2018-10-26 19:42:11 +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
Ray Milkey
d542568b21 Merge branch 'master' into dev-karaf-4.2.1
Change-Id: Iec1b8947c898b0bf10db8caece0c3a064d1c63ae
2018-10-23 10:50:43 -07:00
wu
914ed23baa The ops should be checked if it is null.
Change-Id: If91582add24334427c4b9f935cec622a6e7d8f6d
2018-10-23 17:22:33 +00: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
fa42158937 Refactored INT service impl to support multi-instance ONOS and fabric.p4
Change-Id: Ic82a3ab72d71a774606b25997e283b93aedc6ec9
2018-10-05 23:45:33 +00:00
Carmelo Cascone
5a8a650896 Added fabric.p4 profile with both SPGW and INT support
Change-Id: I738e47cc6dbb49d7b3f9b82b44f0f863ff0d0e9d
2018-10-05 23:45:23 +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
79a3a31aec Refactor fabric.p4 INT support to allow compilation on more P4 targets
Also use constant entries for instruction mask tables to avoid
programming them at runtime.

Change-Id: Ia1ab1ecd42a433daec171f9a30bcdba3b8484061
2018-10-05 23:44:49 +00:00
Carmelo Cascone
0c8d73ea08 Use P4 port counters only for BMv2 pipeconf in fabric.p4
Change-Id: I7d13b42188368318c43606f9b97afe75adfae7dc
2018-10-05 23:44:42 +00:00
Carmelo Cascone
6880ba619a Get CPU port dynamically in fabric interpreter
Different HW platforms have different CPU ports, here we allow using
the same interpreter with multiple platform.

Change-Id: I0895d4d3e11560c75aca3fa908ca38759b597d67
2018-10-05 23:39:16 +00:00
Ray Milkey
df521294ce Merge remote-tracking branch 'origin/master' into merge-master
Change-Id: I4608093c4400a313b253508ac6bc8a84ecba5c7e
2018-10-04 15:13:33 -07:00
Yi Tseng
15ab4b0953 [ONOS-7703] FabricPipeliner does not remove NextGroup from store when remove NextObjective
Change-Id: Id945443606bd26e87f9e5236e97820bdbbe5b195
2018-10-03 04:34:49 +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
4235257e52 Convert default routes to two table entries in fabric.p4 pipeliner
This is a workaround to the still brittle support for default actions
in P4Runtime.

Change-Id: I6d2e76df2519eb2660b793a3fb213387fb388ce6
2018-09-13 20:52:08 +00:00
Charles Chan
b1f02f2e07 Do not change vlan_meta flow if we are only editing the buckets
There may be some other buckets in the hash group relying on the vlan_meta flow

Change-Id: Ie208328df0e8b43c5dd836f0d9c43785bc74c908
2018-09-05 17:34:13 +00:00
Charles Chan
cd03f07fb7 Implement NOP in routing v4 table
Change-Id: Ia238cf88eb1ed5e23309f3b2cab7f1403f30dafe
2018-09-05 16:24:26 +00:00
Charles Chan
91ea972a04 Report successful objective operation immediately once the flows/groups are translated
P4 pipeliners are fundamentally different from OpenFlow pipeliners.
It can verify if the flow objective can be translated into a flow that is compatible with the pipeline.
Once verified, it is almost certain the flow can be installed on the switch.
The flow/group subsystem retry mechanism will take care of some rare cases where the flow/group doesn’t get in for the first time.

Therefore, we only fail the objective if there is a translation error in the FabricPipeliner

Change-Id: I868016c0859930fa15b9cdbacb6f72d8c3df307f
2018-09-05 16:24:23 +00:00
Charles Chan
3330195a19 Slience warning of MPLS_PUSH and TTL_OUT
Change-Id: I4ed38d42924782f4fa68675b3dd0b43bae6fd674
2018-08-30 13:11:38 -07:00
Carmelo Cascone
8d2d1b2cb1 Avoid egress processing for controller packet-in/out in fabric.p4
Change-Id: If8ac129efd11a437054ed6b7178e167eff9c6e74
2018-08-28 09:17:52 +00:00
Charles Chan
384aea29c6 Support IPv4 multicast in P4 fabric pipeline
- Multicast can use the same table as unicast. Merge into one.
- Allow masked destination MAC in classifier table

Note:
- Pipeliner now translates all exact MAC match to masked match with FF:FF:FF:FF:FF:FF mask.
- Interpreter now only uses masked src/dst MAC

Change-Id: Ibd27ebfb2d72ba929031f07a29927eb6f1844f11
(cherry picked from commit 0865779b66a59a623856b1353615e462af5575c5)
2018-08-28 05:24:39 +00:00
Carmelo Cascone
07bc58eebe Fixed port duration 0 on P4Runtime devices running basic.4 and fabric.p4
Change-Id: I3e2e81be6753f25a6b8c6b602804686fc1c05677
2018-08-23 00:21:47 +00:00