blob: ed7fba888319822d5ac728c6c535125e93c97772 [file] [log] [blame]
Carmelo Cascone9db4d5c2019-04-16 17:36:33 -07001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.drivers.p4runtime.mirror;
18
19import org.onosproject.net.pi.runtime.PiEntityType;
20import org.onosproject.net.pi.runtime.PiPreEntry;
21import org.onosproject.net.pi.runtime.PiPreEntryHandle;
22import org.osgi.service.component.annotations.Component;
23
24/**
25 * Distributed implementation of a P4Runtime PRE entry mirror.
26 */
27@Component(immediate = true, service = P4RuntimePreEntryMirror.class)
28public final class DistributedP4RuntimePreEntryMirror
29 extends AbstractDistributedP4RuntimeMirror<PiPreEntryHandle, PiPreEntry>
30 implements P4RuntimePreEntryMirror {
31
32 public DistributedP4RuntimePreEntryMirror() {
Carmelo Casconed6191ec2019-04-28 12:45:56 -070033 // PI does not support reading PRE entries. To avoid inconsistencies,
34 // flush mirror on device disconnection and other events which
35 // invalidate pipeline status.
36 super(PiEntityType.PRE_ENTRY, true);
Carmelo Cascone9db4d5c2019-04-16 17:36:33 -070037 }
pierventre8e6e30c2021-01-15 11:56:46 +010038
39 @Override
40 protected String mapSimpleName() {
41 return PiEntityType.PRE_ENTRY.name().toLowerCase();
42 }
Carmelo Cascone9db4d5c2019-04-16 17:36:33 -070043}