Charles Chan | f9e9865 | 2016-09-07 16:54:23 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-present Open Networking Laboratory |
| 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.driver.pipeline; |
| 18 | |
| 19 | import org.onlab.packet.VlanId; |
| 20 | import org.onosproject.core.ApplicationId; |
Charles Chan | f9e9865 | 2016-09-07 16:54:23 -0700 | [diff] [blame] | 21 | import org.onosproject.net.behaviour.PipelinerContext; |
Charles Chan | f9e9865 | 2016-09-07 16:54:23 -0700 | [diff] [blame] | 22 | import org.onosproject.net.flow.FlowRule; |
Charles Chan | f9e9865 | 2016-09-07 16:54:23 -0700 | [diff] [blame] | 23 | import org.onosproject.net.flow.criteria.PortCriterion; |
| 24 | import org.onosproject.net.flow.criteria.VlanIdCriterion; |
| 25 | import org.onosproject.net.flowobjective.ForwardingObjective; |
Charles Chan | f9e9865 | 2016-09-07 16:54:23 -0700 | [diff] [blame] | 26 | |
| 27 | import java.util.Collection; |
| 28 | import java.util.List; |
| 29 | |
| 30 | /** |
| 31 | * Pipeliner for Broadcom OF-DPA 3.0 TTP. |
| 32 | */ |
| 33 | public class Ofdpa3Pipeline extends Ofdpa2Pipeline { |
| 34 | @Override |
Charles Chan | 40132b3 | 2017-01-22 00:19:37 -0800 | [diff] [blame] | 35 | protected void initDriverId() { |
Charles Chan | f9e9865 | 2016-09-07 16:54:23 -0700 | [diff] [blame] | 36 | driverId = coreService.registerApplication( |
| 37 | "org.onosproject.driver.Ofdpa3Pipeline"); |
Charles Chan | 40132b3 | 2017-01-22 00:19:37 -0800 | [diff] [blame] | 38 | } |
Charles Chan | f9e9865 | 2016-09-07 16:54:23 -0700 | [diff] [blame] | 39 | |
Charles Chan | 40132b3 | 2017-01-22 00:19:37 -0800 | [diff] [blame] | 40 | @Override |
| 41 | protected void initGroupHander(PipelinerContext context) { |
| 42 | groupHandler = new Ofdpa3GroupHandler(); |
| 43 | groupHandler.init(deviceId, context); |
Charles Chan | f9e9865 | 2016-09-07 16:54:23 -0700 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | @Override |
| 47 | protected List<FlowRule> processVlanIdFilter(PortCriterion portCriterion, |
| 48 | VlanIdCriterion vidCriterion, |
| 49 | VlanId assignedVlan, |
| 50 | ApplicationId applicationId) { |
| 51 | return processVlanIdFilterInternal(portCriterion, vidCriterion, assignedVlan, |
| 52 | applicationId, false); |
| 53 | } |
| 54 | |
| 55 | @Override |
| 56 | protected Collection<FlowRule> processEthTypeSpecific(ForwardingObjective fwd) { |
Pier Ventre | 140a894 | 2016-11-02 07:26:38 -0700 | [diff] [blame^] | 57 | if (isNotMplsBos(fwd.selector())) { |
| 58 | return processEthTypeSpecificInternal(fwd, true, MPLS_TYPE_TABLE); |
| 59 | } |
| 60 | return processEthTypeSpecificInternal(fwd, true, MPLS_L3_TYPE_TABLE); |
Charles Chan | f9e9865 | 2016-09-07 16:54:23 -0700 | [diff] [blame] | 61 | } |
| 62 | } |