ASSERT (os_get_cpu_number () == 0);
- if (xd->admin_up)
+ if (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)
{
vnet_hw_interface_set_flags (dm->vnet_main, xd->vlib_hw_if_index, 0);
rte_eth_dev_stop (xd->device_index);
xd->device_index, rv);
}
- if (xd->admin_up)
+ if (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)
{
int rv;
rv = rte_eth_dev_start (xd->device_index);
if (ETHERNET_INTERFACE_FLAG_CONFIG_PROMISC (flags))
{
- old = xd->promisc;
- xd->promisc = flags & ETHERNET_INTERFACE_FLAG_ACCEPT_ALL;
+ old = (xd->flags & DPDK_DEVICE_FLAG_PROMISC) != 0;
- if (xd->admin_up)
+ if (flags & ETHERNET_INTERFACE_FLAG_ACCEPT_ALL)
+ xd->flags |= DPDK_DEVICE_FLAG_PROMISC;
+ else
+ xd->flags &= ~DPDK_DEVICE_FLAG_PROMISC;
+
+ if (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)
{
- if (xd->promisc)
+ if (xd->flags & DPDK_DEVICE_FLAG_PROMISC)
rte_eth_promiscuous_enable (xd->device_index);
else
rte_eth_promiscuous_disable (xd->device_index);
xd->port_conf.rxmode.max_rx_pkt_len = hi->max_packet_bytes;
- if (xd->admin_up)
+ if (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)
rte_eth_dev_stop (xd->device_index);
rv = rte_eth_dev_configure
rte_eth_dev_set_mtu (xd->device_index, hi->max_packet_bytes);
- if (xd->admin_up)
+ if (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP)
{
int rv = rte_eth_dev_start (xd->device_index);
if (rv < 0)
vlib_pci_main_t *pm = &pci_main;
clib_error_t *error;
vlib_pci_device_t *d;
- pci_config_header_t *c;
u8 *pci_addr = 0;
int num_whitelisted = vec_len (conf->dev_confs);
/* *INDENT-OFF* */
pool_foreach (d, pm->pci_devs, ({
dpdk_device_config_t * devconf = 0;
- c = &d->config0.header;
vec_reset_length (pci_addr);
pci_addr = format (pci_addr, "%U%c", format_vlib_pci_addr, &d->bus_address, 0);
- if (c->device_class != PCI_CLASS_NETWORK_ETHERNET)
+ if (d->device_class != PCI_CLASS_NETWORK_ETHERNET)
continue;
if (num_whitelisted)
}
/* virtio */
- if (c->vendor_id == 0x1af4 && c->device_id == 0x1000)
+ if (d->vendor_id == 0x1af4 && d->device_id == 0x1000)
;
/* vmxnet3 */
- else if (c->vendor_id == 0x15ad && c->device_id == 0x07b0)
+ else if (d->vendor_id == 0x15ad && d->device_id == 0x07b0)
;
/* all Intel devices */
- else if (c->vendor_id == 0x8086)
+ else if (d->vendor_id == 0x8086)
;
/* Cisco VIC */
- else if (c->vendor_id == 0x1137 && c->device_id == 0x0043)
+ else if (d->vendor_id == 0x1137 && d->device_id == 0x0043)
;
/* Chelsio T4/T5 */
- else if (c->vendor_id == 0x1425 && (c->device_id & 0xe000) == 0x4000)
+ else if (d->vendor_id == 0x1425 && (d->device_id & 0xe000) == 0x4000)
;
else
{
clib_warning ("Unsupported Ethernet PCI device 0x%04x:0x%04x found "
- "at PCI address %s\n", (u16) c->vendor_id, (u16) c->device_id,
+ "at PCI address %s\n", (u16) d->vendor_id, (u16) d->device_id,
pci_addr);
continue;
}
} *ed;
ed = ELOG_DATA (&vm->elog_main, e);
ed->sw_if_index = xd->vlib_sw_if_index;
- ed->admin_up = xd->admin_up;
+ ed->admin_up = (xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) != 0;
ed->old_link_state = (u8)
vnet_hw_interface_is_link_up (vnm, xd->vlib_hw_if_index);
ed->new_link_state = (u8) xd->link.link_status;
}
- if ((xd->admin_up == 1) &&
+ if ((xd->flags & DPDK_DEVICE_FLAG_ADMIN_UP) &&
((xd->link.link_status != 0) ^
vnet_hw_interface_is_link_up (vnm, xd->vlib_hw_if_index)))
{
clib_memcpy (bhi->hw_address, addr, 6);
clib_memcpy (bei->address, addr, 6);
/* Init l3 packet size allowed on bonded interface */
+ bhi->max_packet_bytes = ETHERNET_MAX_PACKET_BYTES;
bhi->max_l3_packet_bytes[VLIB_RX] =
bhi->max_l3_packet_bytes[VLIB_TX] =
ETHERNET_MAX_PACKET_BYTES - sizeof (ethernet_header_t);
vnet_get_sw_interface (vnm, sdev->vlib_sw_if_index);
shi->bond_info = VNET_HW_INTERFACE_BOND_INFO_SLAVE;
ssi->flags |= VNET_SW_INTERFACE_FLAG_BOND_SLAVE;
+
+ /* Set l3 packet size allowed as the lowest of slave */
+ if (bhi->max_l3_packet_bytes[VLIB_RX] >
+ shi->max_l3_packet_bytes[VLIB_RX])
+ bhi->max_l3_packet_bytes[VLIB_RX] =
+ bhi->max_l3_packet_bytes[VLIB_TX] =
+ shi->max_l3_packet_bytes[VLIB_RX];
+
+ /* Set max packet size allowed as the lowest of slave */
+ if (bhi->max_packet_bytes > shi->max_packet_bytes)
+ bhi->max_packet_bytes = shi->max_packet_bytes;
}
}
}