Daniel Park | d02d7bd | 2018-08-23 23:04:31 +0900 | [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 | package org.onosproject.openstacknode.api; |
| 17 | |
| 18 | /** |
| 19 | * Representation of dpdk interface information. |
| 20 | */ |
| 21 | public interface DpdkInterface { |
| 22 | Long DEFAULT_MTU_SIZE = 1500L; |
| 23 | |
| 24 | /** |
| 25 | * Dpdk interface type. |
| 26 | */ |
| 27 | enum Type { |
| 28 | /** |
| 29 | * A DPDK net device. |
| 30 | */ |
| 31 | DPDK, |
| 32 | /** |
| 33 | * A DPDK_VHOST_USER net device. |
| 34 | */ |
| 35 | DPDK_VHOST_USER, |
| 36 | /** |
| 37 | * A DPDK_VHOST_USER_CLIENT net device. |
| 38 | */ |
| 39 | DPDK_VHOST_USER_CLIENT |
| 40 | } |
| 41 | |
| 42 | |
| 43 | /** |
| 44 | * Returns the name of the device where the dpdk interface is. |
| 45 | * |
| 46 | * @return device name |
| 47 | */ |
| 48 | String deviceName(); |
| 49 | |
| 50 | /** |
| 51 | * Returns the name of the dpdk interface. |
| 52 | * |
| 53 | * @return dpdk interface name |
| 54 | */ |
| 55 | String intf(); |
| 56 | |
| 57 | /** |
| 58 | * Returns the dpdk device arguments of this dpdk port. |
| 59 | * ex) "0000:85:00.1" |
| 60 | * |
| 61 | * @return pci address |
| 62 | */ |
| 63 | String pciAddress(); |
| 64 | |
| 65 | /** |
| 66 | * Returns the dpdk interface type. |
| 67 | * |
| 68 | * @return type |
| 69 | */ |
| 70 | Type type(); |
| 71 | |
| 72 | /** |
| 73 | * Returns the mtu size. |
| 74 | * |
| 75 | * @return mtu |
| 76 | */ |
| 77 | Long mtu(); |
| 78 | |
| 79 | /** |
| 80 | * Builder of dpdk interface description entities. |
| 81 | */ |
| 82 | interface Builder { |
| 83 | /** |
| 84 | * Returns new dpdk interface. |
| 85 | * |
| 86 | * @return dpdk interface description |
| 87 | */ |
| 88 | DpdkInterface build(); |
| 89 | |
| 90 | /** |
| 91 | * Returns dpdk interface builder with supplied device name. |
| 92 | * |
| 93 | * @param deviceName device name |
| 94 | * @return dpdk interface |
| 95 | */ |
| 96 | Builder deviceName(String deviceName); |
| 97 | |
| 98 | /** |
| 99 | * Returns dpdk interface builder with supplied interface name. |
| 100 | * |
| 101 | * @param name interface name |
| 102 | * @return dpdk interface |
| 103 | */ |
| 104 | Builder intf(String name); |
| 105 | |
| 106 | /** |
| 107 | * Returns dpdk interface builder with supplied pci address. |
| 108 | * |
| 109 | * @param pciAddress pci address |
| 110 | * @return dpdk interface |
| 111 | */ |
| 112 | Builder pciAddress(String pciAddress); |
| 113 | |
| 114 | /** |
| 115 | * Returns dpdk interface builder with supplied type. |
| 116 | * |
| 117 | * @param type type |
| 118 | * @return dpdk interface |
| 119 | */ |
| 120 | Builder type(Type type); |
| 121 | |
| 122 | /** |
| 123 | * Returns dpdk interface builder with supplied mtu size. |
| 124 | * |
| 125 | * @param mtu mtu |
| 126 | * @return dpdk interface |
| 127 | */ |
| 128 | Builder mtu(Long mtu); |
| 129 | } |
| 130 | } |