summaryrefslogtreecommitdiff
path: root/drivers/net/vmxnet3
diff options
context:
space:
mode:
authorChas Williams <chas3@att.com>2018-01-17 10:04:57 -0500
committerFerruh Yigit <ferruh.yigit@intel.com>2018-03-30 14:08:43 +0200
commit7a3d20151d4c947f6b2501b4e86a69c91e05b176 (patch)
tree5e48e7ad25b52b3113a1d6a88c1b75fcfe547c31 /drivers/net/vmxnet3
parent3e5810f31d9cafe1a49a098372467c1eda3bf4aa (diff)
downloaddpdk-next-eventdev-7a3d20151d4c947f6b2501b4e86a69c91e05b176.zip
dpdk-next-eventdev-7a3d20151d4c947f6b2501b4e86a69c91e05b176.tar.gz
dpdk-next-eventdev-7a3d20151d4c947f6b2501b4e86a69c91e05b176.tar.xz
net/vmxnet3: keep consistent link status
Bonding may examine the link properties to ensure that matching interfaces are bound together. If the link is going to have fixed properties, these need to remain consistent regardless of the link_status or the state of the adapter. Signed-off-by: Chas Williams <chas3@att.com> Acked-by: Shrikrishna Khare <skhare@vmware.com>
Diffstat (limited to 'drivers/net/vmxnet3')
-rw-r--r--drivers/net/vmxnet3/vmxnet3_ethdev.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index f1c24c7..e8f2d8c 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -267,6 +267,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
struct rte_pci_device *pci_dev;
struct vmxnet3_hw *hw = eth_dev->data->dev_private;
uint32_t mac_hi, mac_lo, ver;
+ struct rte_eth_link link;
PMD_INIT_FUNC_TRACE();
@@ -369,6 +370,13 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
memset(hw->saved_tx_stats, 0, sizeof(hw->saved_tx_stats));
memset(hw->saved_rx_stats, 0, sizeof(hw->saved_rx_stats));
+ /* set the initial link status */
+ memset(&link, 0, sizeof(link));
+ link.link_duplex = ETH_LINK_FULL_DUPLEX;
+ link.link_speed = ETH_SPEED_NUM_10G;
+ link.link_autoneg = ETH_LINK_FIXED;
+ vmxnet3_dev_atomic_write_link_status(eth_dev, &link);
+
return 0;
}
@@ -857,6 +865,9 @@ vmxnet3_dev_stop(struct rte_eth_dev *dev)
/* Clear recorded link status */
memset(&link, 0, sizeof(link));
+ link.link_duplex = ETH_LINK_FULL_DUPLEX;
+ link.link_speed = ETH_SPEED_NUM_10G;
+ link.link_autoneg = ETH_LINK_FIXED;
vmxnet3_dev_atomic_write_link_status(dev, &link);
}
@@ -1145,12 +1156,11 @@ __vmxnet3_dev_link_update(struct rte_eth_dev *dev,
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_LINK);
ret = VMXNET3_READ_BAR1_REG(hw, VMXNET3_REG_CMD);
- if (ret & 0x1) {
+ if (ret & 0x1)
link.link_status = ETH_LINK_UP;
- link.link_duplex = ETH_LINK_FULL_DUPLEX;
- link.link_speed = ETH_SPEED_NUM_10G;
- link.link_autoneg = ETH_LINK_AUTONEG;
- }
+ link.link_duplex = ETH_LINK_FULL_DUPLEX;
+ link.link_speed = ETH_SPEED_NUM_10G;
+ link.link_autoneg = ETH_LINK_AUTONEG;
vmxnet3_dev_atomic_write_link_status(dev, &link);