It is used to specify link speed of virtio device. Link speed is a part of
link status structure. It could be requested by application using
rte_eth_link_get_nowait function.
- (Default: 10000 (10G))
+ (Default: 0xffffffff (Unknown))
#. ``vectorized``:
It is used to specify link speed of virtio device. Link speed is a part of
link status structure. It could be requested by application using
rte_eth_link_get_nowait function.
- (Default: 10000 (10G))
+ (Default: 0xffffffff (Unknown))
#. ``vectorized``:
return 0;
}
-#define SPEED_UNKNOWN 0xffffffff
#define DUPLEX_UNKNOWN 0xff
/* reset device and renegotiate features if needed */
static int
hw->mac_addr[0], hw->mac_addr[1], hw->mac_addr[2],
hw->mac_addr[3], hw->mac_addr[4], hw->mac_addr[5]);
- if (hw->speed == SPEED_UNKNOWN) {
+ if (hw->speed == ETH_SPEED_NUM_UNKNOWN) {
if (vtpci_with_feature(hw, VIRTIO_NET_F_SPEED_DUPLEX)) {
config = &local_config;
vtpci_read_dev_config(hw,
hw->duplex = config->duplex;
}
}
- if (hw->speed == SPEED_UNKNOWN)
- hw->speed = ETH_SPEED_NUM_10G;
if (hw->duplex == DUPLEX_UNKNOWN)
hw->duplex = ETH_LINK_FULL_DUPLEX;
PMD_INIT_LOG(DEBUG, "link speed = %d, duplex = %d",
eth_virtio_dev_init(struct rte_eth_dev *eth_dev)
{
struct virtio_hw *hw = eth_dev->data->dev_private;
- uint32_t speed = SPEED_UNKNOWN;
+ uint32_t speed = ETH_SPEED_NUM_UNKNOWN;
int vectorized = 0;
int ret;
if (!hw->started) {
link.link_status = ETH_LINK_DOWN;
+ link.link_speed = ETH_SPEED_NUM_NONE;
} else if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) {
PMD_INIT_LOG(DEBUG, "Get link status from hw");
vtpci_read_dev_config(hw,
&status, sizeof(status));
if ((status & VIRTIO_NET_S_LINK_UP) == 0) {
link.link_status = ETH_LINK_DOWN;
+ link.link_speed = ETH_SPEED_NUM_NONE;
PMD_INIT_LOG(DEBUG, "Port %d is down",
dev->data->port_id);
} else {