Carmelo Cascone | 9db4d5c | 2019-04-16 17:36:33 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package org.onosproject.drivers.p4runtime.mirror; |
| 18 | |
| 19 | import org.onosproject.net.pi.runtime.PiEntityType; |
| 20 | import org.onosproject.net.pi.runtime.PiPreEntry; |
| 21 | import org.onosproject.net.pi.runtime.PiPreEntryHandle; |
| 22 | import 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) |
| 28 | public final class DistributedP4RuntimePreEntryMirror |
| 29 | extends AbstractDistributedP4RuntimeMirror<PiPreEntryHandle, PiPreEntry> |
| 30 | implements P4RuntimePreEntryMirror { |
| 31 | |
| 32 | public DistributedP4RuntimePreEntryMirror() { |
Carmelo Cascone | d6191ec | 2019-04-28 12:45:56 -0700 | [diff] [blame] | 33 | // 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 Cascone | 9db4d5c | 2019-04-16 17:36:33 -0700 | [diff] [blame] | 37 | } |
pierventre | 8e6e30c | 2021-01-15 11:56:46 +0100 | [diff] [blame^] | 38 | |
| 39 | @Override |
| 40 | protected String mapSimpleName() { |
| 41 | return PiEntityType.PRE_ENTRY.name().toLowerCase(); |
| 42 | } |
Carmelo Cascone | 9db4d5c | 2019-04-16 17:36:33 -0700 | [diff] [blame] | 43 | } |