Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 Cisco and/or its affiliates. |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at: |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | #include <vnet/vnet.h> |
| 16 | #include <vppinfra/vec.h> |
| 17 | #include <vppinfra/format.h> |
| 18 | #include <vlib/unix/cj.h> |
Shesha Sreenivasamurthy | b8f45b3 | 2016-02-03 09:38:36 -0800 | [diff] [blame] | 19 | #include <assert.h> |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 20 | |
| 21 | #include <vnet/ethernet/ethernet.h> |
| 22 | #include <vnet/devices/dpdk/dpdk.h> |
| 23 | |
| 24 | #include "dpdk_priv.h" |
| 25 | #include <vppinfra/error.h> |
| 26 | |
| 27 | #define foreach_dpdk_tx_func_error \ |
| 28 | _(BAD_RETVAL, "DPDK tx function returned an error") \ |
| 29 | _(RING_FULL, "Tx packet drops (ring full)") \ |
| 30 | _(PKT_DROP, "Tx packet drops (dpdk tx failure)") \ |
| 31 | _(REPL_FAIL, "Tx packet drops (replication failure)") |
| 32 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 33 | typedef enum |
| 34 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 35 | #define _(f,s) DPDK_TX_FUNC_ERROR_##f, |
| 36 | foreach_dpdk_tx_func_error |
| 37 | #undef _ |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 38 | DPDK_TX_FUNC_N_ERROR, |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 39 | } dpdk_tx_func_error_t; |
| 40 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 41 | static char *dpdk_tx_func_error_strings[] = { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 42 | #define _(n,s) s, |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 43 | foreach_dpdk_tx_func_error |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 44 | #undef _ |
| 45 | }; |
| 46 | |
Christian Dechamplain | 2073cfe | 2016-02-19 12:26:57 -0500 | [diff] [blame] | 47 | clib_error_t * |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 48 | dpdk_set_mac_address (vnet_hw_interface_t * hi, char *address) |
Christian Dechamplain | 2073cfe | 2016-02-19 12:26:57 -0500 | [diff] [blame] | 49 | { |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 50 | int error; |
| 51 | dpdk_main_t *dm = &dpdk_main; |
| 52 | dpdk_device_t *xd = vec_elt_at_index (dm->devices, hi->dev_instance); |
Christian Dechamplain | 2073cfe | 2016-02-19 12:26:57 -0500 | [diff] [blame] | 53 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 54 | error = rte_eth_dev_default_mac_addr_set (xd->device_index, |
| 55 | (struct ether_addr *) address); |
Christian Dechamplain | 2073cfe | 2016-02-19 12:26:57 -0500 | [diff] [blame] | 56 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 57 | if (error) |
| 58 | { |
| 59 | return clib_error_return (0, "mac address set failed: %d", error); |
| 60 | } |
| 61 | else |
| 62 | { |
| 63 | return NULL; |
| 64 | } |
Christian Dechamplain | 2073cfe | 2016-02-19 12:26:57 -0500 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | clib_error_t * |
| 68 | dpdk_set_mc_filter (vnet_hw_interface_t * hi, |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 69 | struct ether_addr mc_addr_vec[], int naddr) |
Christian Dechamplain | 2073cfe | 2016-02-19 12:26:57 -0500 | [diff] [blame] | 70 | { |
| 71 | int error; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 72 | dpdk_main_t *dm = &dpdk_main; |
| 73 | dpdk_device_t *xd = vec_elt_at_index (dm->devices, hi->dev_instance); |
Christian Dechamplain | 2073cfe | 2016-02-19 12:26:57 -0500 | [diff] [blame] | 74 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 75 | error = rte_eth_dev_set_mc_addr_list (xd->device_index, mc_addr_vec, naddr); |
Christian Dechamplain | 2073cfe | 2016-02-19 12:26:57 -0500 | [diff] [blame] | 76 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 77 | if (error) |
| 78 | { |
| 79 | return clib_error_return (0, "mc addr list failed: %d", error); |
| 80 | } |
| 81 | else |
| 82 | { |
| 83 | return NULL; |
| 84 | } |
Christian Dechamplain | 2073cfe | 2016-02-19 12:26:57 -0500 | [diff] [blame] | 85 | } |
| 86 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 87 | struct rte_mbuf * |
| 88 | dpdk_replicate_packet_mb (vlib_buffer_t * b) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 89 | { |
Damjan Marion | 878c609 | 2017-01-04 13:19:27 +0100 | [diff] [blame] | 90 | dpdk_main_t *dm = &dpdk_main; |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 91 | struct rte_mbuf **mbufs = 0, *s, *d; |
| 92 | u8 nb_segs; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 93 | unsigned socket_id = rte_socket_id (); |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 94 | int i; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 95 | |
Damjan Marion | 878c609 | 2017-01-04 13:19:27 +0100 | [diff] [blame] | 96 | ASSERT (dm->pktmbuf_pools[socket_id]); |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 97 | s = rte_mbuf_from_vlib_buffer (b); |
| 98 | nb_segs = s->nb_segs; |
| 99 | vec_validate (mbufs, nb_segs - 1); |
| 100 | |
Damjan Marion | 878c609 | 2017-01-04 13:19:27 +0100 | [diff] [blame] | 101 | if (rte_pktmbuf_alloc_bulk (dm->pktmbuf_pools[socket_id], mbufs, nb_segs)) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 102 | { |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 103 | vec_free (mbufs); |
| 104 | return 0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 105 | } |
| 106 | |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 107 | d = mbufs[0]; |
| 108 | d->nb_segs = s->nb_segs; |
| 109 | d->data_len = s->data_len; |
| 110 | d->pkt_len = s->pkt_len; |
| 111 | d->data_off = s->data_off; |
| 112 | clib_memcpy (d->buf_addr, s->buf_addr, RTE_PKTMBUF_HEADROOM + s->data_len); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 113 | |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 114 | for (i = 1; i < nb_segs; i++) |
Keith Burns (alagalah) | 52fc44d | 2016-03-25 09:38:50 -0700 | [diff] [blame] | 115 | { |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 116 | d->next = mbufs[i]; |
| 117 | d = mbufs[i]; |
| 118 | s = s->next; |
| 119 | d->data_len = s->data_len; |
| 120 | clib_memcpy (d->buf_addr, s->buf_addr, |
| 121 | RTE_PKTMBUF_HEADROOM + s->data_len); |
Keith Burns (alagalah) | 52fc44d | 2016-03-25 09:38:50 -0700 | [diff] [blame] | 122 | } |
| 123 | |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 124 | d = mbufs[0]; |
| 125 | vec_free (mbufs); |
| 126 | return d; |
Keith Burns (alagalah) | 52fc44d | 2016-03-25 09:38:50 -0700 | [diff] [blame] | 127 | } |
| 128 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 129 | static void |
| 130 | dpdk_tx_trace_buffer (dpdk_main_t * dm, |
| 131 | vlib_node_runtime_t * node, |
| 132 | dpdk_device_t * xd, |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 133 | u16 queue_id, u32 buffer_index, vlib_buffer_t * buffer) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 134 | { |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 135 | vlib_main_t *vm = vlib_get_main (); |
| 136 | dpdk_tx_dma_trace_t *t0; |
| 137 | struct rte_mbuf *mb; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 138 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 139 | mb = rte_mbuf_from_vlib_buffer (buffer); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 140 | |
| 141 | t0 = vlib_add_trace (vm, node, buffer, sizeof (t0[0])); |
| 142 | t0->queue_index = queue_id; |
| 143 | t0->device_index = xd->device_index; |
| 144 | t0->buffer_index = buffer_index; |
Damjan Marion | f1213b8 | 2016-03-13 02:22:06 +0100 | [diff] [blame] | 145 | clib_memcpy (&t0->mb, mb, sizeof (t0->mb)); |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 146 | clib_memcpy (&t0->buffer, buffer, |
| 147 | sizeof (buffer[0]) - sizeof (buffer->pre_data)); |
Damjan Marion | f1213b8 | 2016-03-13 02:22:06 +0100 | [diff] [blame] | 148 | clib_memcpy (t0->buffer.pre_data, buffer->data + buffer->current_data, |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 149 | sizeof (t0->buffer.pre_data)); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 150 | } |
| 151 | |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 152 | static_always_inline void |
| 153 | dpdk_validate_rte_mbuf (vlib_main_t * vm, vlib_buffer_t * b, |
| 154 | int maybe_multiseg) |
| 155 | { |
| 156 | struct rte_mbuf *mb, *first_mb, *last_mb; |
| 157 | |
| 158 | /* buffer is coming from non-dpdk source so we need to init |
| 159 | rte_mbuf header */ |
| 160 | if (PREDICT_FALSE ((b->flags & VNET_BUFFER_RTE_MBUF_VALID) == 0)) |
| 161 | { |
Pierre Pfister | 58290ea | 2016-12-02 10:55:13 +0000 | [diff] [blame] | 162 | vlib_buffer_t *b2 = b; |
| 163 | last_mb = mb = rte_mbuf_from_vlib_buffer (b2); |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 164 | rte_pktmbuf_reset (mb); |
Pierre Pfister | 58290ea | 2016-12-02 10:55:13 +0000 | [diff] [blame] | 165 | while (maybe_multiseg && (b2->flags & VLIB_BUFFER_NEXT_PRESENT)) |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 166 | { |
Pierre Pfister | 58290ea | 2016-12-02 10:55:13 +0000 | [diff] [blame] | 167 | b2 = vlib_get_buffer (vm, b2->next_buffer); |
| 168 | mb = rte_mbuf_from_vlib_buffer (b2); |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 169 | last_mb->next = mb; |
| 170 | last_mb = mb; |
| 171 | rte_pktmbuf_reset (mb); |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | first_mb = mb = rte_mbuf_from_vlib_buffer (b); |
| 176 | first_mb->nb_segs = 1; |
| 177 | mb->data_len = b->current_length; |
| 178 | mb->pkt_len = maybe_multiseg ? vlib_buffer_length_in_chain (vm, b) : |
| 179 | b->current_length; |
| 180 | mb->data_off = VLIB_BUFFER_PRE_DATA_SIZE + b->current_data; |
| 181 | |
| 182 | while (maybe_multiseg && (b->flags & VLIB_BUFFER_NEXT_PRESENT)) |
| 183 | { |
| 184 | b = vlib_get_buffer (vm, b->next_buffer); |
| 185 | mb = rte_mbuf_from_vlib_buffer (b); |
| 186 | mb->data_len = b->current_length; |
| 187 | mb->pkt_len = b->current_length; |
| 188 | mb->data_off = VLIB_BUFFER_PRE_DATA_SIZE + b->current_data; |
| 189 | first_mb->nb_segs++; |
| 190 | } |
| 191 | } |
| 192 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 193 | /* |
| 194 | * This function calls the dpdk's tx_burst function to transmit the packets |
| 195 | * on the tx_vector. It manages a lock per-device if the device does not |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 196 | * support multiple queues. It returns the number of packets untransmitted |
| 197 | * on the tx_vector. If all packets are transmitted (the normal case), the |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 198 | * function returns 0. |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 199 | * |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 200 | * The function assumes there is at least one packet on the tx_vector. |
| 201 | */ |
| 202 | static_always_inline |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 203 | u32 tx_burst_vector_internal (vlib_main_t * vm, |
| 204 | dpdk_device_t * xd, |
| 205 | struct rte_mbuf **tx_vector) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 206 | { |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 207 | dpdk_main_t *dm = &dpdk_main; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 208 | u32 n_packets; |
| 209 | u32 tx_head; |
| 210 | u32 tx_tail; |
| 211 | u32 n_retry; |
| 212 | int rv; |
| 213 | int queue_id; |
| 214 | tx_ring_hdr_t *ring; |
| 215 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 216 | ring = vec_header (tx_vector, sizeof (*ring)); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 217 | |
| 218 | n_packets = ring->tx_head - ring->tx_tail; |
| 219 | |
Damjan Marion | b58598b | 2016-09-19 13:44:37 +0200 | [diff] [blame] | 220 | tx_head = ring->tx_head % xd->nb_tx_desc; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 221 | |
| 222 | /* |
| 223 | * Ensure rte_eth_tx_burst is not called with 0 packets, which can lead to |
| 224 | * unpredictable results. |
| 225 | */ |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 226 | ASSERT (n_packets > 0); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 227 | |
| 228 | /* |
| 229 | * Check for tx_vector overflow. If this fails it is a system configuration |
| 230 | * error. The ring should be sized big enough to handle the largest un-flowed |
| 231 | * off burst from a traffic manager. A larger size also helps performance |
| 232 | * a bit because it decreases the probability of having to issue two tx_burst |
| 233 | * calls due to a ring wrap. |
| 234 | */ |
Damjan Marion | b58598b | 2016-09-19 13:44:37 +0200 | [diff] [blame] | 235 | ASSERT (n_packets < xd->nb_tx_desc); |
Damjan Marion | 4ee3a65 | 2016-11-15 19:47:58 +0100 | [diff] [blame] | 236 | ASSERT (ring->tx_tail == 0); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 237 | |
Damjan Marion | 4ee3a65 | 2016-11-15 19:47:58 +0100 | [diff] [blame] | 238 | n_retry = 16; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 239 | queue_id = vm->cpu_index; |
| 240 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 241 | do |
| 242 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 243 | /* start the burst at the tail */ |
Damjan Marion | b58598b | 2016-09-19 13:44:37 +0200 | [diff] [blame] | 244 | tx_tail = ring->tx_tail % xd->nb_tx_desc; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 245 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 246 | /* |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 247 | * This device only supports one TX queue, |
| 248 | * and we're running multi-threaded... |
| 249 | */ |
Damjan Marion | f530a55 | 2016-10-25 18:53:41 +0200 | [diff] [blame] | 250 | if (PREDICT_FALSE (xd->lockp != 0)) |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 251 | { |
| 252 | queue_id = queue_id % xd->tx_q_used; |
| 253 | while (__sync_lock_test_and_set (xd->lockp[queue_id], 1)) |
| 254 | /* zzzz */ |
| 255 | queue_id = (queue_id + 1) % xd->tx_q_used; |
| 256 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 257 | |
Damjan Marion | 4ee3a65 | 2016-11-15 19:47:58 +0100 | [diff] [blame] | 258 | if (PREDICT_FALSE (xd->flags & DPDK_DEVICE_FLAG_HQOS)) /* HQoS ON */ |
Jasvinder Singh | 85ecc81 | 2016-07-21 17:02:19 +0100 | [diff] [blame] | 259 | { |
Damjan Marion | 4ee3a65 | 2016-11-15 19:47:58 +0100 | [diff] [blame] | 260 | /* no wrap, transmit in one burst */ |
| 261 | dpdk_device_hqos_per_worker_thread_t *hqos = |
| 262 | &xd->hqos_wt[vm->cpu_index]; |
Jasvinder Singh | 85ecc81 | 2016-07-21 17:02:19 +0100 | [diff] [blame] | 263 | |
Jasvinder Singh | 199ca9c | 2016-12-08 13:52:47 +0000 | [diff] [blame] | 264 | ASSERT (hqos->swq != NULL); |
| 265 | |
Damjan Marion | 4ee3a65 | 2016-11-15 19:47:58 +0100 | [diff] [blame] | 266 | dpdk_hqos_metadata_set (hqos, |
| 267 | &tx_vector[tx_tail], tx_head - tx_tail); |
| 268 | rv = rte_ring_sp_enqueue_burst (hqos->swq, |
| 269 | (void **) &tx_vector[tx_tail], |
| 270 | (uint16_t) (tx_head - tx_tail)); |
Jasvinder Singh | 85ecc81 | 2016-07-21 17:02:19 +0100 | [diff] [blame] | 271 | } |
| 272 | else if (PREDICT_TRUE (xd->flags & DPDK_DEVICE_FLAG_PMD)) |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 273 | { |
Damjan Marion | 4ee3a65 | 2016-11-15 19:47:58 +0100 | [diff] [blame] | 274 | /* no wrap, transmit in one burst */ |
| 275 | rv = rte_eth_tx_burst (xd->device_index, |
| 276 | (uint16_t) queue_id, |
| 277 | &tx_vector[tx_tail], |
| 278 | (uint16_t) (tx_head - tx_tail)); |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 279 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 280 | else |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 281 | { |
| 282 | ASSERT (0); |
| 283 | rv = 0; |
| 284 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 285 | |
Damjan Marion | f530a55 | 2016-10-25 18:53:41 +0200 | [diff] [blame] | 286 | if (PREDICT_FALSE (xd->lockp != 0)) |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 287 | *xd->lockp[queue_id] = 0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 288 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 289 | if (PREDICT_FALSE (rv < 0)) |
| 290 | { |
| 291 | // emit non-fatal message, bump counter |
| 292 | vnet_main_t *vnm = dm->vnet_main; |
| 293 | vnet_interface_main_t *im = &vnm->interface_main; |
| 294 | u32 node_index; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 295 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 296 | node_index = vec_elt_at_index (im->hw_interfaces, |
| 297 | xd->vlib_hw_if_index)->tx_node_index; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 298 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 299 | vlib_error_count (vm, node_index, DPDK_TX_FUNC_ERROR_BAD_RETVAL, 1); |
| 300 | clib_warning ("rte_eth_tx_burst[%d]: error %d", xd->device_index, |
| 301 | rv); |
| 302 | return n_packets; // untransmitted packets |
| 303 | } |
| 304 | ring->tx_tail += (u16) rv; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 305 | n_packets -= (uint16_t) rv; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 306 | } |
| 307 | while (rv && n_packets && (n_retry > 0)); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 308 | |
| 309 | return n_packets; |
| 310 | } |
| 311 | |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 312 | static_always_inline void |
| 313 | dpdk_prefetch_buffer_by_index (vlib_main_t * vm, u32 bi) |
| 314 | { |
| 315 | vlib_buffer_t *b; |
| 316 | struct rte_mbuf *mb; |
| 317 | b = vlib_get_buffer (vm, bi); |
| 318 | mb = rte_mbuf_from_vlib_buffer (b); |
| 319 | CLIB_PREFETCH (mb, CLIB_CACHE_LINE_BYTES, LOAD); |
| 320 | CLIB_PREFETCH (b, CLIB_CACHE_LINE_BYTES, LOAD); |
| 321 | } |
| 322 | |
| 323 | static_always_inline void |
| 324 | dpdk_buffer_recycle (vlib_main_t * vm, vlib_node_runtime_t * node, |
| 325 | vlib_buffer_t * b, u32 bi, struct rte_mbuf **mbp) |
| 326 | { |
| 327 | dpdk_main_t *dm = &dpdk_main; |
Dave Barach | 971158e | 2016-11-23 08:57:37 -0500 | [diff] [blame] | 328 | u32 my_cpu = vm->cpu_index; |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 329 | struct rte_mbuf *mb_new; |
| 330 | |
| 331 | if (PREDICT_FALSE (b->flags & VLIB_BUFFER_RECYCLE) == 0) |
| 332 | return; |
| 333 | |
| 334 | mb_new = dpdk_replicate_packet_mb (b); |
| 335 | if (PREDICT_FALSE (mb_new == 0)) |
| 336 | { |
| 337 | vlib_error_count (vm, node->node_index, |
| 338 | DPDK_TX_FUNC_ERROR_REPL_FAIL, 1); |
| 339 | b->flags |= VLIB_BUFFER_REPL_FAIL; |
| 340 | } |
| 341 | else |
| 342 | *mbp = mb_new; |
| 343 | |
| 344 | vec_add1 (dm->recycle[my_cpu], bi); |
| 345 | } |
| 346 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 347 | /* |
| 348 | * Transmits the packets on the frame to the interface associated with the |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 349 | * node. It first copies packets on the frame to a tx_vector containing the |
| 350 | * rte_mbuf pointers. It then passes this vector to tx_burst_vector_internal |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 351 | * which calls the dpdk tx_burst function. |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 352 | */ |
| 353 | static uword |
| 354 | dpdk_interface_tx (vlib_main_t * vm, |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 355 | vlib_node_runtime_t * node, vlib_frame_t * f) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 356 | { |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 357 | dpdk_main_t *dm = &dpdk_main; |
| 358 | vnet_interface_output_runtime_t *rd = (void *) node->runtime_data; |
| 359 | dpdk_device_t *xd = vec_elt_at_index (dm->devices, rd->dev_instance); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 360 | u32 n_packets = f->n_vectors; |
| 361 | u32 n_left; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 362 | u32 *from; |
| 363 | struct rte_mbuf **tx_vector; |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 364 | u16 i; |
| 365 | u16 nb_tx_desc = xd->nb_tx_desc; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 366 | int queue_id; |
| 367 | u32 my_cpu; |
| 368 | u32 tx_pkts = 0; |
| 369 | tx_ring_hdr_t *ring; |
| 370 | u32 n_on_ring; |
| 371 | |
| 372 | my_cpu = vm->cpu_index; |
| 373 | |
| 374 | queue_id = my_cpu; |
| 375 | |
| 376 | tx_vector = xd->tx_vectors[queue_id]; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 377 | ring = vec_header (tx_vector, sizeof (*ring)); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 378 | |
| 379 | n_on_ring = ring->tx_head - ring->tx_tail; |
| 380 | from = vlib_frame_vector_args (f); |
| 381 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 382 | ASSERT (n_packets <= VLIB_FRAME_SIZE); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 383 | |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 384 | if (PREDICT_FALSE (n_on_ring + n_packets > nb_tx_desc)) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 385 | { |
| 386 | /* |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 387 | * Overflowing the ring should never happen. |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 388 | * If it does then drop the whole frame. |
| 389 | */ |
| 390 | vlib_error_count (vm, node->node_index, DPDK_TX_FUNC_ERROR_RING_FULL, |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 391 | n_packets); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 392 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 393 | while (n_packets--) |
| 394 | { |
| 395 | u32 bi0 = from[n_packets]; |
| 396 | vlib_buffer_t *b0 = vlib_get_buffer (vm, bi0); |
| 397 | struct rte_mbuf *mb0 = rte_mbuf_from_vlib_buffer (b0); |
| 398 | rte_pktmbuf_free (mb0); |
| 399 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 400 | return n_on_ring; |
| 401 | } |
| 402 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 403 | if (PREDICT_FALSE (dm->tx_pcap_enable)) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 404 | { |
| 405 | n_left = n_packets; |
| 406 | while (n_left > 0) |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 407 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 408 | u32 bi0 = from[0]; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 409 | vlib_buffer_t *b0 = vlib_get_buffer (vm, bi0); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 410 | if (dm->pcap_sw_if_index == 0 || |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 411 | dm->pcap_sw_if_index == vnet_buffer (b0)->sw_if_index[VLIB_TX]) |
| 412 | pcap_add_buffer (&dm->pcap_main, vm, bi0, 512); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 413 | from++; |
| 414 | n_left--; |
| 415 | } |
| 416 | } |
| 417 | |
| 418 | from = vlib_frame_vector_args (f); |
| 419 | n_left = n_packets; |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 420 | i = ring->tx_head % nb_tx_desc; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 421 | |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 422 | while (n_left >= 8) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 423 | { |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 424 | u32 bi0, bi1, bi2, bi3; |
| 425 | struct rte_mbuf *mb0, *mb1, *mb2, *mb3; |
| 426 | vlib_buffer_t *b0, *b1, *b2, *b3; |
| 427 | u32 or_flags; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 428 | |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 429 | dpdk_prefetch_buffer_by_index (vm, from[4]); |
| 430 | dpdk_prefetch_buffer_by_index (vm, from[5]); |
| 431 | dpdk_prefetch_buffer_by_index (vm, from[6]); |
| 432 | dpdk_prefetch_buffer_by_index (vm, from[7]); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 433 | |
| 434 | bi0 = from[0]; |
| 435 | bi1 = from[1]; |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 436 | bi2 = from[2]; |
| 437 | bi3 = from[3]; |
| 438 | from += 4; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 439 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 440 | b0 = vlib_get_buffer (vm, bi0); |
| 441 | b1 = vlib_get_buffer (vm, bi1); |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 442 | b2 = vlib_get_buffer (vm, bi2); |
| 443 | b3 = vlib_get_buffer (vm, bi3); |
| 444 | |
| 445 | or_flags = b0->flags | b1->flags | b2->flags | b3->flags; |
| 446 | |
| 447 | if (or_flags & VLIB_BUFFER_NEXT_PRESENT) |
| 448 | { |
| 449 | dpdk_validate_rte_mbuf (vm, b0, 1); |
| 450 | dpdk_validate_rte_mbuf (vm, b1, 1); |
| 451 | dpdk_validate_rte_mbuf (vm, b2, 1); |
| 452 | dpdk_validate_rte_mbuf (vm, b3, 1); |
| 453 | } |
| 454 | else |
| 455 | { |
| 456 | dpdk_validate_rte_mbuf (vm, b0, 0); |
| 457 | dpdk_validate_rte_mbuf (vm, b1, 0); |
| 458 | dpdk_validate_rte_mbuf (vm, b2, 0); |
| 459 | dpdk_validate_rte_mbuf (vm, b3, 0); |
| 460 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 461 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 462 | mb0 = rte_mbuf_from_vlib_buffer (b0); |
| 463 | mb1 = rte_mbuf_from_vlib_buffer (b1); |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 464 | mb2 = rte_mbuf_from_vlib_buffer (b2); |
| 465 | mb3 = rte_mbuf_from_vlib_buffer (b3); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 466 | |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 467 | if (PREDICT_FALSE (or_flags & VLIB_BUFFER_RECYCLE)) |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 468 | { |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 469 | dpdk_buffer_recycle (vm, node, b0, bi0, &mb0); |
| 470 | dpdk_buffer_recycle (vm, node, b1, bi1, &mb1); |
| 471 | dpdk_buffer_recycle (vm, node, b2, bi2, &mb2); |
| 472 | dpdk_buffer_recycle (vm, node, b3, bi3, &mb3); |
| 473 | |
| 474 | /* dont enqueue packets if replication failed as they must |
| 475 | be sent back to recycle */ |
| 476 | if (PREDICT_TRUE ((b0->flags & VLIB_BUFFER_REPL_FAIL) == 0)) |
| 477 | tx_vector[i++ % nb_tx_desc] = mb0; |
| 478 | if (PREDICT_TRUE ((b1->flags & VLIB_BUFFER_REPL_FAIL) == 0)) |
| 479 | tx_vector[i++ % nb_tx_desc] = mb1; |
| 480 | if (PREDICT_TRUE ((b2->flags & VLIB_BUFFER_REPL_FAIL) == 0)) |
| 481 | tx_vector[i++ % nb_tx_desc] = mb2; |
| 482 | if (PREDICT_TRUE ((b3->flags & VLIB_BUFFER_REPL_FAIL) == 0)) |
| 483 | tx_vector[i++ % nb_tx_desc] = mb3; |
| 484 | } |
| 485 | else |
| 486 | { |
| 487 | if (PREDICT_FALSE (i + 3 >= nb_tx_desc)) |
Keith Burns (alagalah) | c02f02d | 2016-04-19 12:54:12 -0700 | [diff] [blame] | 488 | { |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 489 | tx_vector[i++ % nb_tx_desc] = mb0; |
| 490 | tx_vector[i++ % nb_tx_desc] = mb1; |
| 491 | tx_vector[i++ % nb_tx_desc] = mb2; |
| 492 | tx_vector[i++ % nb_tx_desc] = mb3; |
| 493 | i %= nb_tx_desc; |
Keith Burns (alagalah) | c02f02d | 2016-04-19 12:54:12 -0700 | [diff] [blame] | 494 | } |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 495 | else |
Keith Burns (alagalah) | c02f02d | 2016-04-19 12:54:12 -0700 | [diff] [blame] | 496 | { |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 497 | tx_vector[i++] = mb0; |
| 498 | tx_vector[i++] = mb1; |
| 499 | tx_vector[i++] = mb2; |
| 500 | tx_vector[i++] = mb3; |
Keith Burns (alagalah) | c02f02d | 2016-04-19 12:54:12 -0700 | [diff] [blame] | 501 | } |
| 502 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 503 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 504 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 505 | if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE)) |
Keith Burns (alagalah) | c02f02d | 2016-04-19 12:54:12 -0700 | [diff] [blame] | 506 | { |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 507 | if (b0->flags & VLIB_BUFFER_IS_TRACED) |
Keith Burns (alagalah) | c02f02d | 2016-04-19 12:54:12 -0700 | [diff] [blame] | 508 | dpdk_tx_trace_buffer (dm, node, xd, queue_id, bi0, b0); |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 509 | if (b1->flags & VLIB_BUFFER_IS_TRACED) |
Keith Burns (alagalah) | c02f02d | 2016-04-19 12:54:12 -0700 | [diff] [blame] | 510 | dpdk_tx_trace_buffer (dm, node, xd, queue_id, bi1, b1); |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 511 | if (b2->flags & VLIB_BUFFER_IS_TRACED) |
| 512 | dpdk_tx_trace_buffer (dm, node, xd, queue_id, bi2, b2); |
| 513 | if (b3->flags & VLIB_BUFFER_IS_TRACED) |
| 514 | dpdk_tx_trace_buffer (dm, node, xd, queue_id, bi3, b3); |
Keith Burns (alagalah) | c02f02d | 2016-04-19 12:54:12 -0700 | [diff] [blame] | 515 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 516 | |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 517 | n_left -= 4; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 518 | } |
| 519 | while (n_left > 0) |
| 520 | { |
| 521 | u32 bi0; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 522 | struct rte_mbuf *mb0; |
| 523 | vlib_buffer_t *b0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 524 | |
| 525 | bi0 = from[0]; |
| 526 | from++; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 527 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 528 | b0 = vlib_get_buffer (vm, bi0); |
| 529 | |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 530 | dpdk_validate_rte_mbuf (vm, b0, 1); |
| 531 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 532 | mb0 = rte_mbuf_from_vlib_buffer (b0); |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 533 | dpdk_buffer_recycle (vm, node, b0, bi0, &mb0); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 534 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 535 | if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE)) |
Keith Burns (alagalah) | c02f02d | 2016-04-19 12:54:12 -0700 | [diff] [blame] | 536 | if (b0->flags & VLIB_BUFFER_IS_TRACED) |
| 537 | dpdk_tx_trace_buffer (dm, node, xd, queue_id, bi0, b0); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 538 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 539 | if (PREDICT_TRUE ((b0->flags & VLIB_BUFFER_REPL_FAIL) == 0)) |
| 540 | { |
Damjan Marion | 22766b8 | 2016-11-15 12:50:28 +0100 | [diff] [blame] | 541 | tx_vector[i % nb_tx_desc] = mb0; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 542 | i++; |
| 543 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 544 | n_left--; |
| 545 | } |
| 546 | |
| 547 | /* account for additional packets in the ring */ |
| 548 | ring->tx_head += n_packets; |
| 549 | n_on_ring = ring->tx_head - ring->tx_tail; |
| 550 | |
| 551 | /* transmit as many packets as possible */ |
| 552 | n_packets = tx_burst_vector_internal (vm, xd, tx_vector); |
| 553 | |
| 554 | /* |
| 555 | * tx_pkts is the number of packets successfully transmitted |
| 556 | * This is the number originally on ring minus the number remaining on ring |
| 557 | */ |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 558 | tx_pkts = n_on_ring - n_packets; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 559 | |
Damjan Marion | 4ee3a65 | 2016-11-15 19:47:58 +0100 | [diff] [blame] | 560 | { |
| 561 | /* If there is no callback then drop any non-transmitted packets */ |
| 562 | if (PREDICT_FALSE (n_packets)) |
| 563 | { |
| 564 | vlib_simple_counter_main_t *cm; |
| 565 | vnet_main_t *vnm = vnet_get_main (); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 566 | |
Damjan Marion | 4ee3a65 | 2016-11-15 19:47:58 +0100 | [diff] [blame] | 567 | cm = vec_elt_at_index (vnm->interface_main.sw_if_counters, |
| 568 | VNET_INTERFACE_COUNTER_TX_ERROR); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 569 | |
Damjan Marion | 4ee3a65 | 2016-11-15 19:47:58 +0100 | [diff] [blame] | 570 | vlib_increment_simple_counter (cm, my_cpu, xd->vlib_sw_if_index, |
| 571 | n_packets); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 572 | |
Damjan Marion | 4ee3a65 | 2016-11-15 19:47:58 +0100 | [diff] [blame] | 573 | vlib_error_count (vm, node->node_index, DPDK_TX_FUNC_ERROR_PKT_DROP, |
| 574 | n_packets); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 575 | |
Damjan Marion | 4ee3a65 | 2016-11-15 19:47:58 +0100 | [diff] [blame] | 576 | while (n_packets--) |
| 577 | rte_pktmbuf_free (tx_vector[ring->tx_tail + n_packets]); |
| 578 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 579 | |
Damjan Marion | 4ee3a65 | 2016-11-15 19:47:58 +0100 | [diff] [blame] | 580 | /* Reset head/tail to avoid unnecessary wrap */ |
| 581 | ring->tx_head = 0; |
| 582 | ring->tx_tail = 0; |
| 583 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 584 | |
| 585 | /* Recycle replicated buffers */ |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 586 | if (PREDICT_FALSE (vec_len (dm->recycle[my_cpu]))) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 587 | { |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 588 | vlib_buffer_free (vm, dm->recycle[my_cpu], |
| 589 | vec_len (dm->recycle[my_cpu])); |
| 590 | _vec_len (dm->recycle[my_cpu]) = 0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 591 | } |
| 592 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 593 | ASSERT (ring->tx_head >= ring->tx_tail); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 594 | |
| 595 | return tx_pkts; |
| 596 | } |
| 597 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 598 | static void |
| 599 | dpdk_clear_hw_interface_counters (u32 instance) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 600 | { |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 601 | dpdk_main_t *dm = &dpdk_main; |
| 602 | dpdk_device_t *xd = vec_elt_at_index (dm->devices, instance); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 603 | |
| 604 | /* |
Damjan Marion | b28e498 | 2016-08-22 22:34:38 +0200 | [diff] [blame] | 605 | * Set the "last_cleared_stats" to the current stats, so that |
| 606 | * things appear to clear from a display perspective. |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 607 | */ |
Damjan Marion | b28e498 | 2016-08-22 22:34:38 +0200 | [diff] [blame] | 608 | dpdk_update_counters (xd, vlib_time_now (dm->vlib_main)); |
Sean Hope | a4f16a0 | 2016-03-28 13:11:31 -0400 | [diff] [blame] | 609 | |
Damjan Marion | b28e498 | 2016-08-22 22:34:38 +0200 | [diff] [blame] | 610 | clib_memcpy (&xd->last_cleared_stats, &xd->stats, sizeof (xd->stats)); |
| 611 | clib_memcpy (xd->last_cleared_xstats, xd->xstats, |
| 612 | vec_len (xd->last_cleared_xstats) * |
| 613 | sizeof (xd->last_cleared_xstats[0])); |
Shesha Sreenivasamurthy | 9455084 | 2016-03-02 10:33:26 -0800 | [diff] [blame] | 614 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 615 | } |
| 616 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 617 | static clib_error_t * |
| 618 | dpdk_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags) |
| 619 | { |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 620 | vnet_hw_interface_t *hif = vnet_get_hw_interface (vnm, hw_if_index); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 621 | uword is_up = (flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP) != 0; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 622 | dpdk_main_t *dm = &dpdk_main; |
| 623 | dpdk_device_t *xd = vec_elt_at_index (dm->devices, hif->dev_instance); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 624 | int rv = 0; |
| 625 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 626 | if (is_up) |
| 627 | { |
| 628 | f64 now = vlib_time_now (dm->vlib_main); |
| 629 | |
Damjan Marion | b28e498 | 2016-08-22 22:34:38 +0200 | [diff] [blame] | 630 | if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) == 0) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 631 | rv = rte_eth_dev_start (xd->device_index); |
| 632 | |
Damjan Marion | b28e498 | 2016-08-22 22:34:38 +0200 | [diff] [blame] | 633 | if (xd->flags & DPDK_DEVICE_FLAG_PROMISC) |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 634 | rte_eth_promiscuous_enable (xd->device_index); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 635 | else |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 636 | rte_eth_promiscuous_disable (xd->device_index); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 637 | |
| 638 | rte_eth_allmulticast_enable (xd->device_index); |
Damjan Marion | b28e498 | 2016-08-22 22:34:38 +0200 | [diff] [blame] | 639 | xd->flags |= DPDK_DEVICE_FLAG_ADMIN_UP; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 640 | dpdk_update_counters (xd, now); |
| 641 | dpdk_update_link_state (xd, now); |
| 642 | } |
| 643 | else |
| 644 | { |
Damjan Marion | b28e498 | 2016-08-22 22:34:38 +0200 | [diff] [blame] | 645 | xd->flags &= ~DPDK_DEVICE_FLAG_ADMIN_UP; |
Georgi Savov | 3a03598 | 2016-02-25 12:56:03 -0500 | [diff] [blame] | 646 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 647 | rte_eth_allmulticast_disable (xd->device_index); |
| 648 | vnet_hw_interface_set_flags (vnm, xd->vlib_hw_if_index, 0); |
Damjan Marion | b28e498 | 2016-08-22 22:34:38 +0200 | [diff] [blame] | 649 | rte_eth_dev_stop (xd->device_index); |
John Lo | 3b2944d | 2016-07-18 18:06:14 -0400 | [diff] [blame] | 650 | |
| 651 | /* For bonded interface, stop slave links */ |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 652 | if (xd->pmd == VNET_DPDK_PMD_BOND) |
| 653 | { |
| 654 | u8 slink[16]; |
| 655 | int nlink = rte_eth_bond_slaves_get (xd->device_index, slink, 16); |
| 656 | while (nlink >= 1) |
John Lo | 3b2944d | 2016-07-18 18:06:14 -0400 | [diff] [blame] | 657 | { |
| 658 | u8 dpdk_port = slink[--nlink]; |
| 659 | rte_eth_dev_stop (dpdk_port); |
| 660 | } |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 661 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 662 | } |
| 663 | |
| 664 | if (rv < 0) |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 665 | clib_warning ("rte_eth_dev_%s error: %d", is_up ? "start" : "stop", rv); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 666 | |
| 667 | return /* no error */ 0; |
| 668 | } |
| 669 | |
| 670 | /* |
| 671 | * Dynamically redirect all pkts from a specific interface |
| 672 | * to the specified node |
| 673 | */ |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 674 | static void |
| 675 | dpdk_set_interface_next_node (vnet_main_t * vnm, u32 hw_if_index, |
| 676 | u32 node_index) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 677 | { |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 678 | dpdk_main_t *xm = &dpdk_main; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 679 | vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index); |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 680 | dpdk_device_t *xd = vec_elt_at_index (xm->devices, hw->dev_instance); |
| 681 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 682 | /* Shut off redirection */ |
| 683 | if (node_index == ~0) |
| 684 | { |
| 685 | xd->per_interface_next_index = node_index; |
| 686 | return; |
| 687 | } |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 688 | |
| 689 | xd->per_interface_next_index = |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 690 | vlib_node_add_next (xm->vlib_main, dpdk_input_node.index, node_index); |
| 691 | } |
| 692 | |
| 693 | |
| 694 | static clib_error_t * |
| 695 | dpdk_subif_add_del_function (vnet_main_t * vnm, |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 696 | u32 hw_if_index, |
| 697 | struct vnet_sw_interface_t *st, int is_add) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 698 | { |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 699 | dpdk_main_t *xm = &dpdk_main; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 700 | vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index); |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 701 | dpdk_device_t *xd = vec_elt_at_index (xm->devices, hw->dev_instance); |
| 702 | vnet_sw_interface_t *t = (vnet_sw_interface_t *) st; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 703 | int r, vlan_offload; |
Damjan Marion | a7cc447 | 2016-09-19 13:31:49 +0200 | [diff] [blame] | 704 | u32 prev_subifs = xd->num_subifs; |
| 705 | clib_error_t *err = 0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 706 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 707 | if (is_add) |
Damjan Marion | a7cc447 | 2016-09-19 13:31:49 +0200 | [diff] [blame] | 708 | xd->num_subifs++; |
| 709 | else if (xd->num_subifs) |
| 710 | xd->num_subifs--; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 711 | |
Damjan Marion | 5643170 | 2016-09-19 13:18:09 +0200 | [diff] [blame] | 712 | if ((xd->flags & DPDK_DEVICE_FLAG_PMD) == 0) |
Damjan Marion | a7cc447 | 2016-09-19 13:31:49 +0200 | [diff] [blame] | 713 | goto done; |
Todd Foggoa (tfoggoa) | ad8b472 | 2016-03-28 13:52:32 -0400 | [diff] [blame] | 714 | |
| 715 | /* currently we program VLANS only for IXGBE VF and I40E VF */ |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 716 | if ((xd->pmd != VNET_DPDK_PMD_IXGBEVF) && (xd->pmd != VNET_DPDK_PMD_I40EVF)) |
Damjan Marion | a7cc447 | 2016-09-19 13:31:49 +0200 | [diff] [blame] | 717 | goto done; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 718 | |
| 719 | if (t->sub.eth.flags.no_tags == 1) |
Damjan Marion | a7cc447 | 2016-09-19 13:31:49 +0200 | [diff] [blame] | 720 | goto done; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 721 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 722 | if ((t->sub.eth.flags.one_tag != 1) || (t->sub.eth.flags.exact_match != 1)) |
| 723 | { |
Damjan Marion | a7cc447 | 2016-09-19 13:31:49 +0200 | [diff] [blame] | 724 | xd->num_subifs = prev_subifs; |
| 725 | err = clib_error_return (0, "unsupported VLAN setup"); |
| 726 | goto done; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 727 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 728 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 729 | vlan_offload = rte_eth_dev_get_vlan_offload (xd->device_index); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 730 | vlan_offload |= ETH_VLAN_FILTER_OFFLOAD; |
| 731 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 732 | if ((r = rte_eth_dev_set_vlan_offload (xd->device_index, vlan_offload))) |
| 733 | { |
Damjan Marion | a7cc447 | 2016-09-19 13:31:49 +0200 | [diff] [blame] | 734 | xd->num_subifs = prev_subifs; |
| 735 | err = clib_error_return (0, "rte_eth_dev_set_vlan_offload[%d]: err %d", |
| 736 | xd->device_index, r); |
| 737 | goto done; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 738 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 739 | |
| 740 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 741 | if ((r = |
| 742 | rte_eth_dev_vlan_filter (xd->device_index, t->sub.eth.outer_vlan_id, |
| 743 | is_add))) |
| 744 | { |
Damjan Marion | a7cc447 | 2016-09-19 13:31:49 +0200 | [diff] [blame] | 745 | xd->num_subifs = prev_subifs; |
| 746 | err = clib_error_return (0, "rte_eth_dev_vlan_filter[%d]: err %d", |
| 747 | xd->device_index, r); |
| 748 | goto done; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 749 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 750 | |
Damjan Marion | a7cc447 | 2016-09-19 13:31:49 +0200 | [diff] [blame] | 751 | done: |
| 752 | if (xd->num_subifs) |
| 753 | xd->flags |= DPDK_DEVICE_FLAG_HAVE_SUBIF; |
| 754 | else |
| 755 | xd->flags &= ~DPDK_DEVICE_FLAG_HAVE_SUBIF; |
| 756 | |
| 757 | return err; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 758 | } |
| 759 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 760 | /* *INDENT-OFF* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 761 | VNET_DEVICE_CLASS (dpdk_device_class) = { |
| 762 | .name = "dpdk", |
| 763 | .tx_function = dpdk_interface_tx, |
| 764 | .tx_function_n_errors = DPDK_TX_FUNC_N_ERROR, |
| 765 | .tx_function_error_strings = dpdk_tx_func_error_strings, |
| 766 | .format_device_name = format_dpdk_device_name, |
| 767 | .format_device = format_dpdk_device, |
| 768 | .format_tx_trace = format_dpdk_tx_dma_trace, |
| 769 | .clear_counters = dpdk_clear_hw_interface_counters, |
| 770 | .admin_up_down_function = dpdk_interface_admin_up_down, |
| 771 | .subif_add_del_function = dpdk_subif_add_del_function, |
| 772 | .rx_redirect_to_node = dpdk_set_interface_next_node, |
Pavel Kotucek | c631f2d | 2016-09-26 10:40:02 +0200 | [diff] [blame] | 773 | .mac_addr_change_function = dpdk_set_mac_address, |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 774 | }; |
| 775 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 776 | VLIB_DEVICE_TX_FUNCTION_MULTIARCH (dpdk_device_class, dpdk_interface_tx) |
| 777 | /* *INDENT-ON* */ |
Damjan Marion | 1c80e83 | 2016-05-11 23:07:18 +0200 | [diff] [blame] | 778 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 779 | #define UP_DOWN_FLAG_EVENT 1 |
| 780 | |
Todd Foggoa | e3eefff | 2016-05-20 22:10:34 -0400 | [diff] [blame] | 781 | uword |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 782 | admin_up_down_process (vlib_main_t * vm, |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 783 | vlib_node_runtime_t * rt, vlib_frame_t * f) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 784 | { |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 785 | clib_error_t *error = 0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 786 | uword event_type; |
| 787 | uword *event_data = 0; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 788 | u32 sw_if_index; |
| 789 | u32 flags; |
| 790 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 791 | while (1) |
| 792 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 793 | vlib_process_wait_for_event (vm); |
| 794 | |
| 795 | event_type = vlib_process_get_events (vm, &event_data); |
| 796 | |
| 797 | dpdk_main.admin_up_down_in_progress = 1; |
| 798 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 799 | switch (event_type) |
| 800 | { |
| 801 | case UP_DOWN_FLAG_EVENT: |
| 802 | { |
| 803 | if (vec_len (event_data) == 2) |
| 804 | { |
| 805 | sw_if_index = event_data[0]; |
| 806 | flags = event_data[1]; |
| 807 | error = |
| 808 | vnet_sw_interface_set_flags (vnet_get_main (), sw_if_index, |
| 809 | flags); |
| 810 | clib_error_report (error); |
| 811 | } |
| 812 | } |
| 813 | break; |
| 814 | } |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 815 | |
| 816 | vec_reset_length (event_data); |
| 817 | |
| 818 | dpdk_main.admin_up_down_in_progress = 0; |
| 819 | |
| 820 | } |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 821 | return 0; /* or not */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 822 | } |
| 823 | |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 824 | /* *INDENT-OFF* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 825 | VLIB_REGISTER_NODE (admin_up_down_process_node,static) = { |
| 826 | .function = admin_up_down_process, |
| 827 | .type = VLIB_NODE_TYPE_PROCESS, |
| 828 | .name = "admin-up-down-process", |
| 829 | .process_log2_n_stack_bytes = 17, // 256KB |
| 830 | }; |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 831 | /* *INDENT-ON* */ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 832 | |
| 833 | /* |
Damjan Marion | 2566567 | 2016-08-16 18:56:08 +0200 | [diff] [blame] | 834 | * fd.io coding-style-patch-verification: ON |
| 835 | * |
| 836 | * Local Variables: |
| 837 | * eval: (c-set-style "gnu") |
| 838 | * End: |
| 839 | */ |