|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
44 #include <sys/types.h>
48 #include <sys/ioctl.h>
50 #include <linux/ethtool.h>
51 #include <linux/sockios.h>
73 vlib_pci_addr_t *
addr = 0, *addrs;
87 "Address",
"Sock",
"VID:PID",
"Link Speed",
"Driver",
88 "Product Name",
"Vital Product Data");
123 vlib_pci_addr_t *
addr = va_arg (*args, vlib_pci_addr_t *);
126 if (!
unformat (input,
"%x:%x:%x.%x", &x[0], &x[1], &x[2], &x[3]))
132 addr->function = x[3];
140 vlib_pci_addr_t *
addr = va_arg (*va, vlib_pci_addr_t *);
149 pcie_config_regs_t *
r =
154 return format (s,
"unknown");
156 width = (
r->link_status >> 4) & 0x3f;
158 if ((
r->link_status & 0xf) == 1)
159 return format (s,
"2.5 GT/s x%u", width);
160 if ((
r->link_status & 0xf) == 2)
161 return format (s,
"5.0 GT/s x%u", width);
162 if ((
r->link_status & 0xf) == 3)
163 return format (s,
"8.0 GT/s x%u", width);
164 if ((
r->link_status & 0xf) == 4)
165 return format (s,
"16.0 GT/s x%u", width);
166 return format (s,
"unknown");
173 u8 *
id = va_arg (*args,
u8 *);
175 char *string_types[] = {
"PN",
"EC",
"SN",
"MN", 0 };
185 if (
data[p] == 0 &&
data[p + 1] == 0)
194 char **
c = string_types;
219 const int max_bytes = 8;
224 if (
data[p + 2] > max_bytes)
235 p += 3 +
data[p + 2];
245 .short_help =
"show pci [all]",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
clib_error_t * pci_bus_init(vlib_main_t *vm)
vlib_pci_addr_t * vlib_pci_get_all_dev_addrs()
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
u8 * format_vlib_pci_addr(u8 *s, va_list *va)
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
vlib_log_class_t log_default
#define clib_error_return(e, args...)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vnet_hw_if_output_node_runtime_t * r
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u8 * format_vlib_pci_vpd(u8 *s, va_list *args)
uword unformat_vlib_pci_addr(unformat_input_t *input, va_list *args)
#define VLIB_CLI_COMMAND(x,...)
vlib_pci_device_info_t * vlib_pci_get_device_info(vlib_main_t *vm, vlib_pci_addr_t *addr, clib_error_t **error)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define vec_free(V)
Free vector's memory (no header).
description fragment has unexpected format
static clib_error_t * show_pci_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_INIT_FUNCTION(x)
#define vec_foreach(var, vec)
Vector iterator.
@ PCI_CLASS_NETWORK_ETHERNET
pci_config_type0_regs_t config0
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
static void * pci_config_find_capability(pci_config_type0_regs_t *t, int cap_type)
static void vlib_pci_free_device_info(vlib_pci_device_info_t *di)
u8 * format_vlib_pci_link_speed(u8 *s, va_list *va)
static vlib_cli_command_t show_pci_command
(constructor) VLIB_CLI_COMMAND (show_pci_command)