FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
cli.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * Copyright (c) 2018 Cisco and/or its affiliates.
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 #include <stdint.h>
18 #include <net/if.h>
19 #include <sys/ioctl.h>
20 #include <inttypes.h>
21 
22 #include <vlib/vlib.h>
23 #include <vlib/unix/unix.h>
24 #include <vlib/pci/pci.h>
25 #include <vnet/ethernet/ethernet.h>
26 
27 #include <vmxnet3/vmxnet3.h>
28 
29 static clib_error_t *
31  vlib_cli_command_t * cmd)
32 {
33  unformat_input_t _line_input, *line_input = &_line_input;
35 
36  /* Get a line of input. */
37  if (!unformat_user (input, unformat_line_input, line_input))
38  return 0;
39 
40  clib_memset (&args, 0, sizeof (args));
41  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
42  {
43  if (unformat (line_input, "%U", unformat_vlib_pci_addr, &args.addr))
44  ;
45  else if (unformat (line_input, "elog"))
46  args.enable_elog = 1;
47  else if (unformat (line_input, "bind"))
48  args.bind = 1;
49  else if (unformat (line_input, "rx-queue-size %u", &args.rxq_size))
50  ;
51  else if (unformat (line_input, "tx-queue-size %u", &args.txq_size))
52  ;
53  else if (unformat (line_input, "num-tx-queues %u", &args.txq_num))
54  ;
55  else if (unformat (line_input, "num-rx-queues %u", &args.rxq_num))
56  ;
57  else
58  return clib_error_return (0, "unknown input `%U'",
59  format_unformat_error, input);
60  }
61  unformat_free (line_input);
62 
63 
64  vmxnet3_create_if (vm, &args);
65 
66  return args.error;
67 }
68 
69 /* *INDENT-OFF* */
70 VLIB_CLI_COMMAND (vmxnet3_create_command, static) = {
71  .path = "create interface vmxnet3",
72  .short_help = "create interface vmxnet3 <pci-address>"
73  "[rx-queue-size <size>] [tx-queue-size <size>]"
74  "[num-tx-queues <number>] [num-rx-queues <number>] [bind]",
75  .function = vmxnet3_create_command_fn,
76 };
77 /* *INDENT-ON* */
78 
79 static clib_error_t *
81  vlib_cli_command_t * cmd)
82 {
83  unformat_input_t _line_input, *line_input = &_line_input;
84  u32 sw_if_index = ~0;
87  vmxnet3_device_t *vd;
88  vnet_main_t *vnm = vnet_get_main ();
89 
90  /* Get a line of input. */
91  if (!unformat_user (input, unformat_line_input, line_input))
92  return 0;
93 
94  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
95  {
96  if (unformat (line_input, "sw_if_index %d", &sw_if_index))
97  ;
98  else if (unformat (line_input, "%U", unformat_vnet_sw_interface,
99  vnm, &sw_if_index))
100  ;
101  else
102  return clib_error_return (0, "unknown input `%U'",
103  format_unformat_error, input);
104  }
105  unformat_free (line_input);
106 
107  if (sw_if_index == ~0)
108  return clib_error_return (0,
109  "please specify interface name or sw_if_index");
110 
111  hw = vnet_get_sup_hw_interface_api_visible_or_null (vnm, sw_if_index);
112  if (hw == NULL || vmxnet3_device_class.index != hw->dev_class_index)
113  return clib_error_return (0, "not a vmxnet3 interface");
114 
115  vd = pool_elt_at_index (vmxm->devices, hw->dev_instance);
116 
117  vmxnet3_delete_if (vm, vd);
118 
119  return 0;
120 }
121 
122 /* *INDENT-OFF* */
123 VLIB_CLI_COMMAND (vmxnet3_delete_command, static) = {
124  .path = "delete interface vmxnet3",
125  .short_help = "delete interface vmxnet3 "
126  "{<interface> | sw_if_index <sw_idx>}",
127  .function = vmxnet3_delete_command_fn,
128 };
129 /* *INDENT-ON* */
130 
131 static clib_error_t *
133  vlib_cli_command_t * cmd)
134 {
135  unformat_input_t _line_input, *line_input = &_line_input;
136  u32 sw_if_index = ~0;
138  vmxnet3_main_t *vmxm = &vmxnet3_main;
139  vmxnet3_device_t *vd;
140  vnet_main_t *vnm = vnet_get_main ();
141  int enable_elog = 0, disable_elog = 0;
142 
143  /* Get a line of input. */
144  if (!unformat_user (input, unformat_line_input, line_input))
145  return 0;
146 
147  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
148  {
149  if (unformat (line_input, "sw_if_index %d", &sw_if_index))
150  ;
151  else if (unformat (line_input, "elog-on"))
152  enable_elog = 1;
153  else if (unformat (line_input, "elog-off"))
154  disable_elog = 1;
155  else if (unformat (line_input, "%U", unformat_vnet_sw_interface,
156  vnm, &sw_if_index))
157  ;
158  else
159  return clib_error_return (0, "unknown input `%U'",
160  format_unformat_error, input);
161  }
162  unformat_free (line_input);
163 
164  if (sw_if_index == ~0)
165  return clib_error_return (0,
166  "please specify interface name or sw_if_index");
167 
168  hw = vnet_get_sup_hw_interface_api_visible_or_null (vnm, sw_if_index);
169  if (hw == NULL || vmxnet3_device_class.index != hw->dev_class_index)
170  return clib_error_return (0, "not a vmxnet3 interface");
171 
172  vd = pool_elt_at_index (vmxm->devices, hw->dev_instance);
173 
174  if (enable_elog)
175  vd->flags |= VMXNET3_DEVICE_F_ELOG;
176 
177  if (disable_elog)
178  vd->flags &= ~VMXNET3_DEVICE_F_ELOG;
179 
180  return 0;
181 }
182 
183 /* *INDENT-OFF* */
184 VLIB_CLI_COMMAND (vmxnet3_test_command, static) = {
185  .path = "test vmxnet3",
186  .short_help = "test vmxnet3 <interface> | sw_if_index <sw_idx> [irq] "
187  "[elog-on] [elog-off]",
188  .function = vmxnet3_test_command_fn,
189 };
190 /* *INDENT-ON* */
191 
192 static void
193 show_vmxnet3 (vlib_main_t * vm, u32 * hw_if_indices, u8 show_descr,
194  u8 show_one_table, u32 which, u8 show_one_slot, u32 slot)
195 {
196  u32 i, desc_idx;
197  vmxnet3_device_t *vd;
198  vnet_main_t *vnm = &vnet_main;
199  vmxnet3_main_t *vmxm = &vmxnet3_main;
201  vmxnet3_rxq_t *rxq;
202  vmxnet3_rx_desc *rxd;
203  vmxnet3_rx_comp *rx_comp;
204  vmxnet3_txq_t *txq;
205  vmxnet3_tx_desc *txd;
206  vmxnet3_tx_comp *tx_comp;
207  u16 qid;
208 
209  if (!hw_if_indices)
210  return;
211 
212  vlib_cli_output (vm, "LRO/TSO configured: %u", vmxm->lro_configured);
213  for (i = 0; i < vec_len (hw_if_indices); i++)
214  {
215  hi = vnet_get_hw_interface (vnm, hw_if_indices[i]);
216  vd = vec_elt_at_index (vmxm->devices, hi->dev_instance);
217  vlib_cli_output (vm, "Interface: %U (ifindex %d)",
218  format_vnet_hw_if_index_name, vnm, hw_if_indices[i],
219  hw_if_indices[i]);
220  vlib_cli_output (vm, " Version: %u", vd->version);
221  vlib_cli_output (vm, " LRO/TSO enable: %u", vd->lro_enable);
222  vlib_cli_output (vm, " PCI Address: %U", format_vlib_pci_addr,
223  &vd->pci_addr);
224  vlib_cli_output (vm, " Mac Address: %U", format_ethernet_address,
225  vd->mac_addr);
226  vlib_cli_output (vm, " hw if index: %u", vd->hw_if_index);
227  vlib_cli_output (vm, " Device instance: %u", vd->dev_instance);
228  vlib_cli_output (vm, " Number of interrupts: %u", vd->num_intrs);
229 
230  vec_foreach_index (qid, vd->rxqs)
231  {
232  rxq = vec_elt_at_index (vd->rxqs, qid);
233  u16 rid;
234 
235  vlib_cli_output (vm, " Queue %u (RX)", qid);
236  vlib_cli_output (vm, " RX completion next index %u",
237  rxq->rx_comp_ring.next);
238  vlib_cli_output (vm, " RX completion generation flag 0x%x",
239  rxq->rx_comp_ring.gen);
240 
241  /* RX descriptors tables */
242  for (rid = 0; rid < VMXNET3_RX_RING_SIZE; rid++)
243  {
244  vmxnet3_rx_ring *ring = &rxq->rx_ring[rid];
245 
246  vlib_cli_output (vm,
247  " ring %u size %u fill %u "
248  "consume %u produce %u", rid,
249  rxq->size, ring->fill, ring->consume,
250  ring->produce);
251  if (show_descr)
252  {
253  vlib_cli_output (vm, "RX descriptors table");
254  vlib_cli_output (vm, " %5s %18s %10s",
255  "slot", "address", "flags");
256  for (desc_idx = 0; desc_idx < rxq->size; desc_idx++)
257  {
258  rxd = &rxq->rx_desc[rid][desc_idx];
259  vlib_cli_output (vm, " %5u 0x%016llx 0x%08x",
260  desc_idx, rxd->address, rxd->flags);
261  }
262  }
263  else if (show_one_table)
264  {
265  if (((which == VMXNET3_SHOW_RX_DESC0) && (rid == 0)) ||
266  ((which == VMXNET3_SHOW_RX_DESC1) && (rid == 1)))
267  {
268  vlib_cli_output (vm, "RX descriptors table");
269  vlib_cli_output (vm, " %5s %18s %10s",
270  "slot", "address", "flags");
271  if (show_one_slot)
272  {
273  rxd = &rxq->rx_desc[rid][slot];
274  vlib_cli_output (vm, " %5u 0x%016llx 0x%08x",
275  slot, rxd->address, rxd->flags);
276  }
277  else
278  for (desc_idx = 0; desc_idx < rxq->size; desc_idx++)
279  {
280  rxd = &rxq->rx_desc[rid][desc_idx];
281  vlib_cli_output (vm, " %5u 0x%016llx 0x%08x",
282  desc_idx, rxd->address,
283  rxd->flags);
284  }
285  }
286  }
287  }
288 
289  /* RX completion table */
290  if (show_descr)
291  {
292  vlib_cli_output (vm, "RX completion descriptors table");
293  vlib_cli_output (vm, " %5s %10s %10s %10s %10s",
294  "slot", "index", "rss", "len", "flags");
295  for (desc_idx = 0; desc_idx < rxq->size; desc_idx++)
296  {
297  rx_comp = &rxq->rx_comp[desc_idx];
298  vlib_cli_output (vm, " %5u 0x%08x %10u %10u 0x%08x",
299  desc_idx, rx_comp->index, rx_comp->rss,
300  rx_comp->len, rx_comp->flags);
301  }
302  }
303  else if (show_one_table)
304  {
305  if (which == VMXNET3_SHOW_RX_COMP)
306  {
307  vlib_cli_output (vm, "RX completion descriptors table");
308  vlib_cli_output (vm, " %5s %10s %10s %10s %10s",
309  "slot", "index", "rss", "len", "flags");
310  if (show_one_slot)
311  {
312  rx_comp = &rxq->rx_comp[slot];
313  vlib_cli_output (vm, " %5u 0x%08x %10u %10u 0x%08x",
314  slot, rx_comp->index, rx_comp->rss,
315  rx_comp->len, rx_comp->flags);
316  }
317  else
318  for (desc_idx = 0; desc_idx < rxq->size; desc_idx++)
319  {
320  rx_comp = &rxq->rx_comp[desc_idx];
321  vlib_cli_output (vm,
322  " %5u 0x%08x %10u %10u 0x%08x",
323  desc_idx, rx_comp->index, rx_comp->rss,
324  rx_comp->len, rx_comp->flags);
325  }
326  }
327  }
328  }
329 
330  vec_foreach_index (qid, vd->txqs)
331  {
332  txq = vec_elt_at_index (vd->txqs, qid);
333  vlib_cli_output (vm, " Queue %u (TX)", qid);
334  vlib_cli_output (vm, " TX completion next index %u",
335  txq->tx_comp_ring.next);
336  vlib_cli_output (vm, " TX completion generation flag 0x%x",
337  txq->tx_comp_ring.gen);
338  vlib_cli_output (vm, " size %u consume %u produce %u",
339  txq->size, txq->tx_ring.consume,
340  txq->tx_ring.produce);
341  if (show_descr)
342  {
343  vlib_cli_output (vm, "TX descriptors table");
344  vlib_cli_output (vm, " %5s %18s %10s %10s",
345  "slot", "address", "flags0", "flags1");
346  for (desc_idx = 0; desc_idx < txq->size; desc_idx++)
347  {
348  txd = &txq->tx_desc[desc_idx];
349  vlib_cli_output (vm, " %5u 0x%016llx 0x%08x 0x%08x",
350  desc_idx, txd->address, txd->flags[0],
351  txd->flags[1]);
352  }
353 
354  vlib_cli_output (vm, "TX completion descriptors table");
355  vlib_cli_output (vm, " %5s %10s %10s",
356  "slot", "index", "flags");
357  for (desc_idx = 0; desc_idx < txq->size; desc_idx++)
358  {
359  tx_comp = &txq->tx_comp[desc_idx];
360  vlib_cli_output (vm, " %5u 0x%08x 0x%08x",
361  desc_idx, tx_comp->index, tx_comp->flags);
362  }
363  }
364  else if (show_one_table)
365  {
366  if (which == VMXNET3_SHOW_TX_DESC)
367  {
368  vlib_cli_output (vm, "TX descriptors table");
369  vlib_cli_output (vm, " %5s %18s %10s %10s",
370  "slot", "address", "flags0", "flags1");
371  if (show_one_slot)
372  {
373  txd = &txq->tx_desc[slot];
374  vlib_cli_output (vm, " %5u 0x%016llx 0x%08x 0x%08x",
375  slot, txd->address, txd->flags[0],
376  txd->flags[1]);
377  }
378  else
379  for (desc_idx = 0; desc_idx < txq->size; desc_idx++)
380  {
381  txd = &txq->tx_desc[desc_idx];
382  vlib_cli_output (vm, " %5u 0x%016llx 0x%08x 0x%08x",
383  desc_idx, txd->address, txd->flags[0],
384  txd->flags[1]);
385  }
386  }
387  else if (which == VMXNET3_SHOW_TX_COMP)
388  {
389  vlib_cli_output (vm, "TX completion descriptors table");
390  vlib_cli_output (vm, " %5s %10s %10s",
391  "slot", "index", "flags");
392  if (show_one_slot)
393  {
394  tx_comp = &txq->tx_comp[slot];
395  vlib_cli_output (vm, " %5u 0x%08x 0x%08x",
396  slot, tx_comp->index, tx_comp->flags);
397  }
398  else
399  for (desc_idx = 0; desc_idx < txq->size; desc_idx++)
400  {
401  tx_comp = &txq->tx_comp[desc_idx];
402  vlib_cli_output (vm, " %5u 0x%08x 0x%08x",
403  desc_idx, tx_comp->index,
404  tx_comp->flags);
405  }
406  }
407  }
408  }
409  }
410 }
411 
412 static clib_error_t *
414  vlib_cli_command_t * cmd)
415 {
416  vmxnet3_main_t *vmxm = &vmxnet3_main;
417  vnet_main_t *vnm = &vnet_main;
418  vmxnet3_device_t *vd;
419  clib_error_t *error = 0;
420  u32 hw_if_index, *hw_if_indices = 0;
421  vnet_hw_interface_t *hi = 0;
422  u8 show_descr = 0, show_one_table = 0, show_one_slot = 0;
423  u32 which = ~0, slot;
424 
426  {
427  if (unformat
428  (input, "%U", unformat_vnet_hw_interface, vnm, &hw_if_index))
429  {
430  hi = vnet_get_hw_interface (vnm, hw_if_index);
431  if (vmxnet3_device_class.index != hi->dev_class_index)
432  {
433  error = clib_error_return (0, "unknown input `%U'",
434  format_unformat_error, input);
435  goto done;
436  }
437  vec_add1 (hw_if_indices, hw_if_index);
438  }
439  else if (unformat (input, "desc"))
440  show_descr = 1;
441  else if (hi)
442  {
443  vmxnet3_device_t *vd =
445 
446  if (unformat (input, "rx-comp"))
447  {
448  show_one_table = 1;
449  which = VMXNET3_SHOW_RX_COMP;
450  if (unformat (input, "%u", &slot))
451  {
452  vmxnet3_rxq_t *rxq = vec_elt_at_index (vd->rxqs, 0);
453 
454  if (slot >= rxq->size)
455  {
456  error = clib_error_return (0,
457  "slot size must be < rx queue "
458  "size %u", rxq->size);
459  goto done;
460  }
461  show_one_slot = 1;
462  }
463  }
464  else if (unformat (input, "rx-desc-0"))
465  {
466  show_one_table = 1;
467  which = VMXNET3_SHOW_RX_DESC0;
468  if (unformat (input, "%u", &slot))
469  {
470  vmxnet3_rxq_t *rxq = vec_elt_at_index (vd->rxqs, 0);
471 
472  if (slot >= rxq->size)
473  {
474  error = clib_error_return (0,
475  "slot size must be < rx queue "
476  "size %u", rxq->size);
477  goto done;
478  }
479  show_one_slot = 1;
480  }
481  }
482  else if (unformat (input, "rx-desc-1"))
483  {
484  show_one_table = 1;
485  which = VMXNET3_SHOW_RX_DESC1;
486  if (unformat (input, "%u", &slot))
487  {
488  vmxnet3_rxq_t *rxq = vec_elt_at_index (vd->rxqs, 0);
489 
490  if (slot >= rxq->size)
491  {
492  error = clib_error_return (0,
493  "slot size must be < rx queue "
494  "size %u", rxq->size);
495  goto done;
496  }
497  show_one_slot = 1;
498  }
499  }
500  else if (unformat (input, "tx-comp"))
501  {
502  show_one_table = 1;
503  which = VMXNET3_SHOW_TX_COMP;
504  if (unformat (input, "%u", &slot))
505  {
506  vmxnet3_txq_t *txq = vec_elt_at_index (vd->txqs, 0);
507 
508  if (slot >= txq->size)
509  {
510  error = clib_error_return (0,
511  "slot size must be < tx queue "
512  "size %u", txq->size);
513  goto done;
514  }
515  show_one_slot = 1;
516  }
517  }
518  else if (unformat (input, "tx-desc"))
519  {
520  show_one_table = 1;
521  which = VMXNET3_SHOW_TX_DESC;
522  if (unformat (input, "%u", &slot))
523  {
524  vmxnet3_txq_t *txq = vec_elt_at_index (vd->txqs, 0);
525 
526  if (slot >= txq->size)
527  {
528  error = clib_error_return (0,
529  "slot size must be < tx queue "
530  "size %u", txq->size);
531  goto done;
532  }
533  show_one_slot = 1;
534  }
535  }
536  else
537  {
538  error = clib_error_return (0, "unknown input `%U'",
539  format_unformat_error, input);
540  goto done;
541  }
542  }
543  else
544  {
545  error = clib_error_return (0, "unknown input `%U'",
546  format_unformat_error, input);
547  goto done;
548  }
549  }
550 
551  if (vec_len (hw_if_indices) == 0)
552  {
553  pool_foreach (vd, vmxm->devices,
554  vec_add1 (hw_if_indices, vd->hw_if_index);
555  );
556  }
557 
558  show_vmxnet3 (vm, hw_if_indices, show_descr, show_one_table, which,
559  show_one_slot, slot);
560 
561 done:
562  vec_free (hw_if_indices);
563  return error;
564 }
565 
566 /* *INDENT-OFF* */
567 VLIB_CLI_COMMAND (show_vmxnet3_command, static) = {
568  .path = "show vmxnet3",
569  .short_help = "show vmxnet3 [[<interface>] ([desc] | ([rx-comp] | "
570  "[rx-desc-0] | [rx-desc-1] | [tx-comp] | [tx-desc]) [<slot>])]",
571  .function = show_vmxnet3_fn,
572 };
573 /* *INDENT-ON* */
574 
575 clib_error_t *
577 {
578  vmxnet3_main_t *vmxm = &vmxnet3_main;
579 
580  /* initialize binary API */
582 
583  vmxm->log_default = vlib_log_register_class ("vmxnet3", 0);
584  return 0;
585 }
586 
588 
589 static clib_error_t *
591 {
592  vmxnet3_main_t *vmxm = &vmxnet3_main;
593 
595  {
596  if (unformat (input, "lro"))
597  vmxm->lro_configured = 1;
598  else
599  return clib_error_return (0, "unknown input `%U'",
600  format_unformat_error, input);
601  }
602 
603  return 0;
604 }
605 
606 /* vmxnet3 { ... } configuration. */
608 
609 /*
610  * fd.io coding-style-patch-verification: ON
611  *
612  * Local Variables:
613  * eval: (c-set-style "gnu")
614  * End:
615  */
unformat_function_t unformat_vnet_hw_interface
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
Definition: log.c:227
u32 sw_if_index
Definition: ipsec_gre.api:37
vmrglw vmrglh hi
void vmxnet3_delete_if(vlib_main_t *vm, vmxnet3_device_t *vd)
Definition: vmxnet3.c:842
#define vec_foreach_index(var, v)
Iterate over vector indices.
format_function_t format_vnet_hw_if_index_name
u8 lro_configured
Definition: vmxnet3.h:595
vnet_main_t * vnet_get_main(void)
Definition: misc.c:47
vmxnet3_rx_desc * rx_desc[VMXNET3_RX_RING_SIZE]
Definition: vmxnet3.h:520
#define NULL
Definition: clib.h:58
static clib_error_t * vmxnet3_create_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:30
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_pci_addr_t pci_addr
Definition: vmxnet3.h:565
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:522
vmxnet3_main_t vmxnet3_main
Definition: vmxnet3.c:28
int i
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:983
void vmxnet3_create_if(vlib_main_t *vm, vmxnet3_create_if_args_t *args)
Definition: vmxnet3.c:599
unformat_function_t unformat_vnet_sw_interface
unsigned char u8
Definition: types.h:56
vmxnet3_rxq_t * rxqs
Definition: vmxnet3.h:569
vlib_log_class_t log_default
Definition: vmxnet3.h:594
u8 * format_ethernet_address(u8 *s, va_list *args)
Definition: format.c:44
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Definition: pool.h:493
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:163
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define clib_error_return(e, args...)
Definition: error.h:99
unsigned int u32
Definition: types.h:88
vlib_pci_addr_t addr
Definition: vmxnet3.h:602
clib_error_t * vmxnet3_plugin_api_hookup(vlib_main_t *vm)
Definition: vmxnet3_api.c:229
clib_error_t * vmxnet3_cli_init(vlib_main_t *vm)
Definition: cli.c:576
static clib_error_t * vmxnet3_delete_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:80
unformat_function_t unformat_line_input
Definition: format.h:282
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:514
struct _unformat_input_t unformat_input_t
unsigned short u16
Definition: types.h:57
vmxnet3_rx_comp_ring rx_comp_ring
Definition: vmxnet3.h:522
vmxnet3_tx_comp_ring tx_comp_ring
Definition: vmxnet3.h:551
#define VMXNET3_RX_RING_SIZE
Definition: vmxnet3.h:158
unformat_function_t unformat_vlib_pci_addr
Definition: pci.h:323
vmxnet3_tx_comp * tx_comp
Definition: vmxnet3.h:549
#define VLIB_CONFIG_FUNCTION(x, n,...)
Definition: init.h:172
static clib_error_t * show_vmxnet3_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:413
vnet_main_t vnet_main
Definition: misc.c:43
#define UNFORMAT_END_OF_INPUT
Definition: format.h:144
vlib_main_t * vm
Definition: buffer.c:312
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:341
static vnet_hw_interface_t * vnet_get_sup_hw_interface_api_visible_or_null(vnet_main_t *vnm, u32 sw_if_index)
u8 mac_addr[6]
Definition: vmxnet3.h:577
vmxnet3_txq_t * txqs
Definition: vmxnet3.h:570
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:155
static clib_error_t * vmxnet3_config(vlib_main_t *vm, unformat_input_t *input)
Definition: cli.c:590
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void show_vmxnet3(vlib_main_t *vm, u32 *hw_if_indices, u8 show_descr, u8 show_one_table, u32 which, u8 show_one_slot, u32 slot)
Definition: cli.c:193
vmxnet3_tx_desc * tx_desc
Definition: vmxnet3.h:548
vnet_device_class_t vmxnet3_device_class
static void unformat_free(unformat_input_t *i)
Definition: format.h:162
vmxnet3_rx_comp * rx_comp
Definition: vmxnet3.h:521
vmxnet3_rx_ring rx_ring[VMXNET3_RX_RING_SIZE]
Definition: vmxnet3.h:519
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
vmxnet3_device_t * devices
Definition: vmxnet3.h:592
static clib_error_t * vmxnet3_test_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:132
vmxnet3_tx_ring tx_ring
Definition: vmxnet3.h:550
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:762
clib_error_t * error
Definition: vmxnet3.h:612
format_function_t format_vlib_pci_addr
Definition: pci.h:324
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:972
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:170