DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chas Williams <3chas3@gmail.com>
To: dev@dpdk.org
Cc: skhare@vmware.com,
	"Charles (Chas) Williams" <ciwillia@mail.eng.vyatta.net>,
	Chas Williams <chas3@att.com>
Subject: [dpdk-dev] [PATCH 2/2] net/vmxnet3: keep consistent link status
Date: Wed, 17 Jan 2018 10:04:57 -0500	[thread overview]
Message-ID: <20180117150457.17806-2-3chas3@gmail.com> (raw)
In-Reply-To: <20180117150457.17806-1-3chas3@gmail.com>

From: "Charles (Chas) Williams" <ciwillia@mail.eng.vyatta.net>

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>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 776a0da..d5379dd 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_SPEED_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_SPEED_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);
 
-- 
2.9.5

  reply	other threads:[~2018-01-17 15:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 15:04 [dpdk-dev] [PATCH 1/2] net/vmxnet3: set the queue shared buffer at start Chas Williams
2018-01-17 15:04 ` Chas Williams [this message]
2018-03-12 17:45 ` Shrikrishna Khare
2018-03-13 15:20   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180117150457.17806-2-3chas3@gmail.com \
    --to=3chas3@gmail.com \
    --cc=chas3@att.com \
    --cc=ciwillia@mail.eng.vyatta.net \
    --cc=dev@dpdk.org \
    --cc=skhare@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).